ashneyderman
I am trying to install extra libraries into a running instance of elixir app. The app runs inside k8s container. I remote shell to the instance with kubectl exec -it then at the prompt:
bash# iex --name ddd@127.0.0.1 --cookie cookie --remsh app@127.0.0.1
and the I do this:
iex(app@127.0.0.1)1> Mix.install([:recon])
** (Mix.Error) Mix.install/2 cannot be used inside a Mix project
(mix 1.14.0) lib/mix.ex:513: Mix.raise/2
(mix 1.14.0) lib/mix.ex:656: Mix.install/2
iex:1: (file)
I do not understand what this means? Can anyone explain what it means? Why mix project is special? And if there is another way to install a dependency?
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #blog-post
- #ai
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Eiji
Mix.installwas added in order to improve work with single file scripts which obviously cannot define separatemix.exsfile. It uses internalAPIto … let’s say simulate a project by pushing some data (like dependencies) and executes the script after those are fetched and compiled … in the temporary directory.Anyway it’s not easy if you want to install
dependenciesafter deployment. Firstly you do not haveapplike indevenvironment, but arelease(d app) inprod. Those are much different and simply adding moredepssource code would not work or would cause another problems. You would need not only to send areleased dependencies, but also update the app itself. Also the directory structure is not guaranteed to be the same across all environments, so even if you would usemix deps.getor any otherdevtool the app may not even see new files. Not even saying thatmixis not always available onprodmachine. There are many other "but"s …It’s much more easier to
releasethe application again with a new dependencies. I honestly do not see why you want to do this from command line.ashneyderman
Not sure I understand all the complexities here. This is what I did to get recon going:
The reason re-deploys in this case are not a good idea is because you have a misbehaving instance already and you want to explore possible problems on that instance you rarely want to restart it.
Maybe it is worth adding another method to Mix.append_package/1 without doing all that extra checking. Code.append_path/1 does not take mix spec it would be totally handy if it did. Anyway just an idea.
lud
You can build the dependency by itself with
mix archive.buildand then upload the.ezfile to your server and add that to the code path. That way you can choose the exact version you upload. Of course it’s much more work than just calling mix install but you can script it.Eiji
Same for @ashneyderman, but in @lud’s reply the problem is more clear. What if some
hexarchive/package would have a dependency conflict with said project? This is one of many checksmixdo indevenvironment before fetching dependencies. Secondly those are really non-standard ways and they are extremely unclear. Even if there would be a nice way to do so inprodhow the rest devops team would know it’s available since they are not a part ofmix.exsanyway.Great! Simple man in the middle attack allows the attacker to have
userpermissions onprodmachine with a possibility of fetching more code. This is the difference betweendevwhere any compilable solution works andprodserver which needs to be secured. Not looked atmixsource, but I guess there at least should be some checksum checks.Especially if you have a
prodserver you don’t want to restart too often you should not mess up with the project and its dependencies. Just in case did you ever considered that something may go wrongwhen doing so? I discovered it on one project which is now not maintained, but it’s still a good example and especially when it’s unmaintained.
If you want to use
table_rexon yourself then you would notice lots of warnings about overwritten module. Obviously you could have a problem with updatingtable_rexsince a hard copy is obviously not maintained as well.If some
bugappears only inprodthen all you need to do is to run a copy of it on aVirtualBox. Same goes for database, if there are problems with it you can just create adump. If you have some extremely edge cases then anyway delivering a special feature for them is not something a core team would likely do.