Hello! I'm facing issues with environment resoluti...
# ask-metaflow
f
Hello! I'm facing issues with environment resolution when trying to run a flow where it gets stuck on Resolving the environment. I set the conda debugging on and see that it is stuck at this :
Copy code
debug[conda /local/home/unmeshph/.cache/pypoetry/virtualenvs/saitama-SKj-zWo--py3.10/lib/python3.10/site-packages/metaflow_extensions/netflix_ext/plugins/conda/conda.py:317]: Environment is of type pip-only
debug[conda /local/home/unmeshph/.cache/pypoetry/virtualenvs/saitama-SKj-zWo--py3.10/lib/python3.10/site-packages/metaflow_extensions/netflix_ext/plugins/conda/conda.py:1984]: Creating builder conda environment
Any pointers on debugging this further?
d
this means that it is trying to create a conda environment. Can you see what command it is running (you can use ps and check for anything running conda or mamba or micromamba)
It’s likely stuck waiting for that to happen which can happen if your conda/mamba/micromamba install is bad/corrupted or stuck in an otherwise bad state.
I would check what command it is running and then you can run it again as well manually with a verbose mode. You can also probably try to remove some of the cached stuff in mamba/conda/micromamba and that usually gets things to work.
note that the command it is running should also be sliglty higher up in the debug log.
f
Do you know what is the directory containing the cache?
d
it depends on your installation. What is the commandline being executed? And then you can use the conda/mamba/micromamba binary to run <bin> info and it should tell you.
f
So my main command is running a flow with the
--environment=conda
flag. I cleared the caches for miniforge but same result. I think I need to clean up some other caches too ?
d
sorry, I meant the command it is running to create the builder environment
could you send me the full debug log above?
f
Here's the debug log
d
oh — this is a very old version of the extensions. Could you update to 1.1.2 please and retry?
(this was like a very beta version — lots has changed since so it would be harder for me to debug this older one)
you might also need mf 2.10+ I think.
f
okay I updated both. Here's the new one:
d
ok, so yes, it is basically doing this:
Copy code
/home/unmeshph/miniforge3/bin/mamba create --prefix /tmp/tmpp22df080/prefix --dry-run 'python==3.10.12' pip wheel tomli setuptools
and that is getting stuck.
what I was suggesting is seeing what that was by running a command like that as well (you can pick any empty directory for the prefix thing.
f
I ran it now, looks like it asks for a user prompt:
Copy code
Continue creating environment (y/[n])? y
d
is that so? OK, Well that would explain it. What version of mamba do you have. Mine doesn’t do that
or maybe there is a setting. let me know but am also looking
could you try this as well:
Copy code
/home/unmeshph/miniforge3/bin/mamba create --yes --prefix /tmp/tmpp22df080/prefix --dry-run 'python==3.10.12' pip wheel tomli setuptools
For some reason, mine does not require this flag but accepts it. See what that does. If that works, I’ll push a patch to add this option since some seem to require it.
f
yeah that seems to work
d
ok, so which version of mamba for my own education.
I’ll make a fix for it as well. Can this wait till tonight or so?
(it’s simple but am in the middle of smthing else)
f
yes can wait till tonight. Version of mamba is 1.4.2
d
intersting. that’s an older version. may be some flags in your config or something. It’s really weird that i have never seen this behavior.
f
should I try and upgrade mamba?
d
I don’t know. I’m surprised it doesn’t work for that one. I am pretty sure I had used it in the past. I would check if you have anything in your config files. I can’t find any setting that seems to have an impact (tried always_yes, extra_safety_checks)
At any rate, it’s an easy fix. Just surprised I’ve never run into this.
f
hmm okay will check, thanks for the help on this. If it still doesn't work, will wait for the fix
d
One line change: https://github.com/Netflix/metaflow-nflx-extensions/pull/33. Could you try that change locally and let me know. If all good, I’ll go ahead and merge. I did have it in another place but not here for some weird reason.
f
Hey @dry-beach-38304, looks like it is still getting stuck at the same place
So the argument is being passed in correctly but it is still stuck at creating the builder environment
d
did you add the “Priting arguments to the conda call”. Does it work in other cases. If so, can you send me the simple flow you are trying to do so I can try to reproduce it
f
Hey Romain, sorry for the late response. We digged around a bit more and found that there were some stray environment creation lock files lying around in the mamba directory which was causing the env resolution to get stuck. I believe these lock files were created since I had interrupted previous environment resolution attempts. Maybe this is something that can be accounted by having some cleanup to remove these locks?
d
Hey. I do create lock files but it should print out a message if thr lock isnt acquired within some time. I’ll check if that logic is broken. In other words, when it tries to acquire a lock, if it can’t, after some time it lets the user know. At least for the locks I create. Which lock ended up being the one that solved the problem?
f
There was a lock in the mamba directory which was called something like
mf-env.lock
d
hun. That’s weird. I can’t find that one in the code anywhere (I have mf_env-creation.lock mf_pkgs-update.lock. Maybe from some older version. At any rate, it all works now?
f
Ohh yeah I think those are the two. I did not remember the name exactly
d
Ok — they should print a message if stuck for a while. I’ll check if all that is correct.
f
Yeah I have had runs where it prints the message, but it wasn't doing so for the env resolution this time. At any rate, deleting those locks resolved it