Liking cljdoc? Tell your friends :D

Troubleshooting

  1. Running bb stack:sync results in:

    [holy-lambda] Project did not sync properly. Remove .holy-lambda directory and run stack:sync
    

    Solution:

    bb stack:purge && bb stack:sync
    
  2. Commands are failing:

    Solution:

    bb stack:purge && bb stack:doctor
    

    Fix all errors reported by the tool. If you still experience any issue please report it at Github.

  3. GraalVM native-image compilation fails due to not enough RAM memory on MacOS

    Solution: Increase the RAM limit in Docker UI preferences.

  4. Command bb stack:invoke fails with the following message

    Mounting /path-to-source/holy-lambda-example/src as /var/task:ro,delegated inside runtime container
    START RequestId: 4dc6fcf5-7db2-4854-bba7-abae8038ef8f Version: $LATEST
    time="2021-05-17T16:52:48.278" level=error msg="Init failed" InvokeID= error="Couldn't find valid bootstrap(s): [/var/task/bootstrap /opt/bootstrap   /var/runtime/bootstrap]"
    time="2021-05-17T16:52:48.279" level=error msg="INIT DONE failed: Runtime.InvalidEntrypoint"
    

    Solution The layers of your template have not been configured correctly. Ensure that stack:sync reports an ARN and it has been added to the template.yml

  5. Could not find /project/.holy-lambda/clojure-tools-1.10.3.849.jar

    Solution Ignore this. Nothing bad happens!

  6. Fatal error:com.oracle.svm.core.util.VMError$HostedError: SomeClassDefinition has no code offset set

    From my experience this issue occurs when GraalVM is unable to find the definition of the class or the class on runtime mismatches with the one which is compiled.

    Common scenarios in which the error occurs are:

    • using eval with quote instead of using defmacro
    • using local library which is packed by lein uberjar (use depstar instead)
    • full aot compilation of the whole library (only main class should be aot compiled)
    • code which tries to produce the class on both compilation and run phase
  7. Unable to use local library with holy-lambda

    Solution Holy lambda uses docker context for reproducible builds and GraalVM native-image compilation, therefore local libraries referenced in deps.edn will not work out of the box. However it's fairly simple to support local libraries via :docker:volumes + custom clojure alias.

    Example Let's assuming following project structure, where:

    modules/holy-lambda-babashka-tasks - Project which should reference local library holy-lambda from the root path. This module is both testing environment for bb tasks and the holy-lambda tasks source which is distributed via :git/url + :sha to end user projects.

    holy-lambda - Project which ships with custom runtime. We want to test new features of the runtime in special tasks environment, before we ship the new release of the runtime to the end users.

     .
     ├── CHANGELOG.md
     ├── deps.edn
     ├── modules
     │   ├── holy-lambda-babashka-tasks
     │       ├── bb.edn
     │       ├── deps.edn
     │       ├── envs.json
     │       ├── src
     │       │   ├── example
     │       │   │   └── core.cljc
     │       │   └── holy_lambda
     │       │       └── tasks.clj
     │       └── template.yml
     ├── project.clj
     ├── src
     │   └── fierycod
     │       └── holy_lambda
     │           ├── agent.clj
     │           ├── core.cljc
     │           ├── interceptor.cljc
     │           ├── java_runtime.clj
     │           ├── native_runtime.clj
     │           ├── response.clj
     │           └── util.cljc
    

    In order to let holy-lambda-babashka-tasks use local holy-lambda library we have to change it's bb.edn:

    1. Navigate to :holy-lambda/options:docker:volumes

    2. Reference local library relative path and mount the local library to docker path

      :holy-lambda/options {:docker {:volumes [{:docker     "/holy-lambda"
                                                :host       "../../"}]
                                      ...
                                      }
                            ...
                            }
      
      
  8. We can check if volume has been succesfully mounted by running:

    bb docker:run "ls -la /holy-lambda"
    
  9. As a last step we have to use :replace-deps in deps.edn in some alias and reference the alias in bb.edn:holy-lambda/options:build:clj-alias, so that deps available in docker context could be added to the classpath.

    deps.edn in holy-lambda-babashka-tasks:

     :aliases {:holy-lambda
               {:replace-deps {org.clojure/clojure {:mvn/version "1.10.3"}
                               io.github.FieryCod/holy-lambda {:local/root "/holy-lambda"}}}} ;; <-- as you can see the root path of the local library corresponds to the :docker mount directory.
    

    bb.edn in holy-lambda-babashka-tasks:

     :holy-lambda/options {...
    
                           :build {:clj-alias :holy-lambda} ;; <-- reference alias from deps.edn
                           ...
                           }
    

Now your local library should work well with holy-lambda! :)

  1. Empty .aws directory created.

    Solution: If you see anywhere .aws empty directory then remove it and update HL stack.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close