archinstall icon indicating copy to clipboard operation
archinstall copied to clipboard

KeyError '_selected_servers'

Open z3ntu opened this issue 3 years ago • 11 comments

Hi, I've just tried installing with this in a fresh virt-manager VM with archiso 2021.06. The installation failed once (don't remember the exact error anymore) and when retrying with archinstall --config /var/log/archinstall/user_configuration.json it failed with this error:

Screenshot_20210722_201409

I have chosen server profile and selected only sshd (nr 7) in the prompt, it looks like this wasn't properly saved in the json?

Files: install.log user_configuration.json

z3ntu avatar Jul 22 '21 18:07 z3ntu

I am having this same issue. I have the profile set to server and I assume based on the prep function it is supposed to prompt you to select some of the server options.

https://github.com/archlinux/archinstall/blob/master/profiles/server.py

But it appears it is not doing that and it tries to select from an empty list of selections.

RustyRaptor avatar Aug 17 '21 18:08 RustyRaptor

and the log file seems to reflect that as well

Installing network profile Profile(server.py)
Now installing the selected servers.
'_selected_servers'

RustyRaptor avatar Aug 17 '21 18:08 RustyRaptor

Seems like I missed implementing selected_servers key in config

l4zy0n3 avatar Aug 17 '21 18:08 l4zy0n3

It just occured to me that I didnt run pacman -S archinstall before running so it might be an old version that came with this ISO. I got this ISO a week or so ago. So I am running again. I may need to check what version of archinstall i am running.

RustyRaptor avatar Aug 17 '21 19:08 RustyRaptor

Yeah ok i see now in the readme theres this section i did not follow. https://github.com/archlinux/archinstall#using-a-live-iso-image

RustyRaptor avatar Aug 17 '21 19:08 RustyRaptor

I am trying again after checking out v2.2.0

RustyRaptor avatar Aug 17 '21 19:08 RustyRaptor

Ok heres a status update. Seems to persist after checking out 2.2.0

Creating group postgres with gid 973.
                                                                                     
Installing network profile Profile(server)
Now installing the selected servers.
'_selected_servers'
[!] A log file has been created here: /var/log/archinstall/install.log
    Please submit this issue (and file) to https://github.com/archlinux/archinstall/issues
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.9/site-packages/archinstall-2.2.0-py3.9.egg/archinstall/__main__.py", line 4, in <module>
    archinstall.run_as_a_module()
  File "/usr/lib/python3.9/site-packages/archinstall-2.2.0-py3.9.egg/archinstall/__init__.py", line 87, in run_as_a_module
    script.execute()
  File "/usr/lib/python3.9/site-packages/archinstall-2.2.0-py3.9.egg/archinstall/lib/profiles.py", line 161, in execute
    self.spec.loader.exec_module(sys.modules[self.namespace])
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/archinstall-2.2.0-py3.9.egg/archinstall/examples/guided.py", line 464, in <module>
    perform_installation_steps()
  File "/usr/lib/python3.9/site-packages/archinstall-2.2.0-py3.9.egg/archinstall/examples/guided.py", line 323, in perform_installation_steps
    perform_installation(archinstall.storage.get('MOUNT_POINT', '/mnt'))
  File "/usr/lib/python3.9/site-packages/archinstall-2.2.0-py3.9.egg/archinstall/examples/guided.py", line 424, in perform_installation
    pass
  File "/usr/lib/python3.9/site-packages/archinstall-2.2.0-py3.9.egg/archinstall/lib/installer.py", line 89, in __exit__
    raise args[1]
  File "/usr/lib/python3.9/site-packages/archinstall-2.2.0-py3.9.egg/archinstall/examples/guided.py", line 381, in perform_installation
    installation.install_profile(archinstall.arguments.get('profile', None))
  File "/usr/lib/python3.9/site-packages/archinstall-2.2.0-py3.9.egg/archinstall/lib/installer.py", line 479, in install_profile
    return profile.install()
  File "/usr/lib/python3.9/site-packages/archinstall-2.2.0-py3.9.egg/archinstall/lib/profiles.py", line 183, in install
    return self.execute()
  File "/usr/lib/python3.9/site-packages/archinstall-2.2.0-py3.9.egg/archinstall/lib/profiles.py", line 161, in execute
    self.spec.loader.exec_module(sys.modules[self.namespace])
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/archinstall-2.2.0-py3.9.egg/archinstall/profiles/server.py", line 40, in <module>
    archinstall.log(archinstall.storage['_selected_servers'], level=logging.DEBUG)
KeyError: '_selected_servers'
python -m archinstall --config fif.conf  54.69s user 48.35s system 19% cpu 8:55.98 total

RustyRaptor avatar Aug 17 '21 20:08 RustyRaptor

fixed in #578, either use "servers": ["nginx", "postgresql", "sshd"], in config, else it will be prompted if servers is not present in config

l4zy0n3 avatar Aug 19 '21 22:08 l4zy0n3

I just had this problem again. The server selection wasn't saved to the config file, and archinstall didn't ask for servers to select one installing with said config file. Adding the "servers" entry to the config file manually fixed the issue.

skerit avatar Sep 01 '22 20:09 skerit

@skerit this isn't fixed yet, but the PR I referenced this issue in will fix it when it gets merged and then released :)

svartkanin avatar Sep 02 '22 00:09 svartkanin

I'll re-open this and let #1434 close it when it's ready to avoid confusion :)

Torxed avatar Sep 02 '22 10:09 Torxed

@Torxed we can close this as it should be resolved with the new profile manger

svartkanin avatar Apr 30 '23 09:04 svartkanin