Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments included as part of logfile path #1229

Closed
mnaberez opened this issue Apr 15, 2019 · 11 comments
Closed

Comments included as part of logfile path #1229

mnaberez opened this issue Apr 15, 2019 · 11 comments

Comments

@mnaberez
Copy link
Member

@sdanbury wrote in #120 (comment):

Haven't seen this for a couple of years, but it has randomly started appearing again.

$ sudo supervisord -c /etc/supervisor/supervisord.conf
Error: The directory named as part of the path /var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) does not exist
For help, use /usr/local/bin/supervisord -h

I have made sure the /var/log/supervisor/supervisord.log file exists and have even given permissions of 777 to test, and it is still happening. Any ideas?

@mnaberez
Copy link
Member Author

Error: The directory named as part of the path /var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) does not exist

@sdanbury It seems to think the comments are part of the log file path.

  • What version of Supervisor are you using (supervisord --version)?
  • What version of Python are you using (python -V)?
  • What are the contents of the config file (cat /etc/supervisor/supervisord.conf)?

@mnaberez mnaberez changed the title Error: The directory named as part of the path ... does not exist Comments included as part of logfile path Apr 15, 2019
@sdanbury
Copy link

Thanks for creating a separate issue, apologies.

$ supervisord --version
4.0.1
$ python -V
Python 2.7.6
$ cat /etc/supervisor/supervisord.conf
; supervisor config file

[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0700                       ; sockef file mode (default 0700)

[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisor/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log            ; ('AUTO' child log dir, default $TEMP)

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix socket

; The [include] section can just contain the "files" setting.  This
; setting can list multiple files (separated by whitespace or
; newlines).  It can also contain wildcards.  The filenames are
; interpreted as relative to this file.  Included files *cannot*
; include files themselves.

@sdanbury
Copy link

Removed the comments for now, and it worked as expected. Maybe some sort of white space issue? Not too sure.

@mnaberez
Copy link
Member Author

I copy/pasted the logfile= line from the config above and wasn't able to see the error:

$ cat supervisord.conf
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)

$ supervisord -n -c supervisord.conf
2019-04-16 10:18:57,154 INFO Increased RLIMIT_NOFILE limit to 1024
2019-04-16 10:18:57,155 INFO supervisord started with pid 6671

If I remove the whitespace before the semicolon, I do see the error:

$ cat supervisord.conf 
[supervisord]
logfile=/var/log/supervisor/supervisord.log; (main log file;default $CWD/supervisord.log)

$ supervisord -n -c supervisord.conf 
Error: The directory named as part of the path /var/log/supervisor/supervisord.log; (main log file;default $CWD/supervisord.log) does not exist
For help, use /usr/local/bin/supervisord -h

That's the expected behavior due to how Python's ConfigParser works.

However, your config file above has whitespace before the semicolon. Can you confirm that you did have whitespace before the semicolon when you saw the error?

@BillMedernach

This comment has been minimized.

@sdanbury
Copy link

@mnaberez thank you for looking into it, much appreciated. I can confirm that it had whitespace before the semicolon when I saw the error.

@mnaberez

This comment has been minimized.

@mnaberez
Copy link
Member Author

I can confirm that it had whitespace before the semicolon when I saw the error.

@sdanbury Could you please try to reproduce it and let me know if you're able to make it happen again?

$ cat supervisord.conf
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)

$ supervisord -n -c supervisord.conf
2019-04-16 10:18:57,154 INFO Increased RLIMIT_NOFILE limit to 1024
2019-04-16 10:18:57,155 INFO supervisord started with pid 6671

I've tried the above with spaces and tabs before the ; and wasn't able to see the error. I can only get the error to occur when I remove the whitespace from before the ;. I am hoping that I can find a way to reproduce it locally so I can troubleshoot it.

mnaberez added a commit that referenced this issue Apr 17, 2019
@sdanbury
Copy link

@mnaberez I just tried to recreate it outside of the VM I see it happening on and I can't seem to recreate.

$ docker run -it ubuntu:14.04 bash
# apt-get update

# apt-get install -y python-minimal python-pip

# python -V
Python 2.7.6

# echo "[supervisord]" >> supervisord.conf
# echo "logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)" >> supervisord.conf

# supervisord -n -c supervisord.conf

No issue. Is there anything else I can check for on the VM it is happening on? To be honest, Ubuntu 14.04 and Python 2.7.6 is a really old stack now, so in my case, I would be happy to close. But willing to dig deeper if there is anything else you want to know?

@mnaberez

This comment has been minimized.

@mnaberez
Copy link
Member Author

I believe this is the same issue #1230 and that it has been fixed in 2c2cd35. I am going to close this issue for now. Thank you for your help!

alexsilva pushed a commit to alexsilva/supervisor that referenced this issue Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants