liftoff/GateOne

failing on debian

Closed this issue ยท 16 comments

sjau commented

I tried to get it to run on two debian system.

  • Clone GateONe
  • run python setup.py install
  • run gateone
root@testserver~/GateOne# gateone
Traceback (most recent call last):                                                                                                                                                                                                                                             
  File "/usr/local/bin/gateone", line 11, in <module>                                                                                                                                                                                                                          
    load_entry_point('gateone==1.2.0', 'console_scripts', 'gateone')()                                                                                                                                                                                                         
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 561, in load_entry_point                                                                                                                                                                             
    return get_distribution(dist).load_entry_point(group, name)                                                                                                                                                                                                                
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2631, in load_entry_point                                                                                                                                                                            
    return ep.load()                                                                                                                                                                                                                                                           
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2291, in load                                                                                                                                                                                        
    return self.resolve()                                                                                                                                                                                                                                                      
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2297, in resolve                                                                                                                                                                                     
    module = __import__(self.module_name, fromlist=['__name__'], level=0)                                                                                                                                                                                                      
  File "/usr/local/lib/python2.7/dist-packages/gateone-1.2.0-py2.7.egg/gateone/core/server.py", line 402, in <module>                                                                                                                                                          
    from gateone.auth.authorization import require, authenticated, policies                                                                                                                                                                                                    
  File "/usr/local/lib/python2.7/dist-packages/gateone-1.2.0-py2.7.egg/gateone/auth/authorization.py", line 38, in <module>                                                                                                                                                    
    @memoize                                                                                                                                                                                                                                                                   
  File "/usr/local/lib/python2.7/dist-packages/gateone-1.2.0-py2.7.egg/gateone/core/utils.py", line 290, in __init__                                                                                                                                                           
    MEMO = AutoExpireDict(timeout=timeout, interval="30s")                                                                                                                                                                                                                     
  File "/usr/local/lib/python2.7/dist-packages/gateone-1.2.0-py2.7.egg/gateone/core/utils.py", line 161, in __init__                                                                                                                                                           
    self.interval = kwargs.pop('interval')                                                                                                                                                                                                                                     
  File "/usr/local/lib/python2.7/dist-packages/gateone-1.2.0-py2.7.egg/gateone/core/utils.py", line 211, in interval                                                                                                                                                           
    self._timeout_checker, value, io_loop=self.io_loop)                                                                                                                                                                                                                        
TypeError: __init__() got an unexpected keyword argument 'io_loop'                                                                                                                                                                                                             
Exception AttributeError: "'AutoExpireDict' object has no attribute '_key_watcher'" in <bound method AutoExpireDict.__del__ of {}> ignored

@sjau did you ever solve this? I'm running into the same problem on Debian 8 in a Python 2 virtualenv.

Found the solution in #689. Make sure to purge the virtualenv's Tornado first, and make sure you didn't accidentally install a Tornado copy into system directories too.

sjau commented

I don't even know what tornado is.... I found an alternative meanwhile - shellinabox

It's the web framework used by Gate One. ShellInABox is apparently unmaintained which is why I went with Gate One.

Anyway, can you close this issue?

sjau commented

well, GateOne is still not working.

Oh, I thought you had switched. Did you read #689?

@sjau
I don't even know what tornado is.... I found an alternative meanwhile - shellinabox

sjau commented

ok, found it. Thx

The key piece from the #689

The issue apparently is due to the latest version of tornado used.

By removing the 5.1a tornado, and do a pip install tornado==4.5.3, the gateone starts to function correctly.

I can confirm this worked for me.

How lucky your are... I tried that too, on my Synology. But it didn't solve the problem :(

Notice: I had to install the pip module first as it's not installed by default on Synology.
Here is the sequence if anyone else want to try and compare.

`root@DSM:/var/log# wget https://bootstrap.pypa.io/get-pip.py
--2018-05-23 21:30:30-- https://bootstrap.pypa.io/get-pip.py
Resolving bootstrap.pypa.io... 151.101.0.175, 151.101.192.175, 151.101.128.175, ...
Connecting to bootstrap.pypa.io|151.101.0.175|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1642329 (1.6M) [text/x-python]
Saving to: 'get-pip.py'

100%[=================================================================================================================================================>] 1,642,329 1.20MB/s in 1.3s
2018-05-23 21:30:31 (1.20 MB/s) - 'get-pip.py' saved [1642329/1642329]

root@DSM:/var/log# python get-pip.py
Collecting pip
Using cached https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl
Collecting setuptools
Using cached https://files.pythonhosted.org/packages/7f/e1/820d941153923aac1d49d7fc37e17b6e73bfbd2904959fffbad77900cf92/setuptools-39.2.0-py2.py3-none-any.whl
Collecting wheel
Using cached https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-10.0.1 setuptools-39.2.0 wheel-0.31.1

root@DSM:/var/log# /bin/python -m pip uninstall tornado
Skipping tornado as it is not installed.
root@DSM:/var/log# /bin/python -m pip install tornado==4.5.3
Collecting tornado==4.5.3
Downloading https://files.pythonhosted.org/packages/e3/7b/e29ab3d51c8df66922fea216e2bddfcb6430fb29620e5165b16a216e0d3c/tornado-4.5.3.tar.gz (484kB)
100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 491kB 1.1MB/s
Collecting singledispatch (from tornado==4.5.3)
Downloading https://files.pythonhosted.org/packages/c5/10/369f50bcd4621b263927b0a1519987a04383d4a98fb10438042ad410cf88/singledispatch-3.4.0.3-py2.py3-none-any.whl
Collecting certifi (from tornado==4.5.3)
Downloading https://files.pythonhosted.org/packages/7c/e6/92ad559b7192d846975fc916b65f667c7b8c3a32bea7372340bfe9a15fa5/certifi-2018.4.16-py2.py3-none-any.whl (150kB)
100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 153kB 1.3MB/s
Collecting backports_abc>=0.4 (from tornado==4.5.3)
Downloading https://files.pythonhosted.org/packages/7d/56/6f3ac1b816d0cd8994e83d0c4e55bc64567532f7dc543378bd87f81cebc7/backports_abc-0.5-py2.py3-none-any.whl
Collecting six (from singledispatch->tornado==4.5.3)
Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Building wheels for collected packages: tornado
Running setup.py bdist_wheel for tornado ... done
Stored in directory: /root/.cache/pip/wheels/72/bf/f4/b68fa69596986881b397b18ff2b9af5f8181233aadcc9f76fd
Successfully built tornado
Installing collected packages: six, singledispatch, certifi, backports-abc, tornado
Successfully installed backports-abc-0.5 certifi-2018.4.16 singledispatch-3.4.0.3 six-1.11.0 tornado-4.5.3

root@DSM:/var/log# cat synopkg.log
Starting GateOne ...
2018/05/23 21:32:07 start MODS_GateOne 20151116.6-0027 End start-stop-status start ret=[0]
2018/05/23 21:32:07 start MODS_GateOne: start version 20151116.6-0027 successfully, result 0
Traceback (most recent call last):
File "/usr/local/gateone/env/bin/gateone", line 11, in
load_entry_point('gateone==1.2.0', 'console_scripts', 'gateone')()
File "/usr/local/gateone/env/lib/python2.7/site-packages/pkg_resources/init.py", line 476, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/gateone/env/lib/python2.7/site-packages/pkg_resources/init.py", line 2700, in load_entry_point
return ep.load()
File "/usr/local/gateone/env/lib/python2.7/site-packages/pkg_resources/init.py", line 2318, in load
return self.resolve()
File "/usr/local/gateone/env/lib/python2.7/site-packages/pkg_resources/init.py", line 2324, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/gateone/env/lib/python2.7/site-packages/gateone-1.2.0-py2.7.egg/gateone/core/server.py", line 402, in
from gateone.auth.authorization import require, authenticated, policies
File "/usr/local/gateone/env/lib/python2.7/site-packages/gateone-1.2.0-py2.7.egg/gateone/auth/authorization.py", line 38, in
@memoize
File "/usr/local/gateone/env/lib/python2.7/site-packages/gateone-1.2.0-py2.7.egg/gateone/core/utils.py", line 290, in init
MEMO = AutoExpireDict(timeout=timeout, interval="30s")
File "/usr/local/gateone/env/lib/python2.7/site-packages/gateone-1.2.0-py2.7.egg/gateone/core/utils.py", line 161, in init
self.interval = kwargs.pop('interval')
File "/usr/local/gateone/env/lib/python2.7/site-packages/gateone-1.2.0-py2.7.egg/gateone/core/utils.py", line 211, in interval
self._timeout_checker, value, io_loop=self.io_loop)
TypeError: init() got an unexpected keyword argument 'io_loop'
Exception AttributeError: "'AutoExpireDict' object has no attribute '_key_watcher'" in <bound method AutoExpireDict.del of {}> ignored
`

@vletroye Tornado isn't the only dependency for Gate One. You need to install the others too. Did you do this? It's hard for me to tell because you pasted your logs without code formatting.

Sorry for the non-formatting, I didn't see the option... And thx for your input.

To be honest, I did reuse a package for synology that was installing and configuring gateone. And it used to work on my NAS. So, I presume that all dependencies were installed correctly by the package at that time. If something has changed now, it's on the NAS, due to some recent updates (Most probably the version of python). Some dependencies possibly used to be available by default on the past...

So, as suggested, I will try to verify if all dependencies are still available (no idea yet how to do so, but I will search ;)

V.

@vletroye the GateOne module for Synology packs it's own Python and pip.
You probably insalled the correct version of tornado with the system wide python or with /usr/local/python/bin/pip .

Try this:

sudo bash
/usr/local/gateone/env/bin/pip uninstall tornado
/usr/local/gateone/env/bin/pip install tornado==4.5.3
/usr/local/gateone/env/bin/python -c "import tornado; print(tornado.version)"

then try to execute gateone on the command line to get any error output without having to grab through logs.
/usr/local/gateone/env/bin/gateone

Thx Marcus.

Here is the output of gateone run after fix you suggested:

bash-4.3# /usr/local/gateone/env/bin/gateone
[I 180708 11:47:46 configuration:711] Gate One settings are incomplete.  A new <settings_dir>/10server.conf will be generated.
...
[I 180708 11:47:50 server:4491] Listening on https://*:443/
[E 180708 11:47:50 server:4553] Could not listen on 0.0.0.0:443 (address:port is already in use by another application).
[E 180708 11:47:50 server:4567] Exception was: (98, 'Address already in use')

So, here, the problem appears to be due to gateone using default setting (recreated) instead of those in /var/packages/MODS_GateOne/target/var/conf.d/90custom.conf

I presume I have to test with the config of my package:

bash-4.3# /usr/local/gateone/env/bin/gateone --config /var/packages/MODS_GateOne/target/var/conf.d/90custom.conf

Doing so, I have another output error message:

Traceback (most recent call last):
  File "/usr/local/gateone/env/bin/gateone", line 11, in <module>
    load_entry_point('gateone==1.2.0', 'console_scripts', 'gateone')()
  File "/usr/local/gateone/env/lib/python2.7/site-packages/gateone-1.2.0-py2.7.egg/gateone/core/server.py", line 4053, in main
    commands = tornado.options.parse_command_line()
  File "/usr/local/gateone/env/lib/python2.7/site-packages/tornado/options.py", line 566, in parse_command_line
    return options.parse_command_line(args, final=final)
  File "/usr/local/gateone/env/lib/python2.7/site-packages/tornado/options.py", line 293, in parse_command_line
    raise Error('Option %r requires a value' % name)
tornado.options.Error: Option 'config' requires a value

"Could not listen on 0.0.0.0:443"
that is fine. It means that the other errors (regarding tornado) are gone.
You should now be able to start it using the web-interface.

Sorry for the non-formatting, I didn't see the option... And thx for your input.

@vletroye Wrap all your code between two lines of triple-backticks, like so:

```
(your code)

```

Reference: GitHub flavored MarkDown (help pages)