petermc
(Peter McClymont)
September 25, 2017, 8:11am
1
Hi,
My rockstor is broken. I am able to access the share, and everything is good in that regard.
However I cannot access the web interface.
I found this which describes my problem very well,
No luck with systemctl restart rockstor.
/var/log/nginx/error.log contains:
2016/05/04 07:41:12 [emerg] 14606#0: no āeventsā section in configuration
2016/05/04 07:41:13 [emerg] 14636#0: no āeventsā section in configuration
2016/05/04 07:41:16 [emerg] 14794#0: no āeventsā section in configuration
2016/05/04 07:41:19 [emerg] 14861#0: no āeventsā section in configuration
And I narrowed it down to this file being empty.
/opt/rockstor/etc/nginx/nginx.conf
How would that have become empty, and how should I populate it?
Plus how should I copy a file such as that to a linux machine with no UI?
phillxnet
(Philip Guyton)
September 25, 2017, 12:04pm
2
@petermc Hello again.
Yes this is a funny one as itās cause has yet to be established and Iāve seen it myself: though only very rarely. Since itās come up again Iāve created an issue so it doesnāt get forgotten:
opened 10:13AM - 25 Sep 17 UTC
closed 11:37AM - 16 Dec 23 UTC
Thanks to forum members grizzly and petermc for highlighting this issue. On rareā¦ occasions the /opt/rockstor/etc/nginx/nginx.conf file is empty. This leads to a Web-UI failure and the following error messages in /var/log/nginx/errors.log:
```
2016/05/04 07:41:12 [emerg] 14606#0: no "events" section in configuration
2016/05/04 07:41:13 [emerg] 14636#0: no "events" section in configuration
2016/05/04 07:41:16 [emerg] 14794#0: no "events" section in configuration
2016/05/04 07:41:19 [emerg] 14861#0: no "events" section in configuration
```
The issue author has also seen this occurrence but it's cause has yet to be established:
```
ls -la /opt/rockstor/etc/nginx/nginx.conf
-rw------- 1 root root 0 Nov 5 11:23 /opt/rockstor/etc/nginx/nginx.conf
```
Referenced forum threads (please update on this issues resolution):
grizzly: https://forum.rockstor.com/t/solved-rockstor-webui-no-longer-starts-3-8-13/1444
petermc: https://forum.rockstor.com/t/opt-rockstor-etc-nginx-nginx-conf-empty/3812
As for a work around I have just done the following that hopefully mimics the build processes creation of this file from itās template file: /opt/rockstor/conf/nginx.conf.in
cat /opt/rockstor/conf/nginx.conf.in | sed -e 's/\${buildout:directory}/\/opt\/rockstor/g' -e 's/\${init-gunicorn:bind}/127.0.0.1/g' -e 's/\${init-gunicorn:port}/8000/g' > /opt/rockstor/etc/nginx/nginx.conf
The above command does 3 stream edits (using sed) that in turn replace placeholders for their production values. The command must be run as root on your Rockstor instance so if you donāt trust it donāt run it.
Once the new file is in place (/opt/rockstor/etc/nginx/nginx.conf) you will need to restart your Rockstor service via:
systemctl restart rockstor
or just restart your Rockstor machine.
See how that goes and let us know if it gets you up and running again.
Hope that helps.
EDIT: Sorry forgot to advise the following on the resulting file to remove group and other read access.
chmod 600 /opt/rockstor/etc/nginx/nginx.conf
2 Likes
petermc
(Peter McClymont)
September 26, 2017, 1:48am
3
Thanks. I will try that tonight and report back.
Some extra information. I have an old core 2 duo HP machine that I using, and it has seemed pretty stable so far.
However yesterday for some reason I started getting 5 beeps on bios. I reseated the RAM and the machine started after that.
Might be related. Could have caused some corruption. But on the flip side might have nothing to do with it.
petermc
(Peter McClymont)
September 27, 2017, 7:37am
4
@phillxnet , I have run the scripts as you suggested above, and everything is up and running again. Thanks.
1 Like
phillxnet
(Philip Guyton)
September 27, 2017, 9:41am
5
@petermc Thatās great news, thanks for confirming the āwork aroundā. Iāve updated the referenced issue accordingly.
kysdaddy
(chas Willis)
July 17, 2018, 1:09pm
6
Phillip. you are such a lifesaver! Yesterday one of my devices said a HD died and I removed it in the web app (probably not the right thing to do) I tried to restart the system using the power button in the web app and lost access, I still had terminal access though. I searched the community and found this thread.
Copied the āworkaroundā and itās back up recovered the missing HD and all is well.
Thank you Sir
Chas
phillxnet
(Philip Guyton)
July 17, 2018, 1:34pm
7
@kysdaddy Hello again and thanks for your report.
Glad the work around helped and well done sorting your disk problem. We still have a way to go on the disk replacement / maintenance features and have at least the following in the queue:
opened 05:31PM - 10 Jan 17 UTC
Thanks to maxhq in the following forum thread for highlighting this issue.
At tā¦ imes it is desired to replace an existing disk with another one, ie the function of:
btrfs replace start devid /dev/sdX /mnt2/pool-name
A user level interface for this process would make for a nice improvement. We should ensure to allow for the -r switch where reads from the source device are only carried out if not other zero-defect mirror exists (recommended for poorly devices). See: https://btrfs.readthedocs.io/en/latest/btrfs-replace.html
The status of this or other current replace operations could be shown in a tab on the same page, akin to the balance tab in pools maybe.
The current status can be had via:
btrfs replace status /mnt2/pool-name
N.B. it is generally considered to be a longer process to use replace rather than:
"btrfs dev add" and then "btrfs dev delete", it might make sense to suggest this course of action in the same UI.
https://forum.rockstor.com/t/problems-with-disk-replacement/2660
Bit by Bit.
Zonk
August 27, 2018, 7:22pm
8
Had the same problem today - noticed webui decining connections.
Found this thread (github), script fixed it.
Thx, phillxnet
phillxnet
(Philip Guyton)
August 27, 2018, 7:44pm
9
@Zonk Hello again and thanks for the feedback.
Shame we havenāt gotten to the bottom of it yet. But all in good time.
1 Like
Hi all!
Had the exact same issue after a power outage this morning (thunderstorm hit) and the script worked as a charm.
Cheers!
1 Like