'NGINX + FileBrowser services both failing to start (Zorin 16/Ubuntu 20.04)
I'm running FileBrowser (which relies out of the box on NGINX for its web server) on ZorinOS 16, which is Ubuntu 20.04 based, along with Tailscale, which has heretofore been working fine. Today I decided to enable TLS certificates thru Tailscale, which I was able to do successfully, and then subsequently I installed Cockpit, which also works great. Everything initially worked as expected, however upon reboot, the services for both NGINX and FileBrowser were refusing to start, and I'm having some trouble making sense the error messages I'm getting. First, NGINX:
analytic@origin:/etc$ systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2022-04-30 21:22:49 CDT; 32s ago
Docs: man:nginx(8)
Process: 4722 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Apr 30 21:22:49 origin systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 30 21:22:49 origin nginx[4722]: nginx: [emerg] too long parameter "
Apr 30 21:22:49 origin nginx[4722]: [1B blob data]
Apr 30 21:22:49 origin nginx[4722]: ..." started in /etc/nginx/sites-enabled/filebrowser.db:2
Apr 30 21:22:49 origin nginx[4722]: nginx: configuration file /etc/nginx/nginx.conf test failed
Apr 30 21:22:49 origin systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Apr 30 21:22:49 origin systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 30 21:22:49 origin systemd[1]: Failed to start A high performance web server and a reverse proxy server.
If I'm reading this right, there's a problem with my /etc/nginx/nginx.conf, and I'm drawn to the message
nginx: [emerg] too long parameter "
as well as
..." started in /etc/nginx/sites-enabled/filebrowser.db:2
but I'm enough of a novice that I can't see anything conspicuously out of whack in either file. /etc/nginx/nginx.conf included here:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml app>
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
Since I recently did stuff with certificates, I'm wondering if perhaps there's trouble with the #SSL Settings portion of the file, but that might be a red herring.
The FileBrowser error was reading:
● filebrowser.service - File Browser
Loaded: loaded (/etc/systemd/system/filebrowser.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2022-04-30 20:43:57 CDT; 33min ago
Process: 3344 ExecStart=/usr/local/bin/filebrowser -c /etc/filebrowser.json (code=exited, status=2)
Main PID: 3344 (code=exited, status=2)
Apr 30 20:43:57 origin filebrowser[3344]: github.com/spf13/cobra.(*Command).ExecuteC(0x1812420)
Apr 30 20:43:57 origin filebrowser[3344]: /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:914 +0x2fc
Apr 30 20:43:57 origin filebrowser[3344]: github.com/spf13/cobra.(*Command).Execute(...)
Apr 30 20:43:57 origin filebrowser[3344]: /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:864
Apr 30 20:43:57 origin filebrowser[3344]: github.com/filebrowser/filebrowser/v2/cmd.Execute()
Apr 30 20:43:57 origin filebrowser[3344]: /home/runner/work/filebrowser/filebrowser/cmd/cmd.go:9 +0x25
Apr 30 20:43:57 origin filebrowser[3344]: main.main()
Apr 30 20:43:57 origin filebrowser[3344]: /home/runner/work/filebrowser/filebrowser/main.go:8 +0x17
Apr 30 20:43:57 origin systemd[1]: filebrowser.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Apr 30 20:43:57 origin systemd[1]: filebrowser.service: Failed with result 'exit-code'.
Bizarrely, as I was typing this, FileBrowser spontaneously resumed functioning as expected (Tailscale IP, TLS certs and all), in spite of the fact that NGINX is still failing to start. Just a few minutes ago the whole mess was broken, and I don't know how this would have self-remedied, but that just deepens the mystery of the whole situation. I honestly have no idea how FileBrowser can even be functioning if NGINX is dead, but that appears to now be the case. Perhaps there are two instances of NGINX running unbeknownst, one good and one evil. How would I find this out? Mind-bending.
The new, magically-now-working FileBrowser-related systemctl status output:
analytic@origin:/etc$ sudo systemctl status filebrowser.service
● filebrowser.service - File Browser
Loaded: loaded (/etc/systemd/system/filebrowser.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2022-04-30 22:06:02 CDT; 19min ago
Main PID: 6122 (filebrowser)
Tasks: 8 (limit: 8702)
Memory: 4.9M
CGroup: /system.slice/filebrowser.service
└─6122 /usr/local/bin/filebrowser -c /etc/filebrowser.json
Apr 30 22:06:02 origin systemd[1]: Started File Browser.
Apr 30 22:06:02 origin filebrowser[6122]: 2022/04/30 22:06:02 Using config file: /etc/filebro>
Apr 30 22:06:02 origin filebrowser[6122]: 2022/04/30 22:06:02 Listening on 100.102.134.125:80>
Apr 30 22:06:49 origin filebrowser[6122]: 2022/04/30 22:06:49 couldn't load custom styles: st>
Apr 30 22:06:49 origin filebrowser[6122]: 2022/04/30 22:06:49 /api/renew: 403 100.107.83.16 <>
lines 1-14/14 (END)
I feel like I'm taking crazy-pills. Just for reference here's my filebrowser.json file:
{
"port": 8080,
"baseURL": "",
"address": "100.102.134.125",
"log": "stdout",
"database": "/etc/filebrowser.db",
"root": "/home/analytic/cloud",
"cert": "/etc/origin.tailnet-c74e.ts.net.crt",
"key": "/etc/origin.tailnet-c74e.ts.net.key"
}
Anyway I'm at best an intermediate Linux practitioner, and this is a level of squirreliness that's just beyond the reach of my investigative powers, so if anyone has any insight I'd be grateful to hear it.
Thanks in advance.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
