causefx / Organizr

HTPC/Homelab Services Organizer - Written in PHP
GNU General Public License v3.0
5.1k stars 289 forks source link

Sqlite3Driver.php offset error after update to php7.4-sqlite3 package -> Organizr home page doesn't load #1330

Closed guydavis closed 4 years ago

guydavis commented 4 years ago
Organizr Version: V 2.x
Branch: Develop
WebServer: Nginx + Php7.4-fpm
Operating System: Ubuntu 16.04

Problem Description:

Existing Organizr install was working well, until I applied recently updates which included php7.4 updates such as php7.4-sqlite3. After restarting the next day, I am no longer to login into Organizr (Plex SSO) login which was working fine. The login succeeds with Plex, but never returns Organizr homepage. It just times out spinning as shown:

image

/opt/organizr/db/organizrLog.json shows successful login:

date":"2020-03-25T16:15:38Z","type":"success","username":"my.name","ip":"192.168.1.1","message":"Login Function - A User has logged in [Execution Time: 01.14s | 1146.2ms]"},{"
date":"2020-03-25 16:15:41","utc_
date":"2020-03-25T16:15:38Z","type":"success","username":"my.name@gmail.com","ip":"192.168.1.1","message":"Ombi Token Function - Grabbed token. [Execution Time: 01.96s | 1967.5ms]"},{"
date":"2020-03-25 16:15:43","utc_
date":"2020-03-25T16:15:38Z","type":"success","username":"my.name@gmail.com","ip":"192.168.1.1","message":"Tautulli Token Function - Grabbed token from: http:\/\/127.0.0.1:8181\/plexpy [Execution Time: 02.21s | 2214.7ms]"}]}

/var/log/nginx/error.log shows this error however:

2020/03/25 10:15:43 [error] 1137#1137: *1359 FastCGI sent in stderr: "fset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/Sqlite3Driver.php on line 452PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/Sqlite3Driver.php on line 452PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/Sqlite3Driver.php on line 452PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/Sqlite3Driver.php on line 452PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/Sqlite3Driver.php on line 452PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/Sqlite3Driver.php on line 452PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/Sqlite3Driver.php on line 452" while reading response header from upstream, client: 192.168.1.1, server: my.server.com, request: "POST /api/?v1/login HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "my.server.com", referrer: "https://my.server.com/"

/var/log/apt/history.log last update

Start-Date: 2020-03-02  09:01:44
Commandline: apt-get upgrade
Requested-By: davis (1000)
Upgrade: php7.4-cli:amd64 (7.4.2-1+ubuntu16.04.1+deb.sury.org+2, 7.4.3-4+ubuntu16.04.1+deb.sury.org+1), containerd.io:amd64 (1.2.10-3, 1.2.12-1), php7.1-xml:amd64 (7.1.33-4+ubuntu16.04.1+deb.sury.org+1, 7.1.33-12+ubuntu16.04.1+deb.sury.org+1), php7.1-mbstring:amd64 (7.1.33-4+ubuntu16.04.1+deb.sury.org+1, 7.1.33-12+ubuntu16.04.1+deb.sury.org+1), php7.1-readline:amd64 (7.1.33-4+ubuntu16.04.1+deb.sury.org+1, 7.1.33-12+ubuntu16.04.1+deb.sury.org+1), uuid-runtime:amd64 (2.27.1-6ubuntu3.9, 2.27.1-6ubuntu3.10), php7.1-zip:amd64 (7.1.33-4+ubuntu16.04.1+deb.sury.org+1, 7.1.33-12+ubuntu16.04.1+deb.sury.org+1), libfdisk1:amd64 (2.27.1-6ubuntu3.9, 2.27.1-6ubuntu3.10), php7.1-mysql:amd64 (7.1.33-4+ubuntu16.04.1+deb.sury.org+1, 7.1.33-12+ubuntu16.04.1+deb.sury.org+1), php-xml:amd64 (2:7.4+72+ubuntu16.04.1+deb.sury.org+1, 2:7.4+73+ubuntu16.04.1+deb.sury.org+1), php7.4-fpm:amd64 (7.4.2-1+ubuntu16.04.1+deb.sury.org+2, 7.4.3-4+ubuntu16.04.1+deb.sury.org+1), php7.3-readline:amd64 (7.3.14-1+ubuntu16.04.1+deb.sury.org+1, 7.3.15-3+ubuntu16.04.1+deb.sury.org+1), php-zip:amd64 (2:7.4+72+ubuntu16.04.1+deb.sury.org+1, 2:7.4+73+ubuntu16.04.1+deb.sury.org+1), php-common:amd64 (2:72+ubuntu16.04.1+deb.sury.org+1, 2:73+ubuntu16.04.1+deb.sury.org+1), php7.4-json:amd64 (7.4.2-1+ubuntu16.04.1+deb.sury.org+2, 7.4.3-4+ubuntu16.04.1+deb.sury.org+1), libmount1:amd64 (2.27.1-6ubuntu3.9, 2.27.1-6ubuntu3.10), php7.4-curl:amd64 (7.4.2-1+ubuntu16.04.1+deb.sury.org+2, 7.4.3-4+ubuntu16.04.1+deb.sury.org+1), libarchive13:amd64 (3.1.2-11ubuntu0.16.04.7, 3.1.2-11ubuntu0.16.04.8), php7.3:amd64 (7.3.14-1+ubuntu16.04.1+deb.sury.org+1, 7.3.15-3+ubuntu16.04.1+deb.sury.org+1), php7.3-json:amd64 (7.3.14-1+ubuntu16.04.1+deb.sury.org+1, 7.3.15-3+ubuntu16.04.1+deb.sury.org+1), util-linux:amd64 (2.27.1-6ubuntu3.9, 2.27.1-6ubuntu3.10), php7.1-sqlite3:amd64 (7.1.33-4+ubuntu16.04.1+deb.sury.org+1, 7.1.33-12+ubuntu16.04.1+deb.sury.org+1), php-sqlite3:amd64 (2:7.4+72+ubuntu16.04.1+deb.sury.org+1, 2:7.4+73+ubuntu16.04.1+deb.sury.org+1), php7.4-sqlite3:amd64 (7.4.2-1+ubuntu16.04.1+deb.sury.org+2, 7.4.3-4+ubuntu16.04.1+deb.sury.org+1), php7.1-opcache:amd64 (7.1.33-4+ubuntu16.04.1+deb.sury.org+1, 7.1.33-12+ubuntu16.04.1+deb.sury.org+1), php7.1-json:amd64 (7.1.33-4+ubuntu16.04.1+deb.sury.org+1, 7.1.33-12+ubuntu16.04.1+deb.sury.org+1), php7.3-common:amd64 (7.3.14-1+ubuntu16.04.1+deb.sury.org+1, 7.3.15-3+ubuntu16.04.1+deb.sury.org+1), php7.4-opcache:amd64 (7.4.2-1+ubuntu16.04.1+deb.sury.org+2, 7.4.3-4+ubuntu16.04.1+deb.sury.org+1), mount:amd64 (2.27.1-6ubuntu3.9, 2.27.1-6ubuntu3.10), php7.4-xml:amd64 (7.4.2-1+ubuntu16.04.1+deb.sury.org+2, 7.4.3-4+ubuntu16.04.1+deb.sury.org+1), libblkid1:amd64 (2.27.1-6ubuntu3.9, 2.27.1-6ubuntu3.10), php7.1-curl:amd64 (7.1.33-4+ubuntu16.04.1+deb.sury.org+1, 7.1.33-12+ubuntu16.04.1+deb.sury.org+1), php7.3-opcache:amd64 (7.3.14-1+ubuntu16.04.1+deb.sury.org+1, 7.3.15-3+ubuntu16.04.1+deb.sury.org+1), php-curl:amd64 (2:7.4+72+ubuntu16.04.1+deb.sury.org+1, 2:7.4+73+ubuntu16.04.1+deb.sury.org+1), php7.4-zip:amd64 (7.4.2-1+ubuntu16.04.1+deb.sury.org+2, 7.4.3-4+ubuntu16.04.1+deb.sury.org+1), php7.3-cli:amd64 (7.3.14-1+ubuntu16.04.1+deb.sury.org+1, 7.3.15-3+ubuntu16.04.1+deb.sury.org+1), dmidecode:amd64 (3.0-2ubuntu0.1, 3.0-2ubuntu0.2), php7.1-cli:amd64 (7.1.33-4+ubuntu16.04.1+deb.sury.org+1, 7.1.33-12+ubuntu16.04.1+deb.sury.org+1), libuuid1:amd64 (2.27.1-6ubuntu3.9, 2.27.1-6ubuntu3.10), php7.3-fpm:amd64 (7.3.14-1+ubuntu16.04.1+deb.sury.org+1, 7.3.15-3+ubuntu16.04.1+deb.sury.org+1), php7.4-readline:amd64 (7.4.2-1+ubuntu16.04.1+deb.sury.org+2, 7.4.3-4+ubuntu16.04.1+deb.sury.org+1), php7.1-fpm:amd64 (7.1.33-4+ubuntu16.04.1+deb.sury.org+1, 7.1.33-12+ubuntu16.04.1+deb.sury.org+1), libsmartcols1:amd64 (2.27.1-6ubuntu3.9, 2.27.1-6ubuntu3.10), php7.1-common:amd64 (7.1.33-4+ubuntu16.04.1+deb.sury.org+1, 7.1.33-12+ubuntu16.04.1+deb.sury.org+1), php-fpm:amd64 (2:7.4+72+ubuntu16.04.1+deb.sury.org+1, 2:7.4+73+ubuntu16.04.1+deb.sury.org+1), bsdutils:amd64 (1:2.27.1-6ubuntu3.9, 1:2.27.1-6ubuntu3.10), unattended-upgrades:amd64 (1.1ubuntu1.18.04.7~16.04.5, 1.1ubuntu1.18.04.7~16.04.6), php7.4-common:amd64 (7.4.2-1+ubuntu16.04.1+deb.sury.org+2, 7.4.3-4+ubuntu16.04.1+deb.sury.org+1), php7.1-mcrypt:amd64 (7.1.33-4+ubuntu16.04.1+deb.sury.org+1, 7.1.33-12+ubuntu16.04.1+deb.sury.org+1), docker-ce:amd64 (5:19.03.5~3-0~ubuntu-xenial, 5:19.03.6~3-0~ubuntu-xenial), docker-ce-cli:amd64 (5:19.03.5~3-0~ubuntu-xenial, 5:19.03.6~3-0~ubuntu-xenial)
End-Date: 2020-03-02  09:08:01
causefx commented 4 years ago

you can try installing composer and updating dibi.

guydavis commented 4 years ago

Thanks for the quick response. I've installed composer as mentioned:

sudo apt-get install curl php-cli php-mbstring git unzip
cd /tmp && curl https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
sudo apt install php7.4-ldap
cd /opt/organizr/html/api

However, it shows Nothing to install or update for dibi\dibi:

root@gandalf:/opt/organizr/html/api# composer outdated
Do not run Composer as root/super user! See https://getcomposer.org/root for details
adldap2/adldap2                  v10.0.2 v10.2.3 A PHP LDAP Package for humans.
composer/semver                  1.4.2   1.5.1   Semver library that offers utilities, version constraint parsing and validation.
dibi/dibi                        v3.2.3  v4.1.2  Dibi is Database Abstraction Library for PHP
guzzlehttp/guzzle                6.3.3   6.5.2   Guzzle is a PHP HTTP client library
guzzlehttp/psr7                  1.4.2   1.6.1   PSR-7 message implementation that also provides common utility methods
illuminate/contracts             v5.8.0  v7.3.0  The Illuminate Contracts package.
layershifter/tld-database        1.0.64  1.0.69  Database abstraction for Public Suffix List
layershifter/tld-extract         2.0.0   2.0.1   TLDExtract, library for extracting parts of domain, e.q. domain parser
Package layershifter/tld-extract is abandoned, you should avoid using it. No replacement was suggested.
layershifter/tld-support         1.1.1   1.1.1   Support package for TLDDatabase and TLDExtract
Package layershifter/tld-support is abandoned, you should avoid using it. No replacement was suggested.
lcobucci/jwt                     3.2.2   3.3.1   A simple library to work with JSON Web Token and JSON Web Signature
paragonie/constant_time_encoding v2.2.2  v2.3.0  Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)
paragonie/sodium_compat          v1.6.4  v1.13.0 Pure PHP implementation of libsodium; uses the PHP extension if it exists
phpmailer/phpmailer              v6.0.3  v6.1.5  PHPMailer is a full-featured email creation and transfer class for PHP
pragmarx/google2fa               v3.0.3  v7.0.0  A One Time Password Authentication package, compatible with Google Authenticator.
psr/log                          1.1.0   1.1.3   Common interface for logging libraries
pusher/pusher-php-server         v3.2.0  v4.1.1  Library for interacting with the Pusher REST API
symfony/polyfill-mbstring        v1.10.0 v1.14.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php56           v1.9.0  v1.14.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php72           v1.10.0 v1.14.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-util            v1.9.0  v1.14.0 Symfony utilities for portability of PHP codes
symfony/var-dumper               v4.2.3  v5.0.5  Symfony mechanism for exploring and dumping PHP variables
tightenco/collect                v5.7.27 v7.3.0  Collect - Illuminate Collections as a separate package.
root@gandalf:/opt/organizr/html/api# composer update dibi/dibi
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package layershifter/tld-extract is abandoned, you should avoid using it. No replacement was suggested.
Package layershifter/tld-support is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
root@gandalf:/opt/organizr/html/api#

The composer.json file I have seems to require: "dibi/dibi": "^3.1",

Any further tips are greatly appreciated.

causefx commented 4 years ago

edit that composer file to:

"dibi/dibi": "^4.1",

then run the update again.

guydavis commented 4 years ago

Thanks. Tried that and got:

root@gandalf:/opt/organizr/html/api# composer update dibi/dibi
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Updating dibi/dibi (v3.2.3 => v4.1.2): Downloading (100%)
Package layershifter/tld-extract is abandoned, you should avoid using it. No replacement was suggested.
Package layershifter/tld-support is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files

Then systemctl restart php7.4-fpm and checked the Organizr login. No change and still see this in the nginx error.log:

2020/03/25 14:29:52 [error] 1137#1137: *1505 FastCGI sent in stderr: "PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/SqliteResult.php on line 99PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/SqliteResult.php on line 99PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/SqliteResult.php on line 99PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/SqliteResult.php on line 99PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/SqliteResult.php on line 99PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/SqliteResult.php on line 99PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/SqliteResult.php on line 99PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/SqliteResult.php on line 99PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/SqliteResult.php on line 99PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/SqliteResult.php on line 99PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/SqliteResult.php on line 99PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/SqliteResult.php on line 99PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/SqliteResult.php on line 99PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/SqliteResult.php on line 99PHP message: PHP Notice:  Undefined offset: 0 in /opt/organizr/html/api/vendor/dibi/dibi/src/Dibi/Drivers/SqliteRes
causefx commented 4 years ago

Hmmm, can you open an issue here:

https://github.com/dg/dibi/issues

Also what is the full php version installed?

guydavis commented 4 years ago

Done, created dibi issue

PHP Version: 7.4.4-1+ubuntu16.04.1+deb.sury.org+1

Thanks for the help,

Edit: Turns out I can't rollback due to the PPA provider. Stuck without Organizr for now.

causefx commented 4 years ago

On my test machine - I'm running 7.4.1. I will update to 7.4.4 some time this week to test. Thanks!

dg commented 4 years ago

It seems that PHP 7.4.4 is broken, probably related to https://bugs.php.net/bug.php?id=79294

guydavis commented 4 years ago

Woah, dibi fixed this real quick by releasing 4.1.3 just this evening. Earlier update to 4.1.2 this afternoon had failed, but 4.1.3 is now working. I have Organizr home page again! Thanks very much.