danmed / TasmoBackupV1

Tasmota Backup TasmoBackup - backup all your tasmota devices in one place.
MIT License
133 stars 20 forks source link

Conatiner with sqlite fails #100

Closed stenso closed 1 month ago

stenso commented 1 month ago

There appears to be an issue when using sqlite type with docker. Fresh container using the latest image version and compose example.

> docker logs -f tasmobackup
PING localhost (127.0.0.1): 56 data bytes

--- localhost ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.075/0.075/0.075 ms
PING localhost (::1): 56 data bytes
ping: sendto: Address not available
Found IPv4
PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000]: General error: 1 no such table: settings in /var/www/html/lib/db.inc.php:24
Stack trace:
#0 /var/www/html/lib/db.inc.php(24): PDO->prepare()
#1 /var/www/html/lib/functions.inc.php(2): require_once('...')
#2 /var/www/html/upgrade.php(2): require_once('...')
#3 {main}
  thrown in /var/www/html/lib/db.inc.php on line 24
2024-09-24 21:21:18,854 INFO Set uid to user 0 succeeded
2024-09-24 21:21:18,857 INFO supervisord started with pid 1
2024-09-24 21:21:19,861 INFO spawned: 'processes' with pid 25
2024-09-24 21:21:19,864 INFO spawned: 'nginx' with pid 26
2024-09-24 21:21:19,868 INFO spawned: 'php-fpm' with pid 27
wait-for-it.sh: waiting 45 seconds for localhost:9000
[24-Sep-2024 21:21:19] NOTICE: fpm is running, pid 27
[24-Sep-2024 21:21:19] NOTICE: ready to handle connections
wait-for-it.sh: localhost:9000 is available after 1 seconds
2024-09-24 21:21:20,891 INFO success: processes entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-09-24 21:21:20,891 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-09-24 21:21:21,893 INFO reaped unknown pid 33 (exit status 0)
2024-09-24 21:21:22,896 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 3 seconds (startsecs)
[24-Sep-2024 21:21:28] WARNING: [pool www] child 40 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000]: General error: 1 no such table: settings in /var/www/html/lib/db.inc.php:24"
[24-Sep-2024 21:21:28] WARNING: [pool www] child 40 said into stderr: "Stack trace:"
[24-Sep-2024 21:21:28] WARNING: [pool www] child 40 said into stderr: "#0 /var/www/html/lib/db.inc.php(24): PDO->prepare()"
[24-Sep-2024 21:21:28] WARNING: [pool www] child 40 said into stderr: "#1 /var/www/html/lib/functions.inc.php(2): require_once('...')"
[24-Sep-2024 21:21:28] WARNING: [pool www] child 40 said into stderr: "#2 /var/www/html/index.php(2): require_once('...')"
[24-Sep-2024 21:21:28] WARNING: [pool www] child 40 said into stderr: "#3 {main}"
[24-Sep-2024 21:21:28] WARNING: [pool www] child 40 said into stderr: "  thrown in /var/www/html/lib/db.inc.php on line 24"
2024/09/24 21:21:28 [error] 41#41: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000]: General error: 1 no such table: settings in /var/www/html/lib/db.inc.php:24
Stack trace:
#0 /var/www/html/lib/db.inc.php(24): PDO->prepare()
#1 /var/www/html/lib/functions.inc.php(2): require_once('...')
#2 /var/www/html/index.php(2): require_once('...')
#3 {main}
  thrown in /var/www/html/lib/db.inc.php on line 24" while reading response header from upstream, client: xxxxxxxxx

When using mysql, the container works as intended.

stenso commented 1 month ago

Now with mysql type, I'm seeing a php error thrown when trying to save settings.

  [24-Sep-2024 21:45:47] WARNING: [pool www] child 47 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Uncaught Error: Call to a member function prepare() on null in /var/www/html/lib/db.inc.php:43"
  [24-Sep-2024 21:45:47] WARNING: [pool www] child 47 said into stderr: "Stack trace:"
  [24-Sep-2024 21:45:47] WARNING: [pool www] child 47 said into stderr: "#0 /var/www/html/settings.php(9): dbSettingsUpdate()"
  [24-Sep-2024 21:45:47] WARNING: [pool www] child 47 said into stderr: "#1 {main}"
  [24-Sep-2024 21:45:47] WARNING: [pool www] child 47 said into stderr: "  thrown in /var/www/html/lib/db.inc.php on line 43"
  2024/09/24 21:45:47 [error] 40#40: *7 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to a member function prepare() on null in /var/www/html/lib/db.inc.php:43
  Stack trace:
  #0 /var/www/html/settings.php(9): dbSettingsUpdate()
  #1 {main}
    thrown in /var/www/html/lib/db.inc.php on line 43" while reading response header from upstream, client: X.X.X.X, server: _, request: "POST /settings.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "X.X.X.X:8259", referrer: "http://X.X.X.X:8259/settings.php"
  X.X.X.X - - [24/Sep/2024:21:45:47 +0000] "POST /settings.php HTTP/1.1" 500 5 "http://X.X.X.X:8259/settings.php" "XXXXXXX"
patrickdk77 commented 1 month ago

What kind of system are you on? intel/amd/arm/rpi/...?

stenso commented 1 month ago

Intel Ubuntu 24.04.1

patrickdk77 commented 1 month ago

Should be fixed in 1.06.08

stenso commented 1 month ago

Should be fixed in 1.06.08

Just gave everything a test and all appears to be working. Thanks for addressing this 👍