SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
3.02k stars 1.23k forks source link

Gateone doesnt work anymore after dsm 6 #2340

Closed Oxize closed 6 years ago

Oxize commented 8 years ago

Can anybody from SynoCommunity compile a new Gateone package for DSM 6? After the release of DSM 6, GateOne isnt working anymore. I used this webbased ssh client alot.

DS214+ DSM 6.0-7321 Update 6 Problem: Package fails to run after clicking "Run" in package center, and automatically stops again.

Tried to reinstall gateone several times, and rebooting NAS. Doesnt work. If i need to test something, let me know.

gateone.log [I 160523 13:33:35 server:4179] Gate One License: AGPLv3 (http://www.gnu.org/licenses/agpl-.0.html) [I 160523 13:33:35 server:4188] Imported applications: Terminal [I 160523 13:33:35 server:4340] Version: 1.2.0 (20151116212858) [I 160523 13:33:35 server:4341] Tornado version 4.3 [I 160523 13:33:35 server:4361] Connections to this server will be allowed from the following origins: '*' [I 160523 13:33:35 server:4380] No SSL private key found. One will be generated. [I 160523 13:33:47 server:4384] No SSL certificate found. One will be generated. [I 160523 13:33:49 server:3678] No authentication method configured. All users will be ANONYMOUS [I 160523 13:33:49 server:3759] Loaded global plugins: gateone.plugins.editor, gateone.plugins.help

Dr-Bean commented 8 years ago

Waiting on #2216 and there's probably another issue where the SSL certificate location has changed in DSM6 (here and there)

Oxize commented 8 years ago

no workaround?

joutain commented 8 years ago

same issue here

Oxize commented 8 years ago

Dr-Bean, can i somehow get this working, or do we really need to wait on Synology for this adduser command problem?

Dr-Bean commented 8 years ago

Simply put, you have three choices at this point: wait for someone else to (help) add DSM6 compatibility, contribute and help solve the aforementioned issues yourself or downgrade to/do a clean install of a supported DSM version.

Oxize commented 8 years ago

Well i wished i had more knowledge about the used code, but i dont, otherwise i would try to help whereever i could. Its only anoyying, because i used Gateone alot from the web when i was at costumers, when i need to ssh into something. I like it more then putty.

Guess i have to wait. Downgrading my Synology isnt possible so far i know, i asked that already Synology Support.

patrikhuber commented 8 years ago

@Diaoul, any plans to have a look at this and update the package? ;-)

dextouu commented 8 years ago

Dsm 6 : ssl_certificate : /usr/syno/etc/certificate/system/default/fullchain.pem ssl_certificate_key : /usr/syno/etc/certificate/system/default/privkey.pem

Hello Mr.bean wants you access to the repository, can one make a commit, with information about certificates that I have published?

Alderaaan commented 8 years ago

Hi, Any news about this compilation ? GateOne is very powerful software I think it should be fixed. Tks a lot.

Oxize commented 8 years ago

Guess Synology doesnt wanna change their path stuff. I think the solution have to come from someone out of SynoCommunity. Were almost 6 months further.

I tried running the package as root, but cant still start the package. Still hope someone can look into this and get gateone working again.

@kanjusei : did you get gateone working?

joshlawless commented 7 years ago

A workaround that I used to get the package functioning was to edit the start-stop-status script (located in /var/packages/gateone/scripts/) to comment out the line that attempts to copy the certificate into the SSL folder (i.e., put a # in front of this line in the function start_daemon(): cp /usr/syno/etc/ssl/ssl.crt/server.crt /usr/syno/etc/ssl/ssl.key/server.key ${INSTALL_DIR}/ssl/

then I manually copied the ssl certificates from the system location into the folder gateone is looking for them:

cp /usr/syno/etc/certificate/system/default/cert.pem /usr/local/gateone/ssl/server.crt
cp /usr/syno/etc/certificate/system/default/privkey.pem /usr/local/gateone/ssl/server.key

Alternatively, you could edit the start-stop-status script to replace the cp command with one that looks in the right place (and renames appropriately). I don't really know how git works very well, but I've attempted to create a pull request that does this: https://github.com/SynoCommunity/spksrc/pull/2504

Oxize commented 7 years ago

@joshlawless: Got the Gateone running also now with your workaround. But i cant access the Gateone webinterface on 8271.

Edit, it worked before i uninstalled it. Used your code again, but now it doesnt start anymore. Sigh :(

Where can i package config file after its being downloaded? Package center says port 8271 is being used. Gateone cant be installed.

@joshlawless: Where does write gateone his port information? \etc.. ? (which file)

Nevermind found the gateone.sc file under /usr/local/etc/services.d

Oxize commented 7 years ago

Another try

Any other possible fixes to get it started or to see where it fails?

ujle commented 7 years ago

I also got this issue after upgrading to DSM6 some weeks ago. Finally I found some time to have a closer look - and now fixed it on my DS214play running 6.0.2-8451 Update 1.

This is what i did:

Then installed/upgraded some (whyever) missing python packages using: $ sudo /usr/local/python/bin/pip install html5lib tornado

And after doing another $ sudo /var/packages/gateone/scripts/start-stop-status start

GateOne is alive again :-)

addendum: changes survived upgrade to 6.0.2-8451 Update 2.

Oxize commented 7 years ago

Thanks your awesome! That worked like a charm!

tlc commented 7 years ago

Should a 5 step work-around close this issue?

Oxize commented 7 years ago

Why should i leave it open? Nobody wants to make it compatible for DSM 6.0.

cytec commented 7 years ago

@Oxize @Dr-Bean and @GoodOmens83 are working on an global DSM6 fix... This is not something that should be done on a per package base but globally to provide DSM6 support for all Packages. feel free to join the discussion over here: https://github.com/SynoCommunity/spksrc/pull/2345 or https://github.com/SynoCommunity/spksrc/issues/2216 if you have something usefull... all of this was already stated by @Dr-Bean here: https://github.com/SynoCommunity/spksrc/issues/2340#issuecomment-221187656

UglyAnimal commented 7 years ago

@ujle Your method didn't work for me. But i find a workaround. Just need to edit a few strings:

start_daemon ()
{
    # Copy certificate
#    cp /usr/syno/etc/ssl/ssl.crt/server.crt /usr/syno/etc/ssl/ssl.key/server.key ${INSTALL_DIR}/ssl/
#    chown ${USER} ${INSTALL_DIR}/ssl/*

#    su ${USER} -c "PATH=${PATH} nohup ${PYTHON} ${GATEONE} --settings_dir=${SETTINGS_DIR} > ${INSTALL_DIR}/var/gateone_startup.log &"

sudo -u ${USER} /bin/sh -c "PATH=${PATH} nohup ${PYTHON} ${GATEONE} --settings_dir=${SETTINGS_DIR} > ${INSTALL_DIR}/var/gateone_startup.log &"

}

stop_daemon ()
{
#    su ${USER} -c "PATH=${PATH} ${PYTHON} ${GATEONE} --kill --settings_dir=${SETTINGS_DIR}"
sudo -u ${USER} /bin/sh -c "PATH=${PATH} ${PYTHON} ${GATEONE} --kill --settings_dir=${SETTINGS_DIR}"
 wait_for_status 1 20 || kill -9 `cat ${PID_FILE}`
    rm -f ${PID_FILE}
}
strikekat commented 7 years ago

The above script modification worked great for me (thank you), but I had to leave the chown line uncommented to let gateone take control of the files. Otherwise, you'll get a bunch of non-obvious permission errors from Tornado when you attempt to access GateOne and the page won't load.

danielesegato commented 7 years ago

For me none of this worked.

the log in /usr/local/gateone/var/gateone_startup.log contains this:

/usr/local/gateone/env/bin/python: can't open file '/usr/local/gateone/env/bin/gateone': [Errno 2] No such file or directory

and if you look at the script this:

su ${USER} -c "PATH=${PATH} nohup ${PYTHON} ${GATEONE} \
       --settings_dir=${SETTINGS_DIR} > ${INSTALL_DIR}/var/gateone_startup.log &"

with these variables:

# Package
PACKAGE="gateone"
DNAME="GateOne"

# Others
INSTALL_DIR="/usr/local/${PACKAGE}"
PYTHON_DIR="/usr/local/python"
PATH="${INSTALL_DIR}/bin:${INSTALL_DIR}/env/bin:${PYTHON_DIR}/bin:${PATH}"
PYTHON="${INSTALL_DIR}/env/bin/python"
GATEONE="${INSTALL_DIR}/env/bin/gateone"
SETTINGS_DIR="${INSTALL_DIR}/var/conf.d"
PID_FILE="${INSTALL_DIR}/var/gateone.pid"
USER="gateone"

map to this:

su gateone -c "PATH=/usr/local/gateone/bin:/usr/local/gateone/env/bin:/usr/local/python/bin:${PATH} \
    nohup /usr/local/python/bin/python /usr/local/gateone/env/bin/gateone \
    --settings_dir=/usr/local/gateone/var/conf.d > /usr/local/gateone/var/gateone_startup.log &"

as you can see the actual command start python with python /usr/local/gateone/env/bin/gateone which is a file that doesn't exist

danielesegato commented 7 years ago

Post scriptum:

if I execute the start-stop script from root (after sudo -i) I get a permission denied on the su command but if I execute it with sudo /var/packages/gateone/scripts/start-stop-status start it execute just fine (just give the error stated above).

tparvais commented 7 years ago

is there a chance to have this problem solved in the coming days via a new package ? Tx

bickycheese commented 7 years ago

Joining in, +1 for a fix.

Mickroz commented 7 years ago

Joining too.

Jeeosch commented 7 years ago

+1 for a fix! I am running DSM 6.1-15047 Update 2 on a DS716+II. The workaround presented here doesn't work any longer ... unfortunately.

BlueZulu commented 7 years ago

+1 for a fix

fear commented 7 years ago

+1 for a Fix i would suggest looking into https://github.com/nickola/web-console because there was already a working package befor.

arnoxit commented 7 years ago

I made the following changes to /var/packages/gateone/scripts/start-stop-status:

In start_daemon ()

In both start_daemon () and stop_daemon ()

Seems to work for me at the moment (DS1513+ DSM 6.1.2-15132 Update 1)

vletroye commented 6 years ago

1000th arnoxit THX !!!!

I have been able to recreate a new SPK with the mentioned fixes and the installation works now fine. I couldn't resign it, obviously...

MODS_GateOne.zip

klibansky commented 6 years ago

Hi @vletroye that is great work. However, when I change the extension to .spk It doesn't want to install.... Invalid file format...

vletroye commented 6 years ago

The spk is inside the zip.. I might not upload an spk here ;)

V.

klibansky commented 6 years ago

I'm so sorry but if I extract the zip the contents looks like the attachment. Also package.tgz does not install (also not when adding .spk). Any help?

screenshot 2018-01-05 22 58 57
vletroye commented 6 years ago

Ok... Use this link : http://olympe.letroye.be/sspks/packages/MODS_GateOne.spk It's a download from my own SPK Server.

klibansky commented 6 years ago

Thank you very much! Unfortunately -->

screenshot 2018-01-06 20 10 46
vletroye commented 6 years ago

Which version of DSM do you have and wich model of Synology ?

GateOne is made for x86, braswell, bromolow, cedarview, avoton. And the package is targeting DSM > 5.0-4458 (because I never tested my tool to create packages with a previous DSM and many features are only supported as of 5.x)

Now, I can change any settings in the package to let you install it (without guarantee that it will work... it's at your own risk I have to say...)

klibansky commented 6 years ago

Mode: DS214+ CPU: MARVELL Armada XP MV78230 DSM: DSM 6.1.4-15217 Update 5

vletroye commented 6 years ago

Original Package has :

I did add armadaxp... But I really don't know the consequence. Here is the spk for you : https://ufile.io/e4k3r

klibansky commented 6 years ago

It does install this time. However, it does not start. There are no lines in the log...

vletroye commented 6 years ago

This package is most probably not just python and bash scripts...I presume therefore that there are binaries which really depends on the architecture.... bad luck :(

ssbarnea commented 6 years ago

Shouldn't we get the package removed/hidden from SynoCommunity repository until this is fixed?

tkirkland commented 6 years ago

@vletroye Trying to run this on DS2415+ (Intel ATOM) with DSM 6.1.6.. Fails to start. Where are the log files that I need to look at? I'm comfortable modding upstart scripts but just starting with Synology so I'm not sure where the base paths are? /var/log/?

vletroye commented 6 years ago

Hi tkirkland... Yes, logs are in /var/log

Did you use this spk: http://olympe.letroye.be/sspks/packages/MODS_GateOne.spk ? FYI: it's also failing to run on my DS since some recent DSM update. I was able to create a spk using the tips provided here, but I didn't spent time to check what could be wrong now.

To quickly find the relevant logs, do some cleanup ;) sudo -i mkdir BKP mv * BKP

Next, run the application, it will fail to start, and you should see new logs.

If I do it, if find

synopkg.log contains

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 commented 6 years ago

Very same error reported here: https://github.com/liftoff/GateOne/issues/690 Solution : pip install tornado==4.5.3

I did try it (installing first pip):

sudo -i wget https://bootstrap.pypa.io/get-pip.py python get-pip.py /bin/python -m pip uninstall tornado /bin/python -m pip install tornado==4.5.3

But it didn't solve the problem. I could still not run GateOne.

I wonder if this error could be due to the use of python 2 on Synology. NB.: but I will not install python 3 to try it, as the last time I did, a developer from Synology had to connect remotely on my NAS to fix the mess I did (and he was quie unhappy :p ).

tkirkland commented 6 years ago

I just set up gateone on a Linux Ubuntu box and had All sorts of issues until I found the right version of tornado to use. I'll experiment and report back.

akh1 commented 6 years ago

this work for me for Synology DSM 6.2-23739 Update 1 (MARVELL Kirkwood 88F6282)

install gateone from SynoCommunity

edit /var/packages/gateone/scripts/start-stop-status as above

correct tornado version

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)"

run normal

bittner commented 6 years ago

There is also a Docker image that may work on newer DSM versions that support Docker. Unfortunately, this also has issues, currently.

tkirkland commented 6 years ago

A slight modification of what @akh1 said is what worked for me... Here's what I did:

1) Installed Python 2.7 from app store for dependency... 2) Installed @vletroye 's .spk referenced http://olympe.letroye.be/sspks/packages/MODS_GateOne.spk 3) sudo /usr/local/gateone/env/bin/pip uninstall tornado 4) sudo /usr/local/gateone/env/bin/pip install tornado==4.5.3 5) At this point, Gateone should run from the UI just fine... Mine did.

I strongly suggest looking it /usr/local/gateone/var/conf.d as it contains all of the server defaults and two custom config files (which I deleted since I'm accessing behind a reverse proxy) which allow you to change port, http(s) and several other useful settings.

Do note that if you're using a reverse proxy as I am you'll need add a few lines in the nginx vhost to get things running.. Should anyone need help just reply.

Thanks to everyone that helped with this. It is working like a charm. Tested persistence through a reboot and the service restarted as would be expected.

fastback67 commented 6 years ago

Hello, I have a DS413 with Freescale CPU, based on qoriq arch.. The package is not compatible. Can someone add this arch to the package?

richardgamarra commented 6 years ago

I have GateOne already running on my Synology NAS 1813+. I dont see any icon to open the iframe or another window pointing to the app. Could you guide me what to do to open GateOne in Synology DSM?