Custom functions in queries not getting resolved

I started testing upgrading our datomic-pro versions from 0.9.5561.59 to 0.9.5703, and got the following strange error when using a custom function in a query via d/q:

java.lang.IllegalStateException: Attempting to call unbound fn: #'datomic.common/requiring-resolve
com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Attempting to call unbound fn: #'datomic.common/requiring-resolve

The trace up until my calling function is:

                                         my-app.users.lookup/find-by-email                     lookup.clj:   23
                                                                       ...                                     
                                                             datomic.api/q                        api.clj:   33
                                                             datomic.api/q                        api.clj:   35
                                                           datomic.query/q                      query.clj:  719
                                                                       ...                                     
                                         datomic.cache.WrappedGCache/valAt                      cache.clj:  106
                                                        datomic.cache/fn/G                      cache.clj:   67
                                                          datomic.cache/fn                      cache.clj:   75
                  com.google.common.cache.LocalCache$LocalLoadingCache.get                LocalCache.java: 5140
                              com.google.common.cache.LocalCache.getOrLoad                LocalCache.java: 4151
                                    com.google.common.cache.LocalCache.get                LocalCache.java: 4147
                            com.google.common.cache.LocalCache$Segment.get                LocalCache.java: 2212
                com.google.common.cache.LocalCache$Segment.lockedGetOrLoad                LocalCache.java: 2299
                       com.google.common.cache.LocalCache$Segment.loadSync                LocalCache.java: 2416
       com.google.common.cache.LocalCache$LoadingValueReference.loadFuture                LocalCache.java: 3708
                                           datomic.impl.FnCacheLoader.load             FnCacheLoader.java:   16
                                                  datomic.query/load-query                      query.clj:  601
                                                 datomic.query/parse-query                      query.clj:  597
                                       datomic.query/resolve-qualified-fns                      query.clj:  583
                                        datomic.query/resolve-qualified-fn                      query.clj:  578
                                                                       ...                                     
                java.lang.IllegalStateException: Attempting to call unbound fn: #'datomic.common/requiring-resolve
com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Attempting to call unbound fn: #'datomic.common/requiring-resolve

This is the entire namespace, which houses the failing query and the custom function:

(ns my-app.users.lookup
  (:require [clojure.string :as str]
            [datomic.api :as d]))


(defn cleaned-username [s]
  (-> s
      (str/lower-case)
      (str/trim)))


(defn find-by-email [db email]
  (let [email' (cleaned-username email)
        id     (d/q '[:find ?e .
                      :in $ ?input
                      :where
                      [?e :user/email ?email]
                      [(my-app.users.lookup/cleaned-username ?email) ?input]]
                    db email')]

    (if (some? id)
      (d/entity db id))))

Could this be related to the new classpath functions that came in 0.9.5703?

I’m also having this issue. Not sure what to do.

I believe this is a known bug that was introduced in version 0.9.5703 and fixed in version 0.9.5783.
See the release notes here: https://docs.datomic.com/on-prem/changes.html#0.9.5783