YunoHost-Apps / lutim_ynh

Lutim package for YunoHost
https://lut.im
GNU General Public License v3.0
5 stars 7 forks source link

After installation giving 502 Bad Gateway #10

Closed anmol26s closed 8 years ago

anmol26s commented 9 years ago

Here is the installation log https://datamol.in/zerobin/?35f2f88d47dda76b#V2dH9YdrcvtuEbDpO62cGH1c8xsBu+4+M9hX60a7VkU= Here is the production log https://datamol.in/zerobin/?1e2c14d1fbad03ec#J1Lp/dXz/p4SoEaES6vtPZcNMo48GM73OGgKGobde7k=

maniackcrudelis commented 9 years ago

Salut,

cette erreur est connue. https://github.com/ldidry/lutim/issues/59#issuecomment-93333772

Et a été, en principe, patchée. https://github.com/maniackcrudelis/lutim_ynh/blob/master/sources/ajouts/script/lutim

Peux-tu vérifier le contenu du dossier local/lib/perl5/i486-linux-gnu-thread-multi-64int de lutim? Et la question qui me taraude, es-tu sur une architecture i486!? Sinon, il faut sans doute modifier le path pour s'accorder à ton architecture.

anmol26s commented 9 years ago

Hi

My path is /local/lib/perl5/x86_64-linux-gnu-thread-multi I have changed the file at /var/www/lutim/script/lutim. It looks like this now https://datamol.in/zerobin/?ae16a2f38ce520e8#W7KnVZhcp8T1k8ktEhieWGMiqEWw0fEW7zPJngmPRlc= But it still give 502 bad gateway error.

anmol26s commented 9 years ago

waooo Thank you now its working. I rebooted the server and every thing is fine. Here is working log https://datamol.in/zerobin/?da443340f18d863f#VDM8gd45OO+SqEIi9S8H/zSCBqixX85S+ACiv1woNAo=

anmol26s commented 8 years ago

Hi I am having 502 error again for this wonderful project. here is the lutim error log 2015/11/13 18:33:35 [error] 4213#0: *446 connect() failed (111: Connection refused) while connecting to upstream, client: 182.77.62.2, server: datamol.in, request: "GET /image/ HTTP/1.1", upstream: "http://127.0.0.1:8095/image/", host: "datamol.in", referrer: "https://datamol.in/yunohost/sso/"

and here is the output of # journalctl -xn Nov 13 18:58:33 datamol lutim[5202]: Starting lutim: Nov 13 18:58:34 datamol systemd[1]: lutim.service: control process exited, code= Nov 13 18:58:34 datamol systemd[1]: Failed to start LSB: starts lutim with hypno -- Subject: Unit lutim.service has failed -- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- Unit lutim.service has failed.

-- The result is failed. Nov 13 18:58:34 datamol systemd[1]: Unit lutim.service entered failed state.

systemctl status lutim.service -l

● lutim.service - LSB: starts lutim with hypnotoad Loaded: loaded (/etc/init.d/lutim) Active: failed (Result: exit-code) since Fri 2015-11-13 18:58:34 IST; 14min ago Process: 5202 ExecStart=/etc/init.d/lutim start (code=exited, status=1/FAILURE)

Nov 13 18:58:33 datamol lutim[5202]: Starting lutim: Nov 13 18:58:34 datamol systemd[1]: lutim.service: control process exited, code=exited status=1 Nov 13 18:58:34 datamol systemd[1]: Failed to start LSB: starts lutim with hypnotoad. Nov 13 18:58:34 datamol systemd[1]: Unit lutim.service entered failed state.

service lutim start

Job for lutim.service failed. See 'systemctl status lutim.service' and 'journalctl -xn' for details.

maniackcrudelis commented 8 years ago

Peux-tu m'indiquer le contenu du log production log?

anmol26s commented 8 years ago

Here is the production log.

[Sun Nov 15 01:08:52 2015] [warn] "url_sub_dir" configuration option is deprecated. Use "prefix" instead. "url_sub_dir" will be removed in the future [Sun Nov 15 01:08:53 2015] [info] Built asset for index.css [Sun Nov 15 01:08:53 2015] [info] Built asset for stats.css [Sun Nov 15 01:08:53 2015] [info] Built asset for about.css [Sun Nov 15 01:08:53 2015] [info] Built asset for index.js [Sun Nov 15 01:08:53 2015] [info] Built asset for stats.js [Sun Nov 15 01:08:53 2015] [info] Built asset for freeze.js [Sun Nov 15 01:08:54 2015] [info] Listening at "http://127.0.0.1:8095" [Sun Nov 15 01:08:54 2015] [info] Manager 12185 started [Sun Nov 15 01:08:54 2015] [info] Creating process id file "/var/www/lutim/script/hypnotoad.pid" [Sun Nov 15 01:13:30 2015] [warn] "url_sub_dir" configuration option is deprecated. Use "prefix" instead. "url_sub_dir" will be removed in the future Stopping Hypnotoad server 12185 gracefully.

maniackcrudelis commented 8 years ago

Un échec de démarrage de hypnotoad devrait être indiqué dans ce log. Là tout semble fonctionner normalement.

As-tu fait récemment la mise à jour vers Jessie? Après la mise à jour, je ne pouvais plus démarrer lutim. Une réinstallation de lutim (et d'autres services aussi!) m'avait permis de rétablir son fonctionnement.

anmol26s commented 8 years ago

Yes I updated to Jessie two month back. After the update when ever I reboot the services like nginx,mysql,php5-fpm and uwsgi do not start automatically. After the restarting the services manually they work. Now I have similar problem with lutim. But it do not work manually.

service lutim restart

Job for lutim.service failed. See 'systemctl status lutim.service' and 'journalctl -xn' for details.

maniackcrudelis commented 8 years ago

OK, je pense que c'est le même problème. Je ne lui ai pas trouvé de causes, et les problèmes suite à la mise à jour vers Jessie ont été nombreux.

Peux-tu supprimer et réinstaller lutim? Ou as-tu de nombreuses images que tu ne veux pas perdre?

anmol26s commented 8 years ago

I have reinstalled just now. The installation is always successful. But after the reboot its falling with above error. I can install again.

maniackcrudelis commented 8 years ago

Le log production.log n'indique toujours aucune erreur!?

anmol26s commented 8 years ago

This is log [Sun Nov 15 01:08:52 2015] [warn] "url_sub_dir" configuration option is deprecated. Use "prefix" instead. "url_sub_dir" will be removed in the future [Sun Nov 15 01:08:53 2015] [info] Built asset for index.css [Sun Nov 15 01:08:53 2015] [info] Built asset for stats.css [Sun Nov 15 01:08:53 2015] [info] Built asset for about.css [Sun Nov 15 01:08:53 2015] [info] Built asset for index.js [Sun Nov 15 01:08:53 2015] [info] Built asset for stats.js [Sun Nov 15 01:08:53 2015] [info] Built asset for freeze.js [Sun Nov 15 01:08:54 2015] [info] Listening at "http://127.0.0.1:8095" [Sun Nov 15 01:08:54 2015] [info] Manager 12185 started [Sun Nov 15 01:08:54 2015] [info] Creating process id file "/var/www/lutim/script/hypnotoad.pid" [Sun Nov 15 01:13:30 2015] [warn] "url_sub_dir" configuration option is deprecated. Use "prefix" instead. "url_sub_dir" will be removed in the future Stopping Hypnotoad server 12185 gracefully. [Sun Nov 15 01:34:23 2015] [warn] "url_sub_dir" configuration option is deprecated. Use "prefix" instead. "url_sub_dir" will be removed in the future [Sun Nov 15 01:34:24 2015] [info] Listening at "http://127.0.0.1:8095" [Sun Nov 15 01:34:24 2015] [info] Manager 12707 started [Sun Nov 15 01:34:24 2015] [info] Creating process id file "/var/www/lutim/script/hypnotoad.pid" [Sun Nov 15 01:34:39 2015] [warn] "url_sub_dir" configuration option is deprecated. Use "prefix" instead. "url_sub_dir" will be removed in the future Stopping Hypnotoad server 12707 gracefully.

maniackcrudelis commented 8 years ago

"Stopping Hypnotoad server 12707 gracefully."

Je suppose que ce n'est pas toi qui arrête le service? Peux-tu tester un démarrage manuel du serveur hypnotoad?

cd /var/www/lutim/ et carton exec hypnotoad script/lutim

On devrait voir directement si le serveur démarre correctement ou pas.

anmol26s commented 8 years ago

Doing cd /var/www/lutim/ and carton exec hypnotoad script/lutim

started the hypnotoad server Now lutim is working datamol.in/image

maniackcrudelis commented 8 years ago

Oui mais si le service ne fonctionne pas. Au prochain redémarrage, lutim sera à nouveau arrêté! Ce qui est étrange, ce que tu viens de faire manuellement ce que fait le script init...

anmol26s commented 8 years ago

I rebooted my server and then started the lutim with carton exec hypnotoad script/lutim

It was working ,but the command-line became so sluggish that I was not able to use it. I uninstalled the lutim and the command-line became normal.

maniackcrudelis commented 8 years ago

J'ai tenté une installation de lutim sur Yunohost à jour. Le service démarre normalement, même après arrêt et redémarrage.

Par contre, je constate que sudo service lutim start suivi de sudo service lutim stop fonctionne sans problème.

Mais sudo service lutim restart provoque une erreur.

maniackcrudelis commented 8 years ago

Le problème de restart de lutim vient sans doute du temps nécessaire au serveur hypnotoad pour démarrer et s'arrêter. Hors, le sleep 1 du script init n'est pas pris en compte, pour une raison que je ne comprend pas! Changer le temps de ce sleep ne change rien, le script init ne marque jamais ce temps d'attente!

Préfère l'usage de start et stop. Ça laisse le temps à hypnotoad de s'arrêter de redémarrer.

anmol26s commented 8 years ago

I tried to do sudo service lutim stop

It did not showed any error. But when I try to do sudo service lutim start or sudo service lutim restart There is error message: Job for lutim.service failed. See 'systemctl status lutim.service' and 'journalctl -xn' for details.

Every time I restart I have to run carton exec hypnotoad script/lutim to make lutim run. The start ,stop or restart command has no effect on lutim.

Moreover the yunohost service status shows lutim: status: inactive loaded: enabled

Despite the lutim is running.

maniackcrudelis commented 8 years ago

Je ne parviens pas à reproduire le bug que tu rencontres là. Depuis l'interface de Yunohost, je peux activer ou désactiver le service. Et également le démarrer ou l'arrêter.

En cli je peux le démarrer et l'arrêter avec sudo service lutim start/stop En revanche, le reboot ne marche pas. Sans doute en raison du sleep non respecté.

En l'état, je ne sais pas comment t'aider d'avantage. Surtout si carton exec hypnotoad script/lutim fonctionne sans te renvoyer d'erreur!

anmol26s commented 8 years ago

Thanks I am using the commands you told after each restart.

cd /var/www/lutim/ et carton exec hypnotoad script/lutimp

At least lutim is working.

maniackcrudelis commented 8 years ago

Corrigé sur ce commit https://github.com/maniackcrudelis/lutim_ynh/commit/e0edfbfd779a62700164d1ef7115f7e1cfde4e63

Tu peux faire une mise à jour du package pour rétablir le fonctionnement ;)

anmol26s commented 8 years ago

Thanks for the fix.