decider icon indicating copy to clipboard operation
decider copied to clipboard

Cant start decider as a service. Please help me with this issue.

Open sergeymeleschenko opened this issue 1 year ago • 8 comments

Cant start decider as a service. Please help me with this issue. sudo systemctl start decider sudo systemctl status decider ● decider.service - Decider Loaded: loaded (/etc/systemd/system/decider.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2023-03-07 16:47:42 EET; 18h ago Main PID: 36910 (code=exited, status=1/FAILURE)

Mar 07 16:47:42 cybersec-test-sys uwsgi[36910]: your memory page size is 4096 bytes Mar 07 16:47:42 cybersec-test-sys uwsgi[36910]: detected max file descriptor number: 1024 Mar 07 16:47:42 cybersec-test-sys uwsgi[36910]: lock engine: pthread robust mutexes Mar 07 16:47:42 cybersec-test-sys uwsgi[36910]: thunder lock: disabled (you can enable it with --thunder-lock) Mar 07 16:47:42 cybersec-test-sys uwsgi[36910]: Python version: 3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0] Mar 07 16:47:42 cybersec-test-sys uwsgi[36910]: Python main interpreter initialized at 0x5641281b9fd0 Mar 07 16:47:42 cybersec-test-sys uwsgi[36910]: python threads support enabled Mar 07 16:47:42 cybersec-test-sys uwsgi[36910]: The -s/--socket option is missing and stdin is not a socket. Mar 07 16:47:42 cybersec-test-sys systemd[1]: decider.service: Main process exited, code=exited, status=1/FAILURE Mar 07 16:47:42 cybersec-test-sys systemd[1]: decider.service: Failed with result 'exit-code'.

root@cybersec-test-sys:/etc/decider# /usr/local/bin/uwsgi --ini /etc/decider/uwsgi.ini [uWSGI] getting INI configuration from /etc/decider/uwsgi.ini *** Starting uWSGI 2.0.20 (64bit) on [Wed Mar 8 11:00:35 2023] *** compiled with version: 9.4.0 on 07 March 2023 09:39:05 os: Linux-5.4.0-144-generic #161-Ubuntu SMP Fri Feb 3 14:49:04 UTC 2023 nodename: cybersec-test-sys machine: x86_64 clock source: unix detected number of CPU cores: 1 current working directory: /etc/decider detected binary path: /usr/local/bin/uwsgi !!! no internal routing support, rebuild with pcre support !!! uwsgi shared socket 0 bound to TCP address :443 fd 3 setgid() to 1001 setuid() to 113 chdir() to /etc/decider your processes number limit is 7080 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) Python version: 3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0] Python main interpreter initialized at 0x557accb7d8d0 python threads support enabled The -s/--socket option is missing and stdin is not a socket.

I'm succesfully done all steps with manual.

sergeymeleschenko avatar Mar 08 '23 09:03 sergeymeleschenko

Sorry to hear that!

Please add a comment of the contents of your uwsgi.ini file. uWSGI can be funny to work with.

HTTP and HTTPS also have slightly different setups (I don't think I have a plain http reference at the moment)

damionmounts avatar Mar 08 '23 12:03 damionmounts

[uwsgi] chdir=/etc/decider module = decider:app master = true processes = 5 pyargv = --config ProductionConfig shared-socket = 0.0.0.0:443 uid = decider gid = decider https = =0,/etc/decider/app/utils/certs/decider.crt,/etc/decider/app/utils/certs/decider.key enable-threads = true

sergeymeleschenko avatar Mar 08 '23 13:03 sergeymeleschenko

I still want to explore this - but I haven't a clue at the moment.

I will be trying to finish off Docker tonight. That should be a better deployment option to avoid a whole setup process.

damionmounts avatar Mar 08 '23 20:03 damionmounts

I'm having the same issue:

× decider.service - Decider Loaded: loaded (/etc/systemd/system/decider.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Thu 2023-03-09 08:25:36 CST; 16min ago Process: 593 ExecStart=uwsgi --ini/etc/decider/decider/uwsgi.ini (code=exited, status=1/FAILURE) Main PID: 593 (code=exited, status=1/FAILURE) CPU: 8ms

Mar 09 08:25:36 will-VirtualBox systemd[1]: Started Decider. Mar 09 08:25:36 will-VirtualBox uwsgi[593]: uwsgi: unrecognized option '--ini/etc/decider/uwsgi.ini' Mar 09 08:25:36 will-VirtualBox uwsgi[593]: getopt_long() error Mar 09 08:25:36 will-VirtualBox systemd[1]: decider.service: Main process exited, code=exited, status=1/FAILURE Mar 09 08:25:36 will-VirtualBox systemd[1]: decider.service: Failed with result 'exit-code'.

[uwsgi] chdir=/etc/decider module = decider:app master = true processes = 5 pyargv = --config ProductionConfig shared-socket = 0.0.0.0:443 uid = decider gid = decider https = =0,/etc/decider/app/utils/certs/decider.crt,/etc/decider/app/utils/certs/decider.key enable-threads = true

kainewill avatar Mar 09 '23 14:03 kainewill

@kainewill Mar 09 08:25:36 will-VirtualBox uwsgi[593]: uwsgi: unrecognized option '--ini/etc/decider/uwsgi.ini'

It appears you are missing a space between --ini and /etc/decider/uwsgi.ini.

damionmounts avatar Mar 10 '23 13:03 damionmounts

@sergeymeleschenko I know you had this issue - and I wanted to explore it - but does Docker deployment work for you? I just recently pushed a change that should work across Windows/Ubuntu/macOS(M1).

damionmounts avatar Mar 10 '23 21:03 damionmounts

@kainewill Mar 09 08:25:36 will-VirtualBox uwsgi[593]: uwsgi: unrecognized option '--ini/etc/decider/uwsgi.ini'

It appears you are missing a space between --ini and /etc/decider/uwsgi.ini.

@damionmounts Thank you. It worked and the Docker deployment worked for me as well.

kainewill avatar Mar 10 '23 22:03 kainewill

Great! It works! But what about https ?

From: Damion R Mounts @.> Sent: Friday, March 10, 2023 11:55 PM To: cisagov/decider @.> Cc: sergeymeleschenko @.>; Mention @.> Subject: Re: [cisagov/decider] Cant start decider as a service. Please help me with this issue. (Issue #16)

@sergeymeleschenko https://github.com/sergeymeleschenko I know you had this issue - and I wanted to explore it - but does Docker deployment work for you? I just recently pushed a change that should work across Windows/Ubuntu/macOS(M1).

— Reply to this email directly, view it on GitHub https://github.com/cisagov/decider/issues/16#issuecomment-1464519804 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AIGZWY6SGBINIBWBCIARHXDW3OPKHANCNFSM6AAAAAAVTQEJ7E . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AIGZWY7GZ726CTYYF5NXTSLW3OPKHA5CNFSM6AAAAAAVTQEJ7GWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSXJLGHY.gif Message ID: @.*** @.***> >

sergeymeleschenko avatar Mar 11 '23 09:03 sergeymeleschenko

@sergeymeleschenko, That'll need to be added soon - here are general instructions for the time being though.

There are 2 ways of doing that:

  • 1. Pass an .ini file to uWSGI
    • web's dockerfile would need to be edited to copy the config file in
  • 2. Pass https-related command-line args to uWSGI

In both cases:

  • web's entrypoint.sh needs to have its uwsgi line edited with the changes
  • .crt and .key files needs to exist - either premade or generated on the spot
  • The .crt and .key files need to be copied in as well (edit to web's dockerfile)

damionmounts avatar Mar 14 '23 06:03 damionmounts

@sergeymeleschenko Go checkout / pull develop - Docker HTTPS support is here! Instructions are right in the code-block like before.

damionmounts avatar Mar 15 '23 13:03 damionmounts