YunoHost-Apps/teddit_ynh

Process often stops after the last update

Opened this issue · 6 comments

502 Bad Gateway

If you see this page, your connection with the server is working but the internal service providing this path is not responding.

Administrator, make sure that the service is running, and check its logs if it is not. The Services page is in your webadmin, under Tools > Services.

Thank you for using YunoHost.

Maybe there is a misconfiguration in the config files after the new update?
Full log here - https://paste.yunohost.org/kuwoxuyobi

It used to work perfectly fine before the latest update.

#6 updates the configuration file. I don't know if that solves the issue though.

I upgraded to the testing branch. I'll wait and see. Will report here. Thanks!

So I can for sure confirm that even the testing branch does not fix the issue https://paste.yunohost.org/utiyudowen

I am thinking to revert back or create a cron to start the service ever 10 minutes or so....

This seems to be an upstream issue... https://codeberg.org/teddit/teddit/issues/404

This seems to be an upstream issue... https://codeberg.org/teddit/teddit/issues/404

Ohhh....thanks for finding that out. I will revert then and wait for an upstream fix. Thanks!

I do not think that's the same reason now that I looked closer.

I get this:

<!DOCTYPE html>
<html>
<head>
<title>502 Bad Gateway</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>502 Bad Gateway</h1>
<p>If you see this page, your connection with the server is working but the internal service providing this path is not responding.</p>
<p>Administrator, make sure that the service is running, and check its logs if it is not.
The Services page is in your webadmin, under <code>Tools > Services</code>.</p>
<p><em>Thank you for using YunoHost.</em></p>
</body>
</html>

The service simply stops.

LOGFILE: journalctl
-- Journal begins at Sun 2023-06-04 10:40:01 CEST, ends at Sun 2023-06-04 17:59:29 CEST. --
Jun 04 17:56:12 npm[1129094]: > node app.js
Jun 04 17:56:12 npm[1129106]: Teddit running on http://rdt.trom.tf:8099
Jun 04 17:56:14 npm[1129106]: Fetched the JSON from reddit.com/r/PunishingGrayRaven/comments/12lrmfl/is_it_normal_to_get_depressed_about_pulaos_story/jg7j6ip/.
Jun 04 17:56:16 npm[1129106]: Fetched the JSON from reddit.com/r/explainlikeimfive/comments/13d8whr/eli5_are_explosions_in_space_really_that_dangerous/jjl36h2/.
Jun 04 17:56:17 npm[1129106]: Fetched the JSON from reddit.com/r/memes/comments/13t457l/why_can_i_hear_this_gif/jltlx8y/.
Jun 04 17:56:19 npm[1129106]: Fetched the JSON from reddit.com/r/IASIP/comments/11zoblk/predictions_for_upcoming_episodes/.
Jun 04 17:56:21 npm[1129106]: Fetched the JSON from reddit.com/r/barefootrunning.
Jun 04 17:56:21 npm[1129106]: Fetched the JSON from reddit.com/r/movies/comments/zn4cfq/official_discussion_avatar_the_way_of_water/j0rkolm/.
Jun 04 17:56:21 npm[1129106]: /var/www/teddit/node_modules/node-fetch/lib/index.js:272
Jun 04 17:56:21 npm[1129106]:                                 return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
Jun 04 17:56:21 npm[1129106]:                                                            ^
Jun 04 17:56:21 npm[1129106]: FetchError: invalid json response body at https://www.reddit.com/user/Wooden_Eggplant_221.json/?limit=26&after=&sort=new&t=&raw_json=0&rdt=61397 reason: Unexpected token < in JSON at position 5
Jun 04 17:56:21 npm[1129106]:     at /var/www/teddit/node_modules/node-fetch/lib/index.js:272:32
Jun 04 17:56:21 npm[1129106]:     at processTicksAndRejections (node:internal/process/task_queues:96:5) {
Jun 04 17:56:21 npm[1129106]:   type: 'invalid-json'
Jun 04 17:56:21 npm[1129106]: }
Jun 04 17:56:21 systemd[1]: teddit.service: Main process exited, code=exited, status=1/FAILURE
Jun 04 17:56:21 systemd[1]: teddit.service: Failed with result 'exit-code'.
Jun 04 17:56:21 systemd[1]: teddit.service: Consumed 3.137s CPU time.
Jun 04 17:56:27 systemd[1]: teddit.service: Scheduled restart job, restart counter is at 7.
Jun 04 17:56:27 systemd[1]: Stopped Teddit: alternative to Reddit.
Jun 04 17:56:27 systemd[1]: teddit.service: Consumed 3.137s CPU time.
Jun 04 17:56:27 systemd[1]: Started Teddit: alternative to Reddit.
Jun 04 17:56:27 npm[1129221]: > teddit@0.4.0 start
Jun 04 17:56:27 npm[1129221]: > node app.js
Jun 04 17:56:27 npm[1129233]: Teddit running on http://rdt.trom.tf:8099
Jun 04 17:56:29 npm[1129233]: Fetched the JSON from reddit.com/r/ProgrammerHumor/comments/11aa8yd/applying_for_tech_job/j9syaie/.
Jun 04 17:56:33 npm[1129233]: Got /r/popular key from redis.
Jun 04 17:56:34 npm[1129233]: Something went wrong while fetching data from reddit API. 404 – Not Found
Jun 04 17:56:34 npm[1129233]: Seems like your instance is either blocked (e.g. due to API rate limiting), reddit is currently down, or your API key is expired and not renewd properly. This can also happen for other reasons.
Jun 04 17:56:34 npm[1129233]: Fetched the JSON from reddit.com/r/pathofexile/comments/11kuiwf/letting_off_steam_selfscammed/jba6sei/.
Jun 04 17:56:34 npm[1129233]: Fetched the JSON from reddit.com/r/Games/comments/10v46z3/hogwarts_legacy_review_thread/j7fxnr5/.
Jun 04 17:56:39 npm[1129233]: Fetched the JSON from reddit.com/r/InternetIsBeautiful/comments/10xuppi/i_made_a_site_to_roast_peoples_startup_landing/j7x4drv/.
Jun 04 17:56:48 npm[1129233]: /var/www/teddit/node_modules/node-fetch/lib/index.js:272
Jun 04 17:56:48 npm[1129233]:                                 return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
Jun 04 17:56:48 npm[1129233]:                                                            ^
Jun 04 17:56:48 npm[1129233]: FetchError: invalid json response body at https://www.reddit.com/user/136AngryBees.json?limit=26&after=&sort=new&t=&raw_json=0&rdt=40826 reason: Unexpected token < in JSON at position 5
Jun 04 17:56:48 npm[1129233]:     at /var/www/teddit/node_modules/node-fetch/lib/index.js:272:32
Jun 04 17:56:48 npm[1129233]:     at processTicksAndRejections (node:internal/process/task_queues:96:5) {
Jun 04 17:56:48 npm[1129233]:   type: 'invalid-json'
Jun 04 17:56:48 npm[1129233]: }
Jun 04 17:56:48 systemd[1]: teddit.service: Main process exited, code=exited, status=1/FAILURE
Jun 04 17:56:48 systemd[1]: teddit.service: Failed with result 'exit-code'.
Jun 04 17:56:48 systemd[1]: teddit.service: Consumed 3.245s CPU time.
Jun 04 17:56:53 systemd[1]: teddit.service: Scheduled restart job, restart counter is at 8.
Jun 04 17:56:53 systemd[1]: Stopped Teddit: alternative to Reddit.
Jun 04 17:56:53 systemd[1]: teddit.service: Consumed 3.245s CPU time.
Jun 04 17:56:53 systemd[1]: teddit.service: Start request repeated too quickly.
Jun 04 17:56:53 systemd[1]: teddit.service: Failed with result 'exit-code'.
Jun 04 17:56:53 systemd[1]: Failed to start Teddit: alternative to Reddit.