ucphhpc / docker-migrid

Containerized MiG
GNU General Public License v2.0
3 stars 7 forks source link

Rsyslog config error #39

Closed benibr closed 6 months ago

benibr commented 7 months ago

With the current master branch the container complain about the rsyslog.conf not being parsable.

~/W/k/docker-migrid (master)> docker compose logs migrid-webdavs
migrid-webdavs  | INFO: Enforcing timezone Europe/Copenhagen (/usr/share/zoneinfo/Europe/Copenhagen)
migrid-webdavs  | Setting MiG state cleanup
migrid-webdavs  | Enabling IO session cleanup for: davs
migrid-webdavs  | Run services: webdavs rsyslogd
migrid-webdavs  | /home/mig/mig/shared/pwcrypto.py:55: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
migrid-webdavs  |   import cryptography
[  OK  ]ebdavs  | Starting MiG webdavs daemon: grid_webdavs.py[  OK  ]
migrid-webdavs  |
migrid-webdavs  | rsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 13: warnings occured in file '/etc/rsyslog.conf' around line 13 [v8.2102.0-15.el8 try https://www.rsyslog.com/e/2207 ]
migrid-webdavs  | rsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 13: invalid character '=' - is there an invalid escape sequence somewhere? [v8.2102.0-15.el8 try https://www.rsyslog.com/e/2207 ]
migrid-webdavs  | rsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 13: invalid character '"' - is there an invalid escape sequence somewhere? [v8.2102.0-15.el8 try https://www.rsyslog.com/e/2207 ]
migrid-webdavs  | rsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 13: warnings occured in file '/etc/rsyslog.conf' around line 13 [v8.2102.0-15.el8 try https://www.rsyslog.com/e/2207 ]
migrid-webdavs  | rsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 13: invalid character '"' - is there an invalid escape sequence somewhere? [v8.2102.0-15.el8 try https://www.rsyslog.com/e/2207 ]

Is this a known problem?

jonasbardino commented 7 months ago

No, it's not something I've come across before and I just tested that dev-erda runs without such issues rebuilt on latest docker-migrid. Can you elaborate on which container you build (centos7, rocky8 or rocky9), and perhaps enlighten us about your env variables - mainly if you set any GDP env variables which will cause additional rsyslog.conf changes?

Until line 20 the rsyslog.conf should only have comments and one actual config line:

[root@dev app]# head /etc/rsyslog.conf| egrep -v '^#|^$' 
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
benibr commented 7 months ago

This happens with current master branch when building the image with rocky8 but it works with CentOS 7.

Steps to reproduce:

git clone https://github.com/ucphhpc/docker-migrid
cd docker-migrid
ln -sf Dockerfile.rocky8 Dockerfile
make
docker-compose up

Then you see the errors from the various containers that rsyslog.conf is not parsable.

The problem is that the sed commands in the Dockerfile aren't sufficient. I guess the default config coming from the rsyslog package has changed. The result looks like this:

#  egrep -v '^#|^$' /etc/rsyslog.conf | head -n 6
module(load="imuxsock"    # provides support for local system logging (e.g. via logger command)
       SysSock.Use="on") # Turn off message reception via local log socket;
                          # local messages are retrieved through imjournal now.
       UsePid="system" # PID nummber is retrieved as the ID of the process the journal entry originates from
global(workDirectory="/var/lib/rsyslog")
module(load="builtin:omfile" Template="RSYSLOG_TraditionalFileFormat")
...
jonasbardino commented 6 months ago

Confirmed on rocky8 - thanks for reporting it and clarifying the scope. I'll take a look.

jonasbardino commented 6 months ago

It should be fixed in 8e2d919634c4d7d866170346925804933745c348 , which I tested with podman on rocky8. Please verify and reopen the issue if not.