kentaro / mix_tasks_upload_hotswap

Deploy local code changes to the remote node(s) in a hot-code-swapping manner
https://github.com/kentaro/mix_tasks_upload_hotswap
MIT License
36 stars 1 forks source link

getting MatchError when trying to deploy to nerves device #2

Open ssachse opened 3 years ago

ssachse commented 3 years ago

Hello first of all, thank you, nice tool! Today I was fighting to integrate this into a running project of mine. So epmd is running fine. But after running mix upload.hotswap I get .... Type: :worker Successfully connected to nerves@nerves-121c.local ** (MatchError) no match of right hand side value: :undefined lib/mix/tasks/mix/tasks/upload/hotswap.ex:23: Mix.Tasks.Upload.Hotswap.run/1 (mix 1.10.2) lib/mix/task.ex:330: Mix.Task.run_task/3 (mix 1.10.2) lib/mix/cli.ex:82: Mix.CLI.run_task/2 (elixir 1.10.2) lib/code.ex:917: Code.require_file/2 seems that {:ok, modules} = :application.get_key(app_name, :modules)does not get the running app and its modules :-( What am I doing wrong ? Injecting a :application.which_applications |> IO.inspect() I get only these applications running [ {:gettext, 'Internationalization and localization through gettext', '0.18.2'}, {:phoenix, 'Productive. Reliable. Fast. A productive web framework that\ndoes not compromise speed or maintainability.\n', '1.5.7'}, {:plug, 'A specification and conveniences for composable modules between web applications', '1.11.0'}, {:mime, 'A MIME type module for Elixir', '1.5.0'}, {:plug_crypto, 'Crypto-related functionality for the web', '1.2.0'}, {:phoenix_pubsub, 'Distributed PubSub and Presence platform', '2.0.0'}, {:telemetry, 'Dynamic dispatching library for metrics and instrumentations', '0.4.2'}, {:eex, 'eex', '1.10.2'}, {:hex, 'hex', '0.20.6'}, {:inets, 'INETS CXC 138 49', '7.1.2'}, {:ssl, 'Erlang/OTP SSL application', '9.6'}, {:public_key, 'Public key infrastructure', '1.7.2'}, {:asn1, 'The Erlang ASN1 compiler version 5.0.10', '5.0.10'}, {:crypto, 'CRYPTO', '4.6.5'}, {:nerves_bootstrap, 'Nerves mix integration bootstrap and new project generator', '1.10.1'}, {:mix, 'mix', '1.10.2'}, {:logger, 'logger', '1.10.2'}, {:elixir, 'elixir', '1.10.2'}, {:compiler, 'ERTS CXC 138 10', '7.5.3'}, {:stdlib, 'ERTS CXC 138 10', '3.12'}, {:kernel, 'ERTS CXC 138 10', '6.5.2'} ] but not my application. :app_name is correctly set ....

kentaro commented 3 years ago

Sorry, I have missed this issue! However, it's unclear to me why your application modules are not loaded...