vdomos / domogik-plugin-onewired

Another Domogik (no xPL) plugin for 1-wire bus
2 stars 0 forks source link

Advanced page, error 500 #15

Open jaywax opened 7 years ago

jaywax commented 7 years ago

Hello, If, after install of the plugin, you don't chmod +x admin/geterrorlog.sh you have an error 500 on page with this message : ` 2017-07-28 17:54:19,383 domogik.admin.application INFO http request for /plugin_onewired/plugin-onewired.chzmdomdmg01p received Command = /var/lib/domogik//domogik_packages/plugin_onewired/admin/geterrorlog.sh ERROR:tornado.application:Uncaught exception GET /plugin_onewired/plugin-onewired.chzmdomdmg01p (10.10.7.5) HTTPServerRequest(protocol='https', host='somewhere', method='GET', uri='/plugin_onewired/plugin-onewired.chzmdomdmg01p', version='HTTP/1.1', remote_ip='10.10.7.5', headers={'Accept-Language': 'en-US,en;q=0.5', 'Accept-Encoding': 'gzip, deflate, br', 'X-Forwarded-Host': 'somewhere', 'X-Forwarded-For': '10.33.205.1', 'Host': 'somewhere', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8', 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0', 'Connection': 'upgrade', 'X-Forwarded-Proto': 'https', 'Referer': 'https://somewhere/plugin_onewired/plugin-onewired.chzmdomdmg01p', 'X-Real-Ip': '10.33.205.1', 'Cookie': 'unam=ec216b-15ac8c6ef59-3f07dc05-60; ga=GA1.2.438013598.1489441316; session=.eJw9kL1ugzAUhV-l8pwBCFmQMrTCsYh0r0XkYNkLagnE2LiVoBUxUd69NEP3c77zcyd1N7aTIVn3PkzthtT9hWR38vJBMsJFM4OgixZl0F6lnJVBSTWDhS3mKgVfGWVPDlgRaWt6LostCnpTSTHDck1gefPIjoMSlUU7ePA4KFt5JY49MJpCfg4rc0FWJqvOgocdSAi4OtEar4VKtUS3cmOelzPm6JVtUp5DAFsZ7Q-rx9KuiePDWmmsau_v1z7-T8B2Mlp4W6rMaC4GLTYg71GKCqHyznm8mCUoDtgazSjEYgm1q_7J-5nasfnHfHjF48mYRA.DFzj2Q.jE_YMkSxNr1rwTawwG2pnrFidQs', 'Upgrade-Insecure-Requests': '1'}) Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/tornado-4.5.1-py2.7-linux-x86_64.egg/tornado/web.py", line 1488, in _execute result = self.prepare() File "/usr/local/lib/python2.7/dist-packages/tornado-4.5.1-py2.7-linux-x86_64.egg/tornado/web.py", line 2774, in prepare self.fallback(self.request) File "/usr/local/lib/python2.7/dist-packages/tornado-4.5.1-py2.7-linux-x86_64.egg/tornado/wsgi.py", line 277, in call WSGIContainer.environ(request), start_response) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1994, in call return self.wsgi_app(environ, start_response) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1985, in wsgi_app response = self.handle_exception(e) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1540, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request return self.view_functionsrule.endpoint File "/var/lib/domogik/domogik_packages/plugin_onewired/admin/init.py", line 74, in index errorlog = get_errorlog(geterrorlogcmd)) File "/var/lib/domogik/domogik_packages/plugin_onewired/admin/init.py", line 44, in get_errorlog errorlog = subprocess.Popen([cmd], stdout=subprocess.PIPE) File "/usr/lib/python2.7/subprocess.py", line 710, in init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child raise child_exception OSError: [Errno 13] Permission denied ERROR:tornado.access:500 GET /plugin_onewired/plugin-onewired.chzmdomdmg01p (10.10.7.5) 508.42ms

`

vdomos commented 7 years ago

Hello,

Strange, it's ok in my local branch. I test a git clone and download zip file, the file has good exec right in master et develop version Same for script plgin. How did you install the package with dmg_package ?

jaywax commented 6 years ago

Hello,

I've installed them by dmg_package. I've done a new installation. You can see the log here : `domogik@[CHZM]dom[DMG]01p:~

dmg_package -i https://github.com/vdomos/domogik-plugin-script/archive/master.zip Start downloading https://github.com/vdomos/domogik-plugin-script/archive/master.zip Download finished Upgrade a package from a zip file : /tmp/tmpb_W1US Extract the zip file /tmp/tmpb_W1US as /var/lib/domogik/domogik_packages/plugin_script Generate the docummentation... Build doc: cd /var/lib/domogik/domogik_packages/plugin_script/docs && export BUILDDIR=/var/lib/domogik/domogik_packages/plugin_script/docs/../_build_doc && export SPHINXOPTS='-c /var/lib/domogik/resources/sphinx/' && make -e -f /var/lib/domogik/resources/sphinx/Makefile html

Package installed!

FOR NOW, AFTER INSTALLING A PACKAGE, YOU NEED TO RESTART DOMOGIK MANAGER ! To do this, please do : sudo /etc/init.d/domogik restart

ls -lart /var/lib/domogik/domogik_packages/plugin_script/admin/ total 20 drwxr-xr-x 3 domogik domogik 4096 juil. 31 09:17 . drwxr-xr-x 10 domogik domogik 4096 juil. 31 09:17 .. -rw-r--r-- 1 domogik domogik 177 juil. 31 09:17 geterrorlog.sh -rw-r--r-- 1 domogik domogik 1475 juil. 31 09:17 init.py drwxr-xr-x 2 domogik domogik 4096 juil. 31 09:17 templates `

vdomos commented 6 years ago

I test a dmg_package -i https://github.com/vdomos/domogik-plugin-script/archive/master.zip dmg_package delete executable file permission.

With a simple unzip master.zip or a git clone ... , executable permission are still there.

May be a possible issue with dmg_package.