/opt/rockstor/etc/nginx/nginx.conf empty?

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,

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?

@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:

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

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.

@phillxnet, I have run the scripts as you suggested above, and everything is up and running again. Thanks.

1 Like

@petermc That’s great news, thanks for confirming the ‘work around’. I’ve updated the referenced issue accordingly.

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

@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:

Bit by Bit.

Had the same problem today - noticed webui decining connections.
Found this thread (github), script fixed it.
Thx, phillxnet

@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