hyperoceanic

hyperoceanic

Making Sense of Ash install problems

Having read the book, I’m keen to explore Ash a bit more, but I’m falling at the first hurdle - the creation of a new project.

Here’s my current Erlang and Elixir:

marksmith@Marks-macbook elixir_lizards % elixir -v
Erlang/OTP 29 [erts-17.0.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit] [dtrace]
Elixir 1.20.0 (compiled with Erlang/OTP 29)

And here’s the minmal Ash setup I created from the get-started page:

sh <(curl 'https://ash-hq.org/install/elixir_lizards') 
    && cd elixir_lizards && mix igniter.install ash 
    --setup --yes

Here goes, below. I know open source aint an obligation, ‘yeah, help us fix it’ and all, but as a newbie to Elixir, I’m out of my depth. I am going to pull out the errors as comments and try to resolve them, or seek help as I go.

Macbook Pro M1, 16Gb, Sonoma 14.4.1,

marksmith@Marks-macbook Projects % sh <(curl 'https://ash-hq.org/install/elixir_lizards') 
&& cd elixir_lizards && mix igniter.install ash 
--setup --yes
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100  1844  100  1844    0     0   5184      0 --:--:-- --:--:-- --:--:--  5179

Elixir is already installed ✓

Installing igniter_new archive...
Resolving Hex dependencies...
Resolution completed in 0.009s
New:
igniter_new 0.5.33

* Getting igniter_new (Hex package)
  All dependencies have been fetched
  Compiling 7 files (.ex)
  Generated igniter_new app
  Generated archive "igniter_new-0.5.33.ez" with MIX_ENV=prod
* creating /Users/marksmith/.mix/archives/igniter_new-0.5.33

Creating new Elixir project 'elixir_lizards' with the following packages:

15:11:24.413 \[notice\] TLS :client: In state :wait_cert_cr at ssl_handshake.erl:2278 generated CLIENT ALERT: Fatal - Handshake Failure

* {:bad_cert, :max_path_length_reached}


* creating README.md
* creating .formatter.exs
* creating .gitignore
* creating mix.exs
* creating lib
* creating lib/elixir_lizards.ex
* creating test
* creating test/test_helper.exs
* creating test/elixir_lizards_test.exs

Your Mix project was created successfully.
You can use "mix" to compile it, test it, and more:

cd elixir_lizards
mix test


Run "mix help" for more commands.
Fetching and compiling dependencies ⠘    warning: the variable "prefix" is accessed inside size(...) of a bitstring but it was defined outside of the match. You must precede it with the pin operator
│
50 │     with <<value::size(prefix), rest::binary>> <- bitstring do
│                        \~
│
└─ lib/hpax/types.ex:50:24: HPAX.Types.decode_integer/2

warning: the variable “length” is accessed inside size(…) of a bitstring but it was defined outside of the match. You must precede it with the pin operator


77 │          <<contents::binary-size(length), rest::binary>> <- rest do
│                                  \~
│
└─ lib/hpax/types.ex:77:34: HPAX.Types.decode_binary/1

warning: the variable “padding_size” is accessed inside size(…) of a bitstring but it was defined outside of the match. You must precede it with the pin operator


79 │     <<padding::size(padding_size)>> = padding
│                     \~
│
└─ lib/hpax/huffman.ex:79:21: HPAX.Huffman.decode/1

Fetching and compiling dependencies ⢀warning: "xref: \[exclude: ...\]" in your mix.exs file is deprecated, instead use: "elixirc_options: \[no_warn_undefined: ...\]"
(mix 1.20.0) lib/mix/tasks/compile.elixir.ex:243: Mix.Tasks.Compile.Elixir.xref_exclude_opts/2
(mix 1.20.0) lib/mix/tasks/compile.elixir.ex:142: Mix.Tasks.Compile.Elixir.run/1
(mix 1.20.0) lib/mix/task.ex:502: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.20.0) lib/mix/task.compiler.ex:299: Mix.Task.Compiler.run_compiler/2
(mix 1.20.0) lib/mix/task.compiler.ex:287: Mix.Task.Compiler.run/4
(mix 1.20.0) lib/mix/tasks/compile.all.ex:75: Mix.Tasks.Compile.All.do_run/2

Fetching and compiling dependencies ⠐     warning: this clause of defp range_end_key/1 is never used (or it will always fail/warn when invoked)
│
118 │   defp range_end_key(nil), do: {0, 0}
│        \~
│
└─ lib/ex_ast/rewriter.ex:118:8: ExAST.Rewriter.range_end_key/1

warning: the following clause is redundant:

def label({:%, _, [name, _]})

it has type:

dynamic({:%, term(), non_empty_list(term())})

previous clauses have already matched on the following types:

{atom(), term(), empty_list() or non_empty_list(term(), term())}


52 │   def label({:%, \_, \[name, \_\]}), do: {:struct, alias_parts(name)}
│       \~
│
└─ lib/ex_ast/diff/normalize.ex:52:7: ExAST.Diff.Normalize.label/1

warning: the following clause is redundant:

def label({:%{}, _, kvs}) when is_list(kvs)

it has type:

dynamic({:%{}, term(), empty_list() or non_empty_list(term(), term())})

previous clauses have already matched on the following types:

{atom(), term(), empty_list() or non_empty_list(term(), term())}


54 │   def label({:%{}, \_, kvs}) when is_list(kvs),
│       \~
│
└─ lib/ex_ast/diff/normalize.ex:54:7: ExAST.Diff.Normalize.label/1

Fetching and compiling dependencies ⢘     warning: the following conditional expression will always succeed:

 is_atom(arg)

because it evaluates to:

 dynamic(true)

where “arg” was given the type:

 # type: dynamic(atom())
 # from: lib/spitfire/env.ex:218:8
 is_atom(arg)

type warning found at:


220 │       with true <- is_atom(arg) and Code.ensure_loaded?(arg),
│       \~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~
│
└─ lib/spitfire/env.ex:220: Spitfire.Env.expand/3

Fetching and compiling dependencies ⠈      warning: comparison between distinct types found:

  token == :eof

given types:

  dynamic(not :"," and not :eof and not nil and not :"}") == :eof

where “token” was given the types:

  # type: dynamic(not nil)
  # from: lib/spitfire.ex:1702:13
  token == nil

  # type: dynamic(not :eof and not nil)
  # from: lib/spitfire.ex:1702:29
  token == :eof

  # type: dynamic(not :"," and not :eof and not nil)
  # from: lib/spitfire.ex:1706:45
  token == :","

  # type: dynamic(not :"," and not :eof and not nil and not :"}")
  # from: lib/spitfire.ex:1706:62
  token == :"}"

While Elixir can compare across all types, you are comparing across types which are always disjoint, and the result is either always true or always false

type warning found at:


1706 │           (token_type == :assoc_op or token == :"," or token == :"}" or token == :eof) -> 
│                                                                               \~
│
└─ lib/spitfire.ex:1706:79: Spitfire.skip_call_args/2

Fetching and compiling dependencies ⡄warning: "xref: \[exclude: ...\]" in your mix.exs file is deprecated, instead use: "elixirc_options: \[no_warn_undefined: ...\]"
(mix 1.20.0) lib/mix/tasks/compile.elixir.ex:243: Mix.Tasks.Compile.Elixir.xref_exclude_opts/2
(mix 1.20.0) lib/mix/tasks/compile.elixir.ex:142: Mix.Tasks.Compile.Elixir.run/1
(mix 1.20.0) lib/mix/task.ex:502: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.20.0) lib/mix/task.compiler.ex:299: Mix.Task.Compiler.run_compiler/2
(mix 1.20.0) lib/mix/task.compiler.ex:287: Mix.Task.Compiler.run/4
(mix 1.20.0) lib/mix/tasks/compile.all.ex:75: Mix.Tasks.Compile.All.do_run/2

Fetching and compiling dependencies ⢽warning: "xref: \[exclude: ...\]" in your mix.exs file is deprecated, instead use: "elixirc_options: \[no_warn_undefined: ...\]"
(mix 1.20.0) lib/mix/tasks/compile.elixir.ex:243: Mix.Tasks.Compile.Elixir.xref_exclude_opts/2
(mix 1.20.0) lib/mix/tasks/compile.elixir.ex:142: Mix.Tasks.Compile.Elixir.run/1
(mix 1.20.0) lib/mix/task.ex:502: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.20.0) lib/mix/task.compiler.ex:299: Mix.Task.Compiler.run_compiler/2
(mix 1.20.0) lib/mix/task.compiler.ex:287: Mix.Task.Compiler.run/4
(mix 1.20.0) lib/mix/tasks/compile.all.ex:75: Mix.Tasks.Compile.All.do_run/2

Fetching and compiling dependencies ⣷     warning: unknown key .issues in expression:

 igniter.issues

the given type does not have the given key:

 dynamic(%Rewrite{
   sources: term(),
   extensions: term(),
   hooks: term(),
   dot_formatter: term(),
   excluded: term()
 })

where “igniter” was given the type:

 # type: dynamic(%Rewrite{})
 # from: lib/igniter/test.ex:427:24
 Rewrite.source(igniter, path)

type warning found at:


435 │       if !Enum.any?(igniter.issues, fn found_issue -> 
│                             \~\~\~\~\~\~
│
└─ lib/igniter/test.ex:435:29: Igniter.Test.assert_has_issue/3

Fetching and compiling dependencies ✔
Initializing local git repository, staging all files, and committing ✔
checking for igniter in project ✔
Updating project's igniter dependency ✔
compiling igniter ✔
setting up igniter ✔
fetching deps ✔
compiling ash ✔
`ash.install` ✔
Resolving Hex dependencies...
Resolution completed in 0.104s
Unchanged:
ash 3.29.3
crux 0.1.3
decimal 3.1.1
ecto 3.14.0
ets 0.9.0
ex_ast 0.12.0
finch 0.23.0
glob_ex 0.1.11
hpax 1.0.3
igniter 0.8.2
iterex 0.1.2
jason 1.4.5
mime 2.0.7
mint 1.9.0
multigraph 0.16.1-mg.4
nimble_options 1.1.1
nimble_pool 1.1.0
owl 0.13.1
reactor 1.0.2
req 0.6.2
rewrite 1.3.0
sourceror 1.12.2
spark 2.7.2
spitfire 0.3.13
splode 0.3.1
stream_data 1.3.0
telemetry 1.4.2
text_diff 0.1.0
yamerl 0.10.0
yaml_elixir 2.12.2
ymlr 5.1.5
All dependencies have been fetched
==> ash
warning: the following clause cannot match because the previous clauses already matched all possible values:

  _ ->

it attempts to match on the result of:

  strip_load?(initial_data)

which has the already matched type:

  dynamic(false)

type warning found at:


2769 │       if strip_load?(initial_data) do
│       \~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~
│
└─ lib/ash/actions/read/read.ex:2769: Ash.Actions.Read.for_read/5

warning: the following clause cannot match because the previous clauses already matched all possible values:

  _ ->

it attempts to match on the result of:

  prefer_existing_loads?(query)

which has the already matched type:

  dynamic(false)

type warning found at:


2778 │         if prefer_existing_loads?(query) do
│         \~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~
│
└─ lib/ash/actions/read/read.ex:2778: Ash.Actions.Read.for_read/5

could not compile dependency :ash, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile ash --force", update it with "mix deps.update ash" or clean it with "mix deps.clean ash"
==> elixir_lizards
\*\* (Mix) the application :ash has a different value set for key :bulk_actions_default_to_errors? during runtime compared to compile time. Since this application environment entry was marked as compile time, this difference can lead to different behavior than expected:

* Compile time value was not set
* Runtime value was set to: true

To fix this error, you might:

* Make the runtime value match the compile time one

* Recompile your project. If the misconfigured application is a dependency, you may need to run "mix deps.clean ash --build"

* Alternatively, you can disable this check. If you are using releases, you can set :validate_compile_env to false in your release configuration. If you are using Mix to start your system, you can pass the --no-validate-compile-env flag

Task failed (exit code 1): mix ash.setup

Tasks that did not run:
• mix ash.setup

\*\* (Mix) mix ash.setup exited with code 1
marksmith@Marks-macbook elixir_lizards

Most Liked

zachdaniel

zachdaniel

Creator of Ash
hyperoceanic

hyperoceanic

Many thanks @zachdaniel and @albin for the quick turnaround. I can see a merge onto main and an update to igniter to 0.5.34. Running mix archive.install hex igniter_new --force got me that version and repaving the demo app with the curl script shows the fix from 2 to 10 length fixed it.

frankdugan3

frankdugan3

There was a plug error introduced and was fixed by a patch release. Try upgrading your deps and checking the current versions.

Also, there is an error that surfaces in Elixir 1.20.1 when running igniter to create a new project, so also upgrade Elixir to 1.20.2.

Where Next?

Popular in Troubleshooting Top

rayex
When I compile hex package io_ansi_plus, I get error “Codepoint failed”. Why? and why are the “Got:” and “Hint:” codepoints identical? It...
New
Sinc
I tried to run mix deps.get and get this error: 11:33:16.611 \[error\] Task #PID&lt;0.335.0&gt; started from :hex_fetcher terminating \*...
New
lunipaws
while setting up my development enviroment I encountered an issue that I just haven’t been able to resolve after running mix phx.gen.cer...
New
ChrisAmelia
Currently reading and experimenting through, which is in 1.6 Chapter 7: Sign up | Phoenix Tutorial (Phoenix 1.6) | Softcover.io In regar...
New
ktayah
Environment Oban Pro: 1.7.6 Oban: 2.22.1 Issue When a sub-workflow built with Workflow.put_context/2 is attached to a parent via ...
New
Lotoen
Hello, I am currently using Elixir 1.18.4 and OTP 27 with Linux Mint 22.3 - Cinnamon 64-bit as my operating system. I came across this er...
New
rayex
For hex package islands_score the source @spec for function format/2 is as such: @spec format(t, keyword) :: :ok Why does it show on 4 ...
New
anotherpit
A graft inside another graft causes Oban.Pro.Workflow.status to recurse forever. oban_pro 1.7.5 defmodule App.NestedGraftRepro.Test do ...
New
Lotoen
Hi, I’m on Linux Mint 22.3 - Cinnamon 64-bit, and I encountered an error when trying to build an elixir phoenix container 577.1 Reading...
New
ndan
Oban.Pro.Migration.up(version: "1.7.0", only: :indexes) fails on partitioned oban_jobs table when upgrading Oban Pro from 1.6 to 1.7 def...
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43806 214
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" =&gt; #BSON.ObjectId&lt;58eb1a7a9ad169198c3dXXXX&gt;, "email" =&gt; ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

We're in Beta

About us Mission Statement