[GH-ISSUE #1810] Error while installing modoboa #1423

Closed
opened 2026-02-27 11:17:02 +03:00 by kerem · 5 comments
Owner

Originally created by @IndexOutOfMJ on GitHub (Dec 28, 2019).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1810

Hey,

I currently try to install modoboa.

Impact version

  • Modoboa: latest
  • installer used: Yes
  • Webserver: Nginx

Steps to reproduce

sudo ./run.py mydomain.eu

Current behavior

Your mail server will be installed with the following components:
modoboa automx amavis clamav dovecot nginx razor postfix postwhite spamassassin uwsgi radicale opendkim
Do you confirm? (Y/n)
The process can be long, feel free to take a coffee and come back later ;)
Starting...
Generating new certificate using letsencrypt
Installing amavis
Installing spamassassin
Installing razor
Installing clamav
Installing modoboa

>Traceback (most recent call last): File "./run.py", line 136, in <module> main(sys.argv[1:]) File "./run.py", line 120, in main scripts.install("modoboa", config, args.upgrade) File "/root/modoboa-installer/modoboa_installer/scripts/__init__.py", line 22, in install getattr(script, appname.capitalize())(config, upgrade).run() File "/root/modoboa-installer/modoboa_installer/scripts/base.py", line 155, in run self.post_run() File "/root/modoboa-installer/modoboa_installer/scripts/modoboa.py", line 250, in post_run self._deploy_instance() File "/root/modoboa-installer/modoboa_installer/scripts/modoboa.py", line 162, in _deploy_instance sudo_user=self.user, cwd=self.home_dir) File "/root/modoboa-installer/modoboa_installer/utils.py", line 68, in exec_cmd process = subprocess.Popen(cmd, **kwargs) File "/usr/lib/python2.7/subprocess.py", line 390, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory: '/srv/modoboa'

I don't think that should happen.

Originally created by @IndexOutOfMJ on GitHub (Dec 28, 2019). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1810 Hey, I currently try to install modoboa. # Impact version * Modoboa: latest * installer used: Yes * Webserver: Nginx # Steps to reproduce sudo ./run.py mydomain.eu # Current behavior Your mail server will be installed with the following components: modoboa automx amavis clamav dovecot nginx razor postfix postwhite spamassassin uwsgi radicale opendkim Do you confirm? (Y/n) The process can be long, feel free to take a coffee and come back later ;) Starting... Generating new certificate using letsencrypt Installing amavis Installing spamassassin Installing razor Installing clamav Installing modoboa `>Traceback (most recent call last): File "./run.py", line 136, in <module> main(sys.argv[1:]) File "./run.py", line 120, in main scripts.install("modoboa", config, args.upgrade) File "/root/modoboa-installer/modoboa_installer/scripts/__init__.py", line 22, in install getattr(script, appname.capitalize())(config, upgrade).run() File "/root/modoboa-installer/modoboa_installer/scripts/base.py", line 155, in run self.post_run() File "/root/modoboa-installer/modoboa_installer/scripts/modoboa.py", line 250, in post_run self._deploy_instance() File "/root/modoboa-installer/modoboa_installer/scripts/modoboa.py", line 162, in _deploy_instance sudo_user=self.user, cwd=self.home_dir) File "/root/modoboa-installer/modoboa_installer/utils.py", line 68, in exec_cmd process = subprocess.Popen(cmd, **kwargs) File "/usr/lib/python2.7/subprocess.py", line 390, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory: '/srv/modoboa'` I don't think that should happen.
kerem closed this issue 2026-02-27 11:17:03 +03:00
Author
Owner

@tonioo commented on GitHub (Jan 6, 2020):

@IndexOutOfMJ On with distribution are you trying to install modoboa? Have you tried using the --debug option?

<!-- gh-comment-id:571059488 --> @tonioo commented on GitHub (Jan 6, 2020): @IndexOutOfMJ On with distribution are you trying to install modoboa? Have you tried using the --debug option?
Author
Owner

@jasonhensler commented on GitHub (Feb 24, 2022):

I'll leave this for anyone else whom runs into the same issue as it was not immediately apparent as to the cause. I ran into the same issue on a fresh Debian 11 install when running as root (not sudo). I found that this would fail with the error FileNotFoundError: [Errno 2] No such file or directory: '/srv/modoboa'. When using --debug I could see the install failed silently in the background to find the service command and then spat out the error [Errno 2] No such file or directory: '/srv/modoboa'.

The issue was that the PATH variable did not include sbin paths, ie /sbin, /usr/sbin, /usr/local/sbin. By adding these to PATH I was able to install without issue, ie export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin.

<!-- gh-comment-id:1050059150 --> @jasonhensler commented on GitHub (Feb 24, 2022): I'll leave this for anyone else whom runs into the same issue as it was not immediately apparent as to the cause. I ran into the same issue on a fresh Debian 11 install when running as root (not sudo). I found that this would fail with the error FileNotFoundError: [Errno 2] No such file or directory: '/srv/modoboa'. When using --debug I could see the install failed silently in the background to find the service command and then spat out the error [Errno 2] No such file or directory: '/srv/modoboa'. The issue was that the PATH variable did not include sbin paths, ie /sbin, /usr/sbin, /usr/local/sbin. By adding these to PATH I was able to install without issue, ie export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin.
Author
Owner

@ecsgh commented on GitHub (May 14, 2022):

I have exactly the same error. I am also using Debian 11.
Programs in sbin, such as useradd are not found.
But if I change to root with "su -", the minus sign is important, it finds programs under /sbin/ and the installer runs through.

Is this a normal behavior, or a bug in Debian or a bug in the installer?

<!-- gh-comment-id:1126674862 --> @ecsgh commented on GitHub (May 14, 2022): I have exactly the same error. I am also using Debian 11. Programs in sbin, such as useradd are not found. But if I change to root with "su -", the minus sign is important, it finds programs under */sbin/* and the installer runs through. Is this a normal behavior, or a bug in Debian or a bug in the installer?
Author
Owner

@tonioo commented on GitHub (May 18, 2022):

@ecsgh It's a normal behaviour. The - sign (or -i option with sudo) tells the command to load the target user environment variables. If you do not specify those options, then the environment of the original user is used. With a regular user, the PATH variable won't include /sbin and /usr/sbin folders.

<!-- gh-comment-id:1129757853 --> @tonioo commented on GitHub (May 18, 2022): @ecsgh It's a normal behaviour. The - sign (or -i option with sudo) tells the command to load the target user environment variables. If you do not specify those options, then the environment of the original user is used. With a regular user, the PATH variable won't include /sbin and /usr/sbin folders.
Author
Owner

@ecsgh commented on GitHub (May 18, 2022):

Yes I know what "-" does.
But I think that should be taken into the documentation, because as it currently stands in it, the installation just does not work.

<!-- gh-comment-id:1129843416 --> @ecsgh commented on GitHub (May 18, 2022): Yes I know what "-" does. But I think that should be taken into the documentation, because as it currently stands in it, the installation just does not work.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1423
No description provided.