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

tt-rss don't start after install #4473

Closed UberElectron closed 1 year ago

UberElectron commented 3 years ago

Setup

Package Name: tt-rss Package Version: 20200829-12

NAS Model: DS115j NAS Architecture: MARVELL Armada 370 DSM version: DSM 6.2.3-25426 Update 3

Expected behavior

Package should run after install or after I clicked the run button.

Actual behavior

Package don't run with a message "Failed to run the package service". I managed to find the following error: Exception while creating PDO object:SQLSTATE[HY000] [1045] Access denied for user 'ttrss'@'localhost' (using password: YES)

Steps to reproduce

I don't know. I'm using php5.6 with MariaDB 5.

Package log

I was unable to find any log. I have searched into var/logs, usr/local/tt-rss/var, var/packages/tt-rss/target/var.

UberElectron commented 3 years ago

I have managed to get the webpage working. However, the package still fail to run every time.

I create the ttrss user and db in MariaDB manually and use my.site/tt-rss/install to initialize the db and generate a config file. No user o db was created automatically, so that may be the reason it wasn't working.

I'm having issues updating the feed following the wiki (https://tt-rss.org/wiki/UpdatingFeeds) using the update daemon.

Do the package manage updates by himself so it would work if the package runs?

smaarn commented 3 years ago

Hello @UberElectron ,

Just to be sure of the initial symptom: you were performing an install from scratch and the db wasn't appropriately setup ? (I'll work on this)

In theory the updating feeds is what's actually being handled by the service upon startup so you shouldn't be needing it. Would you be able to launch it manually by running the below command as the http user ?:

/var/packages/tt-rss/target/bin/tt-rss-daemon
smaarn commented 3 years ago

(Don't hesitate running the below command using -x in order to have debug logs e.g. /bin/bash -x /var/packages/tt-rss/target/bin/tt-rss-daemon).

Would it be possible to have the logs stored under /var/packages/tt-rss/target/var/logs/ directory ?

smaarn commented 3 years ago

Ok, it seems that latest version hasn't been published.

Do you think you could try testing using version generated in artifacts of GitHub checks for that commit: https://github.com/SynoCommunity/spksrc/commit/fc2606bf5a4c569347f220723df595b54821d7f1

?

It introduced more troubleshooting logs and fixed a few hiccups in installation procedure.

UberElectron commented 3 years ago

Hi @smaarn!,

Doing a fresh install didn't set dbs and users properly.

Sorry, I don't know how to start the package using those commands. However, /var/packages/tt-rss/target/bin/tt-rss-daemon doesn't exist, on that folder there are only the following files:

/var/packages/tt-rss/target/var/ folder is empty, so no logs there.

I will try using Github version, but there are 7 packages on the artifact. Which one should I use?

smaarn commented 3 years ago

Hi @smaarn!,

Doing a fresh install didn't set dbs and users properly.

Sorry, I don't know how to start the package using those commands. However, /var/packages/tt-rss/target/bin/tt-rss-daemon doesn't exist, on that folder there are only the following files:

  • busybox guess-php-configuration-file guess-php-fpm-bin guess-php-profile-name nice php-options php-settings.sh renice settings.sh start-stop-daemon virtual-php

Unfortunately in that version it's a "little" bit more complicated to launch the daemon. Which is one of the reasons for the update ;)

/var/packages/tt-rss/target/var/ folder is empty, so no logs there.

Unfortunately that folder wasn't filled until version 13 :/

I will try using Github version, but there are 7 packages on the artifact. Which one should I use?

Based on https://github.com/SynoCommunity/spksrc/wiki/Synology-and-SynoCommunity-Package-Architectures I think you should try armv7 one.

UberElectron commented 3 years ago

Hey! I have install the package from github. ttrss db and user have setup automatically (The old one was deleted when I uninstalled the old package).

Package still failed to run. However, the webpage works, /var/packages/tt-rss/target/bin/tt-rss-daemon works and daemon.log seems fine. Therefor, feed updates as long as I have the daemon being executed on SSH. tt-rss_install.log and tt-rss.log files are empty. I'm running the daemon command with debug logs. Do you need it?

The new version is working better, but IDK why the package failed to run. Should I look for more logs? Where may I find them?

smaarn commented 3 years ago

Now you should have logs under /var/packages/tt-rss/target/var/logs

In theory you shouldn't be needing to run the daemon script from ssh, that's what the service is supposed to be doing. We should check therefore the logs (it maybe a matter of rights).

UberElectron commented 3 years ago

Now you should have logs under /var/packages/tt-rss/target/var/logs

There are the following files. However, only daemon.log have something. (Nothing return when nl tt-rss.log or nl tt-rss_install.log.

In theory you shouldn't be needing to run the daemon script from ssh, that's what the service is supposed to be doing. We should check therefore the logs (it maybe a matter of rights).

The package is not running as it fail to run whenever I try starting it using package manager or synopkg start tt-rss.

smaarn commented 3 years ago

The daemon log file is actually the one which we need to look at. Any clue inside ?

UberElectron commented 3 years ago

daemon.log seems to be ok, nothing weird. I will post it and the /var/packages/tt-rss/target/bin/tt-rss-daemon command with debug log anyway, maybe you may see something unusual. Most updates lock like this:

990  [21:58:26/4143] Lock: update.lock
991  [21:58:26/4143] Scheduled 0 feeds to update...
992  [21:58:26/4143] Sending digests, batch of max 15 users, headline limit = 1000
993  [21:58:26/4143] All done.
994  [21:58:27/4143] Expired cache/export: removed 0 files.
995  [21:58:27/4143] Expired cache/feeds: removed 0 files.
996  [21:58:27/4143] Expired cache/images: removed 0 files.
997  [21:58:27/4143] Expired cache/upload: removed 0 files.
998  [21:58:27/4143] Removed 0 old lock files.
999  [21:58:27/4143] Removing old error log entries...
1000  [21:58:27/4143] Removing old archived feeds...
1001  [21:58:27/4143] Purged 0 orphaned posts.
1002  [21:58:27/12457] Sleeping for 120 seconds...

In this one, one feed was processed:

970  [21:56:21/3334] Lock: update.lock
971  [21:56:21/3334] Scheduled 1 feeds to update...
972  [21:56:21/3334] Base feed: https://tt-rss.org/forum/rss.php
973  [21:56:21/3334] => Tiny Tiny RSS: Forum (ID: 1, UID: 1), last updated: 2021-03-06 21:26:00
974  [21:56:22/3355] Lock: update_daemon-feed-1.lock
975  [21:56:25/3355] Purged feed 1 (60): deleted 0 articles
976  [21:56:25/3334] <= 4.5716 (sec) exit code: 0
977  [21:56:25/3334] Processed 1 feeds in 4.5823 (sec), 4.5823 (sec/feed avg)
978  [21:56:25/3334] Running housekeeping tasks for user 1...
979  [21:56:25/3334] Sending digests, batch of max 15 users, headline limit = 1000
980  [21:56:25/3334] All done.
981  [21:56:25/3334] Expired cache/export: removed 0 files.
982  [21:56:25/3334] Expired cache/feeds: removed 0 files.
983  [21:56:25/3334] Expired cache/images: removed 0 files.
984  [21:56:25/3334] Expired cache/upload: removed 0 files.
985  [21:56:25/3334] Removed 0 old lock files.
986  [21:56:25/3334] Removing old error log entries...
987  [21:56:25/3334] Removing old archived feeds...
988  [21:56:26/3334] Purged 0 orphaned posts.
989  [21:56:26/12457] Sleeping for 120 seconds...

Command with debug logs:

+++ dirname /var/packages/tt-rss/target/bin/tt-rss-daemon
++ cd /var/packages/tt-rss/target/bin
++ pwd
+ SCRIPT_DIR=/var/packages/tt-rss/target/bin
+ source /var/packages/tt-rss/target/bin/settings.sh
++ '[' -z '' ']'
++ WEB_STATION_HOME_DIR=/var/packages/WebStation
++ '[' -z '' ']'
++ PACKAGE=tt-rss
++ '[' -z '' ']'
++ INSTALL_DIR=/var/packages/tt-rss/target
++ '[' -z '' ']'
++ LOGS_DIR=/var/packages/tt-rss/target/var/logs
++ '[' -z '' ']'
++ WEB_DIR=/var/services/web
++ LOG_FILE=/var/packages/tt-rss/target/var/logs/tt-rss.log
++ '[' '!' -f /var/packages/tt-rss/target/var/logs/tt-rss.log ']'
+ TTRSS=/var/services/web/tt-rss/update.php
++ guess_php
++ local profile_name
++ local php_fpm
++ local php
++ '[' 0 -eq 0 ']'
+++ guess_php_profile_name
+++ local profile_name
++++ jq -r .default.php /var/packages/WebStation/etc/WebStation.json
+++ profile_name=844257d5-dd27-4885-8fd8-96cf320e39ac
+++ '[' 0 -ne 0 ']'
+++ '[' -z 844257d5-dd27-4885-8fd8-96cf320e39ac ']'
+++ echo -n 844257d5-dd27-4885-8fd8-96cf320e39ac
++ profile_name=844257d5-dd27-4885-8fd8-96cf320e39ac
++ '[' 0 -ne 0 ']'
+++ guess_php_fpm_bin 844257d5-dd27-4885-8fd8-96cf320e39ac
+++ local profile_name
+++ local profile_path
+++ local fpm_configuration_file
+++ local php_fpm
+++ '[' 1 -eq 0 ']'
+++ profile_name=844257d5-dd27-4885-8fd8-96cf320e39ac
+++ profile_path=/var/packages/WebStation/etc/php_profile/844257d5-dd27-4885-8fd8-96cf320e39ac
+++ fpm_configuration_file=/var/packages/WebStation/etc/php_profile/844257d5-dd27-4885-8fd8-96cf320e39ac/fpm.conf
+++ '[' -f /var/packages/WebStation/etc/php_profile/844257d5-dd27-4885-8fd8-96cf320e39ac/fpm.conf ']'
++++ php -r 'print(parse_ini_file($argv[1], true)["global"]["syslog.ident"]);' /var/packages/WebStation/etc/php_profile/844257d5-dd27-4885-8fd8-96cf320e39ac/fpm.conf
+++ php_fpm=php56-fpm
+++ '[' 0 -ne 0 ']'
+++ echo -n php56-fpm
++ php_fpm=php56-fpm
++ '[' -z php56-fpm ']'
+++ sed s/-fpm//g
+++ echo php56-fpm
++ php=php56
+++ guess_php_configuration_file php56
+++ local php_bin
+++ local web_station_configuration_file
+++ local php_fpm
+++ '[' 1 -eq 0 ']'
+++ php_bin=php56
+++ web_station_configuration_file=/var/packages/WebStation/etc/php56/php.ini
+++ '[' -f /var/packages/WebStation/etc/php56/php.ini ']'
+++ echo -n /var/packages/WebStation/etc/php56/php.ini
++ echo -n 'php56 -c /var/packages/WebStation/etc/php56/php.ini'
++ php_options
+++ cat /var/packages/tt-rss/target/etc/php/conf.d/com.synocommunity.tt-rss.ini
++ for line in '$(cat ${INSTALL_DIR}/etc/php/conf.d/com.synocommunity.tt-rss.ini)'
++ echo -n ' -d extension=curl.so'
++ for line in '$(cat ${INSTALL_DIR}/etc/php/conf.d/com.synocommunity.tt-rss.ini)'
++ echo -n ' -d extension=gd.so'
++ for line in '$(cat ${INSTALL_DIR}/etc/php/conf.d/com.synocommunity.tt-rss.ini)'
++ echo -n ' -d extension=intl.so'
++ for line in '$(cat ${INSTALL_DIR}/etc/php/conf.d/com.synocommunity.tt-rss.ini)'
++ echo -n ' -d extension=mysqli.so'
++ for line in '$(cat ${INSTALL_DIR}/etc/php/conf.d/com.synocommunity.tt-rss.ini)'
++ echo -n ' -d extension=pdo_mysql.so'
++ for line in '$(cat ${INSTALL_DIR}/etc/php/conf.d/com.synocommunity.tt-rss.ini)'
++ echo -n ' -d extension=posix.so'
+ exec php56 -c /var/packages/WebStation/etc/php56/php.ini -d extension=curl.so -d extension=gd.so -d extension=intl.so -d extension=mysqli.so -d extension=pdo_mysql.so -d extension=posix.so /var/services/web/tt-rss/update.php --daemon

I don't think the problem is related to the update daemon as it seems fine. I just discovered this:

  1. synopkg log tt-rss -> Failed to get log file 263
  2. synopkg query tt-rss -> Failed to query package tt-rss, 0

Any idea of what can the problem be? PD: Sorry for such a long message.

hgy59 commented 3 years ago

AFAIK this package was never adjusted for generic service support with DSM6. And there are known issues with mysql/mariadb integration.

A short test resulted in

smaarn commented 3 years ago

AFAIK this package was never adjusted for generic service support with DSM6. And there are known issues with mysql/mariadb integration.

A short test resulted in

  • after installation there is no mysql database created
  • the file /var/packages/tt-rss/target/var/tt-rss.pid exists but there is no process with the related pid
  • no log files exist in /var/packages/tt-rss/target/var
  • /var/log/packages/tt-rss.log does not report any error
  • /var/log/messages reports that preinst script of tt-rss failed by pkginstall.cpp:496

@hgy59 is there any particular reason for not having the latest version available on master (-13) in the SynoCommunity packages ?

It, among others, should fix the points 1 and 3 that you mention and should provide with more troubleshooting logs.

@UberElectron would it be possible for you to:

  1. Kill any daemon process running (if you have any running through ssh for example)
  2. Remove the daemon log file
  3. Restart the service

Re check the daemon log file ?

The daemon script file is actually filling that one and it's therefore also filled by the "through ssh" mechanism.

UberElectron commented 3 years ago

@UberElectron would it be possible for you to:

1. Kill any daemon process running (if you have any running through ssh for example)

2. Remove the daemon log file

3. Restart the service

Re check the daemon log file ?

The daemon script file is actually filling that one and it's therefore also filled by the "through ssh" mechanism.

I have deleted the /var/packages/tt-rss/target/var/logs/daemon.log file. Then, I try running tt-rrs package using the package manager. tt-rss failed to run and no daemon.log file was created. tt-rss.log still empty. I'm not sure I'm doing this correctly (kill "any" daemon process), but no tt-rss related daemon seems to be active.

smaarn commented 3 years ago

Is there anything generated under /var/log/packages/tt-rss.log ?

UberElectron commented 3 years ago

Is there anything generated under /var/log/packages/tt-rss.log ?

It seems to be installation data only. No errors or warnings so far:

    70  2021/03/06 19:49:33     install tt-rss 20201114-13 Begin preinst
    71  2021/03/06 19:49:35     install tt-rss 20201114-13 End preinst ret=[0]
    72  2021/03/06 19:49:35     install tt-rss 20201114-13 Begin /bin/rm -rf /volume1/@appstore/tt-rss
    73  2021/03/06 19:49:35     install tt-rss 20201114-13 End /bin/rm -rf /volume1/@appstore/tt-rss ret=[0]
    74  2021/03/06 19:49:35     install tt-rss 20201114-13 Begin /bin/mv -f /volume1/@tmp/pkginstall/package /volume1/@appstore/tt-rss
    75  2021/03/06 19:49:35     install tt-rss 20201114-13 End /bin/mv -f /volume1/@tmp/pkginstall/package /volume1/@appstore/tt-rss ret=[0]
    76  2021/03/06 19:49:35     install tt-rss 20201114-13 Begin /bin/rm -rf /var/packages/tt-rss
    77  2021/03/06 19:49:35     install tt-rss 20201114-13 End /bin/rm -rf /var/packages/tt-rss ret=[0]
    78  2021/03/06 19:49:36     install tt-rss 20201114-13 Begin /bin/mkdir -p /var/packages/tt-rss
    79  2021/03/06 19:49:36     install tt-rss 20201114-13 End /bin/mkdir -p /var/packages/tt-rss ret=[0]
    80  2021/03/06 19:49:36     install tt-rss 20201114-13 Begin /bin/mv -f /volume1/@tmp/pkginstall/INFO /var/packages/tt-rss/INFO
    81  2021/03/06 19:49:36     install tt-rss 20201114-13 End /bin/mv -f /volume1/@tmp/pkginstall/INFO /var/packages/tt-rss/INFO ret=[0]
    82  2021/03/06 19:49:36     install tt-rss 20201114-13 Begin /bin/rm -rf /var/packages/tt-rss/scripts
    83  2021/03/06 19:49:36     install tt-rss 20201114-13 End /bin/rm -rf /var/packages/tt-rss/scripts ret=[0]
    84  2021/03/06 19:49:36     install tt-rss 20201114-13 Begin /bin/mv -f /volume1/@tmp/pkginstall/scripts /var/packages/tt-rss/scripts
    85  2021/03/06 19:49:37     install tt-rss 20201114-13 End /bin/mv -f /volume1/@tmp/pkginstall/scripts /var/packages/tt-rss/scripts ret=[0]
    86  2021/03/06 19:49:37     install tt-rss 20201114-13 Begin /bin/rm -rf /var/packages/tt-rss/WIZARD_UIFILES
    87  2021/03/06 19:49:37     install tt-rss 20201114-13 End /bin/rm -rf /var/packages/tt-rss/WIZARD_UIFILES ret=[0]
    88  2021/03/06 19:49:37     install tt-rss 20201114-13 Begin /bin/mv -f /volume1/@tmp/pkginstall/WIZARD_UIFILES /var/packages/tt-rss/WIZARD_UIFILES
    89  2021/03/06 19:49:37     install tt-rss 20201114-13 End /bin/mv -f /volume1/@tmp/pkginstall/WIZARD_UIFILES /var/packages/tt-rss/WIZARD_UIFILES ret=[0]
    90  2021/03/06 19:49:37     install tt-rss 20201114-13 Begin /bin/rm -rf /var/packages/tt-rss/conf
    91  2021/03/06 19:49:37     install tt-rss 20201114-13 End /bin/rm -rf /var/packages/tt-rss/conf ret=[0]
    92  2021/03/06 19:49:37     install tt-rss 20201114-13 Begin /bin/mv -f /volume1/@tmp/pkginstall/conf /var/packages/tt-rss/conf
    93  2021/03/06 19:49:37     install tt-rss 20201114-13 End /bin/mv -f /volume1/@tmp/pkginstall/conf /var/packages/tt-rss/conf ret=[0]
    94  2021/03/06 19:49:51     install tt-rss 20201114-13 Begin postinst
    95  2021/03/06 19:50:20     install tt-rss 20201114-13 End postinst ret=[0]
    96  2021/03/06 19:50:20     install tt-rss 20201114-13 Begin /bin/rm -rf /volume1/@tmp/pkginstall
    97  2021/03/06 19:50:20     install tt-rss 20201114-13 End /bin/rm -rf /volume1/@tmp/pkginstall ret=[0]

It seems correct to me, but I don't know that much about Linux yet. Any ideas?

smaarn commented 3 years ago

Well, that's the thing, you should be seeing here logs regarding startup procedure.

For example if I run a tail on this file from my end I get:

2021/02/07 18:19:16 install tt-rss 20201114-13 End start-stop-status stop ret=[0]
2021/02/07 18:21:40 (system) trigger tt-rss 20201114-13 Begin start-stop-status start
Starting Tiny Tiny RSS ...
2021/02/07 18:21:41 (system) trigger tt-rss 20201114-13 End start-stop-status start ret=[0]
2021/02/22 20:43:27 (system) trigger tt-rss 20201114-13 Begin start-stop-status stop
Stopping Tiny Tiny RSS ...
2021/02/22 20:43:28 (system) trigger tt-rss 20201114-13 End start-stop-status stop ret=[0]
2021/02/22 20:46:41 (system) trigger tt-rss 20201114-13 Begin start-stop-status start
Starting Tiny Tiny RSS ...
2021/02/22 20:46:42 (system) trigger tt-rss 20201114-13 End start-stop-status start ret=[0]
smaarn commented 3 years ago

I've just been looking and it seems indeed that synopkg commands don't seem to operate well with tt-rss. I will need to check this.

How are you starting the service ? From the UI or from the command line ?

smaarn commented 3 years ago

Just checked on my side and synopkg start tt-rss and synopkg stop tt-rss seem to work well :(.

smaarn commented 3 years ago

One question: how are you running the synopkg start tt-rss commands ? On my side, if I run it as a regular user I get weird results, while running it as root seem to work fine.

UberElectron commented 3 years ago

How are you starting the service ? From the UI or from the command line ?

I have tried both, none of them works.

One question: how are you running the synopkg start tt-rss commands ? On my side, if I run it as a regular user I get weird results, while running it as root seem to work fine.

I have just done it as root and as user, same error: Failed to start package 272 .

Nothing new on var/log/packages/tt-rss.log about initialization after trying it.

hgy59 commented 3 years ago

@smaarn don't know why the latest version was not published.

Currently working on fixing -13.

  1. removed the busybox stuff
  2. provided a resource config to create ttrss mysql user (with random password) and privileges for ttrss db.
  3. current daemon fails with log entry please don't run this script as root
smaarn commented 3 years ago

@smaarn don't know why the latest version was not published.

Currently working on fixing -13.

Oh ok!

  1. removed the busybox stuff

Which would make it a no native package ! Nice!

  1. provided a resource config to create ttrss mysql user (with random password) and privileges for ttrss db.

  2. current daemon fails with log entry please don't run this script as root

Yes it needs to be started as anything but root user.

hgy59 commented 1 year ago

closed by #4923 please create a new issue for further problems with this package.