kubero-dev / kubero

A free and self-hosted Heroku / Netlify / Vercel alternative for Kubernetes
https://demo.kubero.dev
GNU General Public License v3.0
2.34k stars 88 forks source link

kuberoapp-web container wont start #186

Open NenoxAG opened 1 year ago

NenoxAG commented 1 year ago

Hi,

when I try to use a pipeline everything works (ssl, ingress, ...) except the "kuberoapp-web" container. It throws an error and restarts all the time.

Here is the log of the kuberoapp-web container:

/usr/lib/python3.8/site-packages/supervisor/options.py:470: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  self.warnings.warn(
Traceback (most recent call last):
  File "/usr/bin/supervisord", line 11, in <module>
    load_entry_point('supervisor==4.1.0', 'console_scripts', 'supervisord')()
  File "/usr/lib/python3.8/site-packages/supervisor/supervisord.py", line 358, in main
    go(options)
  File "/usr/lib/python3.8/site-packages/supervisor/supervisord.py", line 368, in go
    d.main()
  File "/usr/lib/python3.8/site-packages/supervisor/supervisord.py", line 70, in main
    self.options.make_logger()
  File "/usr/lib/python3.8/site-packages/supervisor/options.py", line 1466, in make_logger
    loggers.handle_file(
  File "/usr/lib/python3.8/site-packages/supervisor/loggers.py", line 417, in handle_file
    handler = RotatingFileHandler(filename, 'a', maxbytes, backups)
  File "/usr/lib/python3.8/site-packages/supervisor/loggers.py", line 213, in __init__
    FileHandler.__init__(self, filename, mode)
  File "/usr/lib/python3.8/site-packages/supervisor/loggers.py", line 160, in __init__
    self.stream = open(filename, mode)
OSError: [Errno 30] Read-only file system: '/app/supervisord.log'
mms-gianni commented 1 year ago

Your container requires write access.

Turn on the "advanced app Configuration " toggle.

The switch off "read only root filesystem" toggle in the security tab.

mms-gianni commented 1 year ago

Another option is to turn off the logging option of supervisor.d

Or add a writable mount (i personally would not recommend that)

NenoxAG commented 1 year ago

I have already tried that but that results in the same error. I have investigated this a bit and think it has to do with the fact that supervisord wants to log to the /app directory and that is not possible using the static buildpack because it mounts to that location read-only.

static-run:
    container_name: "static-run"
    image:  caddy:latest
    working_dir: /app
    #command: supervisord
    #command: caddy file-server --listen :8080 --root /app/public
    command: './init-web.sh'
    volumes:
      - ../../data:/app:ro <--
    ports:
      - "8004:80"
    depends_on:
      static-build:
        condition: service_completed_successfully

What i have tried already is to move the logging to another folder using -l /tmp/supervisord.log in the Run Command section. Then there is an error that is complaining about it not being able to write the supervisord.pid to the app directory. This i fixed using the -j /tmp/supervisord.pid argument.

After adding those two arguments nginx is finally starting but for some odd reason the console output is the following and it is in a crash loop:

2023-07-22 17:01:32,342 INFO spawned: 'nginxd' with pid 61
-> Executing /opt/docker/bin/service.d/nginx.d//10-init.sh
2023-07-22 17:01:32,350 INFO success: nginxd entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
nginx: [emerg] host not found in upstream "<PHP_SOCKET>" in /opt/docker/etc/nginx/conf.d/10-php.conf:2
2023-07-22 17:01:32,356 INFO exited: nginxd (exit status 1; not expected)