Installer crash

I'm trying to install ash with some goodies but I hit an unrecoverable error and everything crashes. I'm using OTP 27 per Zach's recommendation relevant logs
==> telemetry_metrics
Compiling 7 files (.ex)
** (EXIT from #PID<0.95.0>) an exception was raised:
** (RuntimeError) found error while checking types for Telemetry.Metrics.ConsoleReporter.terminate/2:

** (MatchError) no match of right hand side value: {:EXIT, {:badarg, [{:erlang, :binary_to_atom, [<<116, 101, 108, 101, 109, 101, 116, 114, 121, 96, 97, 116, 116, 97, 99, 104, 176, 97, 116, 116, 97, 99, 104, 95, 109, 97, 110, 121, 64, 116, 121, 112, 101, 96, 101, 114, 108, 97, 110, 103, 128, ...>>, :utf8], [error_info: %{module: :erl_erts_errors}]}, {:beam_lib, :extract_atom, 2, [file: ~c"beam_lib.erl", line: 1217]}, {:beam_lib, :get_atom_data, 8, [file: ~c"beam_lib.erl", line: 981]}, {:beam_lib, :scan_beam1, 2, [file: ~c"beam_lib.erl", line: 942]}, {:beam_lib, :scan_beam, 4, [file: ~c"beam_lib.erl", line: 927]}, {:beam_lib, :read_chunk_data, 3, [file: ~c"beam_lib.erl", line: 899]}, {:beam_lib, :read_chunk_data, 2, [file: ~c"beam_lib.erl", line: 890]}, {Module.ParallelChecker, :cache_module, 2, [file: ~c"lib/module/parallel_checker.ex", line: 360]}]}}
The exception happened while checking this code:

def terminate(_, events) do
for event <- events do
:telemetry.detach({Telemetry.Metrics.ConsoleReporter, event, :erlang.self()})
end

:ok
end

Please report this bug at: https://github.com/elixir-lang/elixir/issues

(stdlib 6.0) beam_lib.erl:899: :beam_lib.read_chunk_data/3
(stdlib 6.0) beam_lib.erl:890: :beam_lib.read_chunk_data/2
(elixir 1.17.0) lib/module/parallel_checker.ex:360: Module.ParallelChecker.cache_module/2
(elixir 1.17.0) lib/module/types/of.ex:318: Module.Types.Of.remote/6
(elixir 1.17.0) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
(elixir 1.17.0) lib/module/types/of.ex:299: Module.Types.Of.remote/8
(elixir 1.17.0) lib/module/types/expr.ex:333: Module.Types.Expr.of_expr/3
(elixir 1.17.0) lib/module/types/expr.ex:287: Module.Types.Expr.of_expr/3


Setup complete!
Project 'susflix' created with OTP 27 support
==> telemetry_metrics
Compiling 7 files (.ex)
** (EXIT from #PID<0.95.0>) an exception was raised:
** (RuntimeError) found error while checking types for Telemetry.Metrics.ConsoleReporter.terminate/2:

** (MatchError) no match of right hand side value: {:EXIT, {:badarg, [{:erlang, :binary_to_atom, [<<116, 101, 108, 101, 109, 101, 116, 114, 121, 96, 97, 116, 116, 97, 99, 104, 176, 97, 116, 116, 97, 99, 104, 95, 109, 97, 110, 121, 64, 116, 121, 112, 101, 96, 101, 114, 108, 97, 110, 103, 128, ...>>, :utf8], [error_info: %{module: :erl_erts_errors}]}, {:beam_lib, :extract_atom, 2, [file: ~c"beam_lib.erl", line: 1217]}, {:beam_lib, :get_atom_data, 8, [file: ~c"beam_lib.erl", line: 981]}, {:beam_lib, :scan_beam1, 2, [file: ~c"beam_lib.erl", line: 942]}, {:beam_lib, :scan_beam, 4, [file: ~c"beam_lib.erl", line: 927]}, {:beam_lib, :read_chunk_data, 3, [file: ~c"beam_lib.erl", line: 899]}, {:beam_lib, :read_chunk_data, 2, [file: ~c"beam_lib.erl", line: 890]}, {Module.ParallelChecker, :cache_module, 2, [file: ~c"lib/module/parallel_checker.ex", line: 360]}]}}
The exception happened while checking this code:

def terminate(_, events) do
for event <- events do
:telemetry.detach({Telemetry.Metrics.ConsoleReporter, event, :erlang.self()})
end

:ok
end

Please report this bug at: https://github.com/elixir-lang/elixir/issues

(stdlib 6.0) beam_lib.erl:899: :beam_lib.read_chunk_data/3
(stdlib 6.0) beam_lib.erl:890: :beam_lib.read_chunk_data/2
(elixir 1.17.0) lib/module/parallel_checker.ex:360: Module.ParallelChecker.cache_module/2
(elixir 1.17.0) lib/module/types/of.ex:318: Module.Types.Of.remote/6
(elixir 1.17.0) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
(elixir 1.17.0) lib/module/types/of.ex:299: Module.Types.Of.remote/8
(elixir 1.17.0) lib/module/types/expr.ex:333: Module.Types.Expr.of_expr/3
(elixir 1.17.0) lib/module/types/expr.ex:287: Module.Types.Expr.of_expr/3


Setup complete!
Project 'susflix' created with OTP 27 support
I have no idea what I'm doing peeps I'm a NodeJS dev in recovery
16 Replies
Gonzalo Muñoz
Gonzalo MuñozOP2mo ago
install commands setup_susflix.sh
#!/bin/bash

# Setup script for susflix with optional OTP 27 support
# Usage: ./setup_susflix.sh [otp27]

OTP_VERSION="${1:-28}" # Default to 28 if no argument provided

# Function to setup OTP 27
setup_otp27() {
echo "Setting up OTP 27..."

# Check if asdf is available
if ! command -v asdf &> /dev/null; then
echo "asdf is required for OTP 27 support. Install from: https://asdf-vm.com/"
exit 1
fi

# Ensure asdf plugins are installed
asdf plugin list | grep -q "erlang" || asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf plugin list | grep -q "elixir" || asdf plugin add elixir https://github.com/asdf-vm/asdf-elixir.git

# Install OTP 27 and Elixir 1.17.0 compiled against OTP 27
asdf install erlang 27.0
asdf install elixir 1.17.0-otp-27

# Set local versions
asdf local erlang 27.0
asdf local elixir 1.17.0-otp-27

echo "OTP 27 and Elixir 1.17.0-otp-27 configured"
}

# Setup OTP 27 if requested
if [ "$OTP_VERSION" = "otp27" ] || [ "$OTP_VERSION" = "27" ]; then
setup_otp27
fi

# Install required archives
mix archive.install hex igniter_new --force
mix archive.install hex phx_new 1.8.0-rc.4 --force

# Create new project
mix igniter.new susflix --with phx.new --install ash,ash_phoenix \
--install ash_postgres,ash_authentication \
--install ash_authentication_phoenix,ash_admin \
--install ash_oban,oban_web --install live_debugger,mishka_chelekom \
--install tidewave,ash_ai --install beacon,beacon_live_admin \
--auth-strategy magic_link --beacon.site cms \
--beacon-live-admin.path /cms/admin --yes

# Configure OTP 27 in the new project
cd susflix
if [ "$OTP_VERSION" = "otp27" ] || [ "$OTP_VERSION" = "27" ]; then
echo "erlang 27.0" > .tool-versions
echo "elixir 1.17.0-otp-27" >> .tool-versions
echo "Created .tool-versions file for OTP 27 in susflix/"
fi

# Run ash setup
mix ash.setup

echo ""
echo "Setup complete!"
if [ "$OTP_VERSION" = "otp27" ] || [ "$OTP_VERSION" = "27" ]; then
echo "Project 'susflix' created with OTP 27 support"
else
echo "Project 'susflix' created with default OTP version"
fi
#!/bin/bash

# Setup script for susflix with optional OTP 27 support
# Usage: ./setup_susflix.sh [otp27]

OTP_VERSION="${1:-28}" # Default to 28 if no argument provided

# Function to setup OTP 27
setup_otp27() {
echo "Setting up OTP 27..."

# Check if asdf is available
if ! command -v asdf &> /dev/null; then
echo "asdf is required for OTP 27 support. Install from: https://asdf-vm.com/"
exit 1
fi

# Ensure asdf plugins are installed
asdf plugin list | grep -q "erlang" || asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf plugin list | grep -q "elixir" || asdf plugin add elixir https://github.com/asdf-vm/asdf-elixir.git

# Install OTP 27 and Elixir 1.17.0 compiled against OTP 27
asdf install erlang 27.0
asdf install elixir 1.17.0-otp-27

# Set local versions
asdf local erlang 27.0
asdf local elixir 1.17.0-otp-27

echo "OTP 27 and Elixir 1.17.0-otp-27 configured"
}

# Setup OTP 27 if requested
if [ "$OTP_VERSION" = "otp27" ] || [ "$OTP_VERSION" = "27" ]; then
setup_otp27
fi

# Install required archives
mix archive.install hex igniter_new --force
mix archive.install hex phx_new 1.8.0-rc.4 --force

# Create new project
mix igniter.new susflix --with phx.new --install ash,ash_phoenix \
--install ash_postgres,ash_authentication \
--install ash_authentication_phoenix,ash_admin \
--install ash_oban,oban_web --install live_debugger,mishka_chelekom \
--install tidewave,ash_ai --install beacon,beacon_live_admin \
--auth-strategy magic_link --beacon.site cms \
--beacon-live-admin.path /cms/admin --yes

# Configure OTP 27 in the new project
cd susflix
if [ "$OTP_VERSION" = "otp27" ] || [ "$OTP_VERSION" = "27" ]; then
echo "erlang 27.0" > .tool-versions
echo "elixir 1.17.0-otp-27" >> .tool-versions
echo "Created .tool-versions file for OTP 27 in susflix/"
fi

# Run ash setup
mix ash.setup

echo ""
echo "Setup complete!"
if [ "$OTP_VERSION" = "otp27" ] || [ "$OTP_VERSION" = "27" ]; then
echo "Project 'susflix' created with OTP 27 support"
else
echo "Project 'susflix' created with default OTP version"
fi
ZachDaniel
ZachDaniel2mo ago
That doesn't look like a bug we can do anything about TBH Looks like an elixir bug Can you try latest elixir?
Gonzalo Muñoz
Gonzalo MuñozOP2mo ago
With Elixir 18 I got what I reported earlier: https://discord.com/channels/711271361523351632/711271361523351636/1396211593217441823 Using the latest of the latest (erlang 28.0.2 and elixir 1.19.0-rc.0-otp-28) I get something very similar:
Generated ash_phoenix app
==> ex_aws
Compiling 27 files (.ex)

== Compilation error in file lib/ex_aws/config/defaults.ex ==
** (ArgumentError) cannot inject attribute @partitions into function/macro because ~r/^(us|eu|af|ap|sa|ca|me)\-\w+\-\d+$/ contains a reference (#Reference<0.35992287.3600941066.40899>) and therefore it cannot be escaped (it must be defined within a function instead). The supported values are: lists, tuples, maps, atoms, numbers, bitstrings, PIDs and remote functions in the format &Mod.fun/arity
(elixir 1.19.0-rc.0) lib/kernel.ex:3878: Kernel.do_at_escape/2
(elixir 1.19.0-rc.0) expanding macro: Kernel.@/1
lib/ex_aws/config/defaults.ex:105: ExAws.Config.Defaults.host/2
could not compile dependency :ex_aws, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile ex_aws --force", update it with "mix deps.update ex_aws" or clean it with "mix deps.clean ex_aws"
Generated ash_phoenix app
==> ex_aws
Compiling 27 files (.ex)

== Compilation error in file lib/ex_aws/config/defaults.ex ==
** (ArgumentError) cannot inject attribute @partitions into function/macro because ~r/^(us|eu|af|ap|sa|ca|me)\-\w+\-\d+$/ contains a reference (#Reference<0.35992287.3600941066.40899>) and therefore it cannot be escaped (it must be defined within a function instead). The supported values are: lists, tuples, maps, atoms, numbers, bitstrings, PIDs and remote functions in the format &Mod.fun/arity
(elixir 1.19.0-rc.0) lib/kernel.ex:3878: Kernel.do_at_escape/2
(elixir 1.19.0-rc.0) expanding macro: Kernel.@/1
lib/ex_aws/config/defaults.ex:105: ExAws.Config.Defaults.host/2
could not compile dependency :ex_aws, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile ex_aws --force", update it with "mix deps.update ex_aws" or clean it with "mix deps.clean ex_aws"
ZachDaniel
ZachDaniel2mo ago
You can't use OTP 28 OTP 27 and Elixir 1.8
Gonzalo Muñoz
Gonzalo MuñozOP2mo ago
ok I think I got the versions right now, but the problem remains: Using OTP 27.3.4.2 and Elixir 1.18.4-otp-27
==> ex_aws
Compiling 27 files (.ex)

== Compilation error in file lib/ex_aws/config/defaults.ex ==
** (ArgumentError) cannot inject attribute @partitions into function/macro because cannot escape #Reference<0.1870358408.143261702.203998>. The supported values are: lists, tuples, maps, atoms, numbers, bitstrings, PIDs and remote functions in the format &Mod.fun/arity
(elixir 1.18.4) lib/kernel.ex:3777: Kernel.do_at_escape/2
(elixir 1.18.4) expanding macro: Kernel.@/1
lib/ex_aws/config/defaults.ex:105: ExAws.Config.Defaults.host/2
could not compile dependency :ex_aws, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile ex_aws --force", update it with "mix deps.update ex_aws" or clean it with "mix deps.clean ex_aws"
==> ex_aws
Compiling 27 files (.ex)

== Compilation error in file lib/ex_aws/config/defaults.ex ==
** (ArgumentError) cannot inject attribute @partitions into function/macro because cannot escape #Reference<0.1870358408.143261702.203998>. The supported values are: lists, tuples, maps, atoms, numbers, bitstrings, PIDs and remote functions in the format &Mod.fun/arity
(elixir 1.18.4) lib/kernel.ex:3777: Kernel.do_at_escape/2
(elixir 1.18.4) expanding macro: Kernel.@/1
lib/ex_aws/config/defaults.ex:105: ExAws.Config.Defaults.host/2
could not compile dependency :ex_aws, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile ex_aws --force", update it with "mix deps.update ex_aws" or clean it with "mix deps.clean ex_aws"
Do you know which Ash extension needs it as a dependency? Maybe I can live without it for the time being I will keep trying different combinations of Elixir & OTP in the meantime
Gonzalo Muñoz
Gonzalo MuñozOP2mo ago
No description
ZachDaniel
ZachDaniel2mo ago
🤔 that really doesn't make any sense That error doesn't exist in OTP 27 have you blown away _build
Gonzalo Muñoz
Gonzalo MuñozOP2mo ago
I rm -rf the entire thing before starting every time
ZachDaniel
ZachDaniel2mo ago
🤔 elixir --version mix deps.clean --all ? I don't think that any Ash thing depends on ex_aws
Gonzalo Muñoz
Gonzalo MuñozOP2mo ago
It's weird. I always start from scratch, so there is no previous build. And I run only these commands:
#!/bin/bash

set -e

source functions.sh

select_and_install "erlang" "OTP"
select_and_install "elixir" "Elixir"

echo
echo "Using OTP $(get_asdf_version erlang) and Elixir $(get_asdf_version elixir)"
echo

# Run the original install steps
PROJECT_NAME="$1"
if [ -z "$PROJECT_NAME" ]; then
echo "Usage: $0 <project_name>"
exit 1
fi

mix archive.install hex igniter_new --force
mix archive.install hex phx_new 1.8.0-rc.4 --force

mix igniter.new "$PROJECT_NAME" --with phx.new --install ash,ash_phoenix \
--install ash_postgres,ash_authentication \
--install ash_authentication_phoenix,ash_admin \
--install ash_oban,oban_web --install live_debugger,mishka_chelekom \
--install tidewave,ash_ai --install beacon,beacon_live_admin \
--auth-strategy magic_link --beacon.site cms \
--beacon-live-admin.path /cms/admin --yes
#!/bin/bash

set -e

source functions.sh

select_and_install "erlang" "OTP"
select_and_install "elixir" "Elixir"

echo
echo "Using OTP $(get_asdf_version erlang) and Elixir $(get_asdf_version elixir)"
echo

# Run the original install steps
PROJECT_NAME="$1"
if [ -z "$PROJECT_NAME" ]; then
echo "Usage: $0 <project_name>"
exit 1
fi

mix archive.install hex igniter_new --force
mix archive.install hex phx_new 1.8.0-rc.4 --force

mix igniter.new "$PROJECT_NAME" --with phx.new --install ash,ash_phoenix \
--install ash_postgres,ash_authentication \
--install ash_authentication_phoenix,ash_admin \
--install ash_oban,oban_web --install live_debugger,mishka_chelekom \
--install tidewave,ash_ai --install beacon,beacon_live_admin \
--auth-strategy magic_link --beacon.site cms \
--beacon-live-admin.path /cms/admin --yes
No description
Gonzalo Muñoz
Gonzalo MuñozOP2mo ago
clear && rm -rf susflix .tool-versions; bash setup_elixir_fullstack.sh susflix
clear && rm -rf susflix .tool-versions; bash setup_elixir_fullstack.sh susflix
ZachDaniel
ZachDaniel2mo ago
I don't really know what those things in your script do but I just can't see why you'dbe getting that. I can only assume it is beacon causing the issue, and that you are somehow using newer OTP that error makes no sense otherwise.
Gonzalo Muñoz
Gonzalo MuñozOP2mo ago
The functions are just clean wrappers to set up the proper erlang & elixir versions using asdf. And then I only run what ash-hq gives me when I select the packages I want to install along with Ash
ZachDaniel
ZachDaniel2mo ago
try taking beacon out of the picture
Gonzalo Muñoz
Gonzalo MuñozOP2mo ago
And the version switchers are working fine, I can see the different versions working Will do and come back ok after taking out beacon it finally worked. I even used the very latest of everything and compiled without issue
ZachDaniel
ZachDaniel2mo ago
😢

Did you find this page helpful?