opnsense / core

OPNsense GUI, API and systems backend
https://opnsense.org/
BSD 2-Clause "Simplified" License
3.26k stars 725 forks source link

Cannot restart webGUI from command line #7680

Closed deajan closed 1 month ago

deajan commented 1 month ago

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

I've hit a 100% disk space usage scenario, which in return prevented WebGUI access because of a CSRF token error. Once I've cleaned the log files, I've tried to reload the WebGUI using

/usr/local/etc/rc.restart_webgui

The command failed the the following error message:

Warning: require_once(config.inc): Failed to open stream: No such file or directory

I've checked /usr/local/etc/inc/config.inc, the file exists, and it contains php code so it seems legit. If I chdir into /usr/local/etc/inc, the rc.restart_webgui script complains about another missing file, so I think the environment PATH isn't loaded.

Is there any env path to load before executing the script ?

To Reproduce

Steps to reproduce the behavior:

  1. Login to SSH
  2. Launch /usr/local/etc/rc.restart_webgui

Screenshots

image

Environment

Software version used and hardware type if relevant, e.g.:

OPNsense 24.1.8 (amd64). KVM VM Intel 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz Network Intel® I211-AT via PCI passthrough

deajan commented 1 month ago

Can confirm that v 24.7_5 isn't impacted.

deajan commented 1 month ago

@WRKT Nope, just found it "as is" in the forum. Is it a RTFM case ?

fichtner commented 1 month ago

Hint: broken install

# opnsense-bootstrap
deajan commented 1 month ago

@fichtner Don't think so. A reboot later:

/usr/local/etc/rc.restart_webgui
Starting web GUI...done.
Generating RRD graphs...done.

I guess it's just the 100% disk space usage that did prevent (somehow ?) to load env variables. After making some disk space, I should have restarted another SSH session probably. Anyway, I'm closing this since there's no real issue.

Thanks.

fichtner commented 1 month ago

ok then the include path was wrong, so maybe it didn't write the php.ini file. if this is disk space related then maybe, but how php.ini got lost in the first place is strange.

deajan commented 1 month ago

I have no idea, that was just my wild guess, especially because chdir to the inc dir made the php script complain about other files missing that the initial one. But apart from a reboot after cleaning disk space, I did nothing more.

Anyway, there's not much more data to analyse. Sorry for the noise.