Can't change anything in configuration omv-salt deploy fails

  • Hi, I have my omv installation running untouched for a while. Today I tried to add a new shared folder but when I tried to apply the configuration changes I got this error:


    Python
    Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; omv-salt deploy run --no-color monit 2>&1' with exit code '1': Traceback (most recent call last): File "/usr/sbin/omv-salt", line 151, in <module> sys.exit(main()) File "/usr/sbin/omv-salt", line 147, in main cli() File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/usr/sbin/omv-salt", line 133, in deploy_run caller = salt.client.Caller(mopts=mopts) File "/usr/lib/python3/dist-packages/salt/client/__init__.py", line 2098, in __init__ import salt.minion File "/usr/lib/python3/dist-packages/salt/minion.py", line 36, in  import salt.pillar File "/usr/lib/python3/dist-packages/salt/pillar/__init__.py", line 16, in  import salt.fileclient File "/usr/lib/python3/dist-packages/salt/fileclient.py", line 30, in  import salt.utils.templates File "/usr/lib/python3/dist-packages/salt/utils/templates.py", line 20, in  import salt.utils.jinja File "/usr/lib/python3/dist-packages/salt/utils/jinja.py", line 28, in  from jinja2 import BaseLoader, Markup, TemplateNotFound, nodes ImportError: cannot import name 'Markup' from 'jinja2' (/usr/local/lib/python3.7/dist-packages/jinja2/__init__.py)


    I reverted it and tried to make a simple configuration change (timeout settings for the webui) but I got the same error.

    I googled for the error and I found an issue that seems to be realted, but my knowledge of python and salt falls far short from this,


    What can I try?

    Thanks.

  • I tried to solve it myself and did a

    Code
    #pip3 install Jinja2==3.1.2

    Followed by a

    Code
    #pip3 install salt==3004.2

    After that the import error went away, but then I had an error complaining about


    Code
    Rendering SLS 'base:omv.deploy.avahi.services.webadmin' failed: Jinja variable 'salt.utils.templates.AliasedLoader object' has no attribute 'omv_conf.get'


    So I found this thread and followed the instructions:


    Code
    # salt-call saltutil.sync_modules
    # omv-salt stage run prepare

    And, finger crossed, everything seems fine now.


    Just an update. I have a new error:


    Code
    Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; omv-salt deploy run --no-color monit 2>&1' with exit code '1': omv.canonica: Data failed to compile: ---------- Rendering SLS 'base:omv.deploy.monit.default' failed: Jinja variable 'salt.utils.templates.AliasedLoader object' has no attribute 'omv_conf.get'
    • Official Post

    Don't use pip to install packages. You need salt and other python modules from the repos not pip.

    omv 7.7.10-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.8 | compose 7.6.10 | cterm 7.8.7 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.3.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Don't use pip to install packages. You need salt and other python modules from the repos not pip.

    Yes, I know it's better not to mix things up. But with only deb packages installed I got the error in the first post and I couldn't go any further, I found that post explaining my exact error with an update of Jinja2 and so I tought I could solve with that.

    I can uninstall pip packages if you have other things to try...

    • Official Post

    I can uninstall pip packages if you have other things to try...

    Uninstall them and then:

    sudo apt-get install --reinstall salt-common salt-minion python3-markupsafe Other packages may need to be re-installed as well. Upgrading to OMV 6.x might be a better option since it should replace every package.

    omv 7.7.10-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.8 | compose 7.6.10 | cterm 7.8.7 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.3.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Uninstall them and then:

    sudo apt-get install --reinstall salt-common salt-minion python3-markupsafe Other packages may need to be re-installed as well. Upgrading to OMV 6.x might be a better option since it should replace every package.


    Ok. I did and now I'm back with the same error as in post #1.

    Well, the error slightly changed an now says:

    Python
    Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; omv-salt deploy run --no-color monit 2>&1' with exit code '1': Traceback (most recent call last): File "/usr/sbin/omv-salt", line 26, in <module> import salt.client File "/usr/lib/python3/dist-packages/salt/client/__init__.py", line 40, in <module> import salt.utils.minions File "/usr/lib/python3/dist-packages/salt/utils/minions.py", line 12, in <module> import salt.auth.ldap File "/usr/lib/python3/dist-packages/salt/auth/ldap.py", line 11, in <module> from jinja2 import Environment File "/usr/lib/python3/dist-packages/jinja2/__init__.py", line 33, in <module> from jinja2.environment import Environment, Template File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 15, in <module> from jinja2 import nodes File "/usr/lib/python3/dist-packages/jinja2/nodes.py", line 19, in <module> from jinja2.utils import Markup File "/usr/lib/python3/dist-packages/jinja2/utils.py", line 647, in <module> from markupsafe import Markup, escape, soft_unicode ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.7/dist-packages/markupsafe/__init__.py)

    I would really like to avoid upgrading now since I'm away from home and I need my server to be accessible.

    • Official Post

    Did you look to see if the files the error mentions exist?


    Why does upgrading mean your server won't be accessible? I mean it won't during the reboot but the upgrade shouldn't take long.

    omv 7.7.10-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.8 | compose 7.6.10 | cterm 7.8.7 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.3.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Did you look to see if the files the error mentions exist?


    Why does upgrading mean your server won't be accessible? I mean it won't during the reboot but the upgrade shouldn't take long.

    Solved! Apparently some other installation installed markupsafe via pip and it bumped to version 2.1 which caused the problem.

    Now i pip uninstalled markupsafe and everything works again!


    I am reluctant to upgrade while away because if something goes wrong during the process I can't attach a monitor and check what went wrong. I know I can use screen but, when something breaks hard even screen is useless.

    Past upgrades I remember came with some caveat about what was installed in terms of plugins etc.

    Now I will read some docs and then eventually proceed.

    Thanks again!

    • Official Post

    Apparently some other installation installed markupsafe via pip

    Nothing with OMV did that. I would guess the pip commands you were running did that. Glad it works though.

    I am reluctant to upgrade while away because if something goes wrong during the process I can't attach a monitor and check what went wrong. I know I can use screen but, when something breaks hard even screen is useless.

    Past upgrades I remember came with some caveat about what was installed in terms of plugins etc.

    Generally the kernel and ssh don't fail to upgrade. If you have ssh, you should be able to fix any problem without a monitor. Previous upgrades did require removing some plugins that weren't ported but there are very few of those in the 5 to 6 upgrade. omv-extras plugins - porting progress to OMV 6.x (done)

    omv 7.7.10-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.8 | compose 7.6.10 | cterm 7.8.7 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.3.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Ok, my friend ryecoaaron ... I tried to upgrade but it failed. It seems quite bad

    Code
     Setting up systemd (247.3-7) ...
    systemd-machine-id-setup: error while loading shared libraries: libsystemd-shared-241.so: cannot open shared object file: No such file or directory
    dpkg: error processing package systemd (--configure):
     installed systemd package post-installation script subprocess returned error exit status 127
    Errors were encountered while processing:
     systemd


    Please, give me some help...

    • Official Post

    You aren't giving me much to work with. I have no idea how far it has gone.


    sudo apt-get -f install is the first thing I would do. Just don't reboot!

    omv 7.7.10-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.8 | compose 7.6.10 | cterm 7.8.7 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.3.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • You are right ryecoaaron but I cut the part I thought it was relevant for the error. Here is the output of the command.


    Code
    Setting up usrmerge (25) ...
    
    FATAL ERROR:
    Both /lib/x86_64-linux-gnu/libselinux.so.1 and /usr/lib/x86_64-linux-gnu/libselinux.so.1 exist.
    
    You can try correcting the errors reported and running again
    /usr/lib/usrmerge/convert-usrmerge until it will complete without errors.


    I also found on an ubuntu forum this solution:

    Code
    cd /var/lib/dpkg/info
    sudo rm usrmerge.*
    sudo apt-get -f install

    Do you think its safe to try?

    • Official Post

    Ah, usrmerge is failing. That is a whole different game but you will need to get that installed first. I would do what it says to fix usrmerge.

    omv 7.7.10-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.8 | compose 7.6.10 | cterm 7.8.7 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.3.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Official Post

    Do you think its safe to try?

    No. That will basically avoid usrmerge and then your python libraries will not work. Keep running /usr/lib/usrmerge/convert-usrmerge

    omv 7.7.10-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.8 | compose 7.6.10 | cterm 7.8.7 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.3.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • No. That will basically avoid usrmerge and then your python libraries will not work. Keep running /usr/lib/usrmerge/convert-usrmerge

    Code
    root@omv:/usr/bin# /usr/lib/usrmerge/convert-usrmerge
    
    FATAL ERROR:
    Both /lib/x86_64-linux-gnu/libselinux.so.1 and /usr/lib/x86_64-linux-gnu/libselinux.so.1 exist.
    
    You can try correcting the errors reported and running again
    /usr/lib/usrmerge/convert-usrmerge until it will complete without errors.
    Do not install or update other Debian packages until the program
    has been run successfully.


    The file in /usr/lib is older and doesn't belong to any package (as stated by dpkg -S).

    May I try to rename it to .bak?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!