Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save requinix/c94451d8c843b200d93b to your computer and use it in GitHub Desktop.
Save requinix/c94451d8c843b200d93b to your computer and use it in GitHub Desktop.
FreeNAS: Error while trying to open the web shell

FreeNAS-9.3-STABLE-201509282017

[date] [hostname] kernel: sonewconn: pcb 0x[hex]: Listen queue overflow: [#] already in queue awaiting acceptance ([#] occurrences)

Seen some people talk about the web shell being a bit finicky. I had opened it up many times since it rebooted last, and had the console messages in the footer enabled (System > Advanced > Show console messages in the footer). After some time, attempting to start the shell would show the "Loading" message for a few seconds before the window disappeared and the error message appeared in the footer.

Couple people said to restart FreeNAS. That wasn't an option for me.

Connect to FreeNAS over SSH. It can be enabled in Services > SSH. Check the options (wrench) to make sure you have a login - logging in as root is fine.

The web shell uses a Unix socket at /var/run/webshell.sock.

Use lsof to see the processes using it.

lsof /var/run/webshell.sock
COMMAND     PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
nmbd      45255   root    4u  unix 0xfffff8001a9a7aa0      0t0      /var/run/webshell.sock
nmbd      45255   root    5u  unix 0xfffff806761f02a8      0t0      /var/run/webshell.sock
smbd      45259   root    4u  unix 0xfffff8001a9a7aa0      0t0      /var/run/webshell.sock
smbd      45259   root    5u  unix 0xfffff806761f02a8      0t0      /var/run/webshell.sock
winbindd  45263   root    4u  unix 0xfffff8001a9a7aa0      0t0      /var/run/webshell.sock
winbindd  45263   root    5u  unix 0xfffff806761f02a8      0t0      /var/run/webshell.sock
winbindd  45265   root    4u  unix 0xfffff8001a9a7aa0      0t0      /var/run/webshell.sock
winbindd  45265   root    5u  unix 0xfffff806761f02a8      0t0      /var/run/webshell.sock
winbindd  45282   root    4u  unix 0xfffff8001a9a7aa0      0t0      /var/run/webshell.sock
winbindd  45282   root    5u  unix 0xfffff806761f02a8      0t0      /var/run/webshell.sock
winbindd  45283   root    4u  unix 0xfffff8001a9a7aa0      0t0      /var/run/webshell.sock
winbindd  45283   root    5u  unix 0xfffff806761f02a8      0t0      /var/run/webshell.sock
python2.7 58985   root    4u  unix 0xfffff8001a9a7aa0      0t0      /var/run/webshell.sock
python2.7 58985   root    5u  unix 0xfffff806761f02a8      0t0      /var/run/webshell.sock
mdnsd     75024 nobody    4u  unix 0xfffff8001a9a7aa0      0t0      /var/run/webshell.sock
mdnsd     75024 nobody    5u  unix 0xfffff806761f02a8      0t0      /var/run/webshell.sock
collectd  77146   root    4u  unix 0xfffff8001a9a7aa0      0t0      /var/run/webshell.sock
collectd  77146   root    5u  unix 0xfffff806761f02a8      0t0      /var/run/webshell.sock

Lots.

Restart processes. If there are errors while restarting the services then you'll need to deal with them.

  • nmbd, smbd, and winbindd are all part of Samba.
service samba_server stop
service ix-pre-samba restart
service samba_server start
service ix-post-samba restart
  • mdnsd is related to networking.
service mdnsd restart
  • collectd collects statistics on the system.
service collectd restart
  • python2.7 is a bit more complicated. You need to see what Python is being used to do.
ps aux | grep python
root       16027   0.0  0.3 214760  85252 ??  I    12:01PM     0:11.75 python: alertd (python2.7)
root       47189   0.0  0.2 179908  62240 ??  I     7:38PM     0:00.85 /usr/local/bin/python /usr/local/libexec/nas/register_mdns.py (python2.7)
root       58985   0.0  0.7 448004 245896 ??  I    10Oct15     5:50.20 /usr/local/bin/python -R /usr/local/www/freenasUI/manage.py runfcgi method=threaded host=127.0.0.1 port=9042 pidfile=/var/run/django.pid (python2.7)
root       19290   0.0  0.2 175736  62808 v0  Is+  12:21PM     0:00.70 python /etc/netcli (python2.7)
root       47237   0.0  0.0  16284   1892  0  S+    7:38PM     0:00.00 grep python

PID 58985 was running manage.py and django, which are used for the web UI. Restart the stuff related to it.

service nginx restart
service django restart

See what's left. If you got everything then the list should be empty.

You can go back into the web UI and the shell should work fine now. You can also take a look to see what different actions do regarding webshell.sock. For example, starting the shell creates a python2.7 process and two bash processes. (If you note the PID it's actually one process with two handles.) "exit"ing the shell terminates the two bashes but python2.7 remains. Fortunately opening the shell again keeps the existing python2.7 and creates two bashes again. However simply closing the shell window leaves the two around, and opening it again creates two additional.

Morals of the story:

  • Use SSH if you want a real shell. The web shell is fine for a quick task but use sparingly in case it does weird things again.
  • Always "exit" the shell.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment