Skip to content

macOS app fails to start Elixir standalone runtime with "no Elixir executable found in PATH" #908

@w0rd-driven

Description

@w0rd-driven

Environment

  • Elixir & Erlang/OTP versions (elixir --version):
Erlang/OTP 24 [erts-12.0.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit]

Elixir 1.13.2 (compiled with Erlang/OTP 24)
  • Elixir location:
> ~ which elixir
/Users/jbrayton/.asdf/shims/elixir
  • Operating system: macOS Big Sur
  • How have you started Livebook (mix phx.server, livebook CLI, Docker, etc): macOS app
  • Livebook version (use git rev-parse HEAD if running with mix): 0.5.0
  • Browsers that reproduce this bug (the more the merrier): Chrome
  • Include what is logged in the browser console:
[Report Only] Refused to create a worker from 'http://localhost:8080/js/editor.worker.js' because it violates the following Content Security Policy directive: "worker-src 'none'".

This only happens on page load so I don't think it's relevant as nothing is emitted to the console when cleared.

  • Include what is logged to the server console:

Current behavior

  1. Open the Elixir and Livebook notebook.
  2. Click Evaluate under the section Autocompletion to evaluate the hello world Elixir code.
  3. The error message Failed to setup runtime - no Elixir executable found in PATH is emitted.

Expected behavior

"Hello world" is output.

Workarounds tried

  1. Configuring the Runtime settings for Embedded, code like Hello world executes but Mix.install fails with
** (UndefinedFunctionError) function Mix.install/1 is undefined (module Mix is not available)
    Mix.install([kino: "~> 0.5.0"])
  1. Configuring the Runtime settings for Attached node, the rest of the notebook executes as expected.

Summary

I'm pretty sure the cli launches as a current user context but the application seems to only resolve system-wide paths, likely due to Big Sur's sandboxing. The attached node works because I'm executing the elixir process instead of the app.

The function that triggers the error is find_elixir_executable/0 and if I could get System.find_executable("elixir") to return the ASDF shim then I suspect it would function as expected.

I could personally use a system-wide elixir install but it would be beneficial to avoid this if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:desktopRelated to Livebook desktop appbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions