jgeusebroek / docker-spotweb

A docker image running ubuntu/20.04 Linux and Spotweb
47 stars 27 forks source link

Unsuccessful install #42

Closed lwolfs closed 2 years ago

lwolfs commented 2 years ago

Hi,

I'm trying to get spotweb running but I encounter a problem I fail to solve...

My docker-compose looks like this:

version: '3.3'
services:
    spotweb:
        restart: always
        ports:
            - 9099:80
        container_name: spotweb
        volumes:
            - /data/docker/spotweb:/config
        environment:
            - TZ=Europe/Amsterdam
            - SPOTWEB_DB_TYPE=pdo_mysql
            - SPOTWEB_DB_HOST=my.databaseserver.name
            - SPOTWEB_DB_PORT=8077
            - SPOTWEB_DB_NAME=spotweb
            - SPOTWEB_DB_USER=spotweb
            - SPOTWEB_DB_PASS=my_secret_password
            - SPOTWEB_CRON_RETRIEVE=*/15 * * * *
        image: jgeusebroek/spotweb

After deploying this stack (is running),

Creating database configuration

rm: cannot remove '/var/www/spotweb/dbsettings.inc.php': No such file or directory

Setting (PHP) time zone to Europe/Amsterdam

sed: can't read /etc/php/7.*/*/php.ini: No such file or directory

 * Starting periodic command scheduler cron

   ...done.

I delete the file /data/docker/spotweb/dbsettings.inc.php as I read in the docs on https://github.com/edv/docker-spotweb

Then I start my browser at my.databaseserver.name:9099/install.php and I get the message:

This site is not reachable ERR_CONNECTION_REFUSED

My db server is a mariadb instance. I have tried this now about 10 times, but cannot seem to solve this issue... I am stuck.

15 minutes later 2 additional lines in the log:

Unable to connect to database: No database settings have been entered, please use the 'install.php' wizard to install and configure Spotweb.
If you are upgrading from an earlier version of Spotweb, please consult https://github.com/spotweb/spotweb/wiki/Frequently-asked-questions/ first
jgeusebroek commented 2 years ago

Using the docker-compose you provided Spotweb sets up and starts correctly in my test environment. I can't reproduce the problem.

Are you sure you are browsing to the host running the docker container?

lwolfs commented 2 years ago

Yes, sadly I am sure... ( a typo would have been so nice :-) )

I replaced the name with the IP address...same result.

jgeusebroek commented 2 years ago

The output should be similar to:

Creating spotweb ... done Attaching to spotweb spotweb | Creating database configuration spotweb | rm: cannot remove '/var/www/spotweb/dbsettings.inc.php': No such file or directory spotweb | Setting (PHP) time zone to Europe/Amsterdam spotweb | spotweb | Starting periodic command scheduler cron spotweb | ...done. spotweb | Enabling module rewrite. spotweb | To activate the new configuration, you need to run: spotweb | service apache2 restart spotweb | Enabling module expires. spotweb | To activate the new configuration, you need to run: spotweb | service apache2 restart spotweb | Considering dependency filter for deflate: spotweb | Module filter already enabled spotweb | Module deflate already enabled spotweb | Restarting Apache httpd web server apache2 spotweb | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.2. Set the 'ServerName' directive globally to suppress this message

lwolfs commented 2 years ago

These processes are running:

UID          PID    PPID  C STIME TTY          TIME CMD
root           1       0  0 12:38 ?        00:00:00 /bin/bash /entrypoint.sh
root          23       1  0 12:38 ?        00:00:00 /usr/sbin/cron
root          25       1  0 12:38 ?        00:00:00 /usr/bin/php /var/www/spotweb/bin/upgrade-db.php
root          68       0  1 12:43 pts/0    00:00:00 bash
root          80      68  0 12:43 pts/0    00:00:00 ps -ef

Should I wait for the db_upgrade to finish perhaps ?

jgeusebroek commented 2 years ago

Apache is not running. Which is weird. Try deleting this cached image and redownload. I've patched an error but I don't think it is related. You never know however ;)

I will read your reply tonight. I'm off for a while.

lwolfs commented 2 years ago

Thx for your help !

proddy commented 2 years ago

I have those exact same issues - those two errors in the log. It's ever since I re-installed this container on a new Ubuntu NUC a few months ago. I didn't have the problem before and still using the same config files. Spotweb works fine so I just ignore those warnings. Actually except for one annoying issue where it doesn't remember any previous downloads (i.e. the 'vinkjes' disappear).

lwolfs commented 2 years ago

Problem remains unfortunately.

proddy commented 2 years ago

in the container I see only Php 8.0 (root@spotweb:/etc/php/8.0) not 7

proddy commented 2 years ago

in the container I see only Php 8.0 (root@spotweb:/etc/php/8.0) not 7

oh just noticed you updated it ;-)

lwolfs commented 2 years ago

I updated my Ubuntu installation ( the docker host) because I noticed a docker update, so....

After the host was restarted I saw some extra lines in th e log:

today at 13:04:45 Starting periodic command scheduler cron today at 13:04:45 ...done. today at 13:10:45 Module rewrite already enabled today at 13:10:45 Module expires already enabled today at 13:10:45 Considering dependency filter for deflate: today at 13:10:45 Module filter already enabled today at 13:10:45 Module deflate already enabled today at 13:10:45 Restarting Apache httpd web server apache2 today at 13:10:45 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.112.2. Set the 'ServerName' directive globally to suppress this message today at 13:10:46 ...done. today at 13:11:31 Creating database configuration today at 13:11:31 Setting (PHP) time zone to Europe/Amsterdam today at 13:11:31 today at 13:11:31 Starting periodic command scheduler cron today at 13:11:31 ...done. today at 13:16:30 Container stopped today at 13:16:30 Container started today at 13:11:31 ...done. today at 13:16:25 Creating database configuration today at 13:16:25 Setting (PHP) time zone to Europe/Amsterdam today at 13:16:25 today at 13:16:25 Starting periodic command scheduler cron today at 13:16:25 ...done.

The output on my browser (Chrome) remains the same.

jgeusebroek commented 2 years ago

The PHP 7/8 error was a bug and has been fixed, The other errors / warnings can be ignored.

Your output log seems absolutely fine. I'm thinking maybe it's a network issue. Possibly your docker network. AFAIK the 192.168.112.2 range isn't a standard docker range but I could very well be wrong.

Other than that I really can't think of anything else.

Try running another image with a webinterface, anything, and see if that does work.

lwolfs commented 2 years ago

After testing, testing and ...testing, I noticed that I used the port of adminer instead of mysql (stupid, stupid). I changed the portnumber, and the installation continues after using the correctURL/install.php

Unforntunately when pressing the Create System button, I get a HTTP ERROR 500

Looks like I am almost there....

In the /var/log/apache/error.log I see:

[Sun Nov 21 10:57:47.805588 2021] [php:error] [pid 68] [client 192.168.2.76:58866] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function SpotInstall ::ownWarning(), 4 passed and exactly 5 expected in /var/www/spotweb/lib/SpotInstall.php:583\nStack trace:\n#0 [internal function]: SpotInstall::ownWarning()\n#1 /var/www/s potweb/lib/SpotInstall.php(521): file_put_contents()\n#2 /var/www/spotweb/lib/SpotInstall.php(442): SpotInstall::createDbSettingsFile()\n#3 /var/www/spotweb/install.php(74 ): SpotInstall::createSystem()\n#4 {main}\n thrown in /var/www/spotweb/lib/SpotInstall.php on line 583, referer: http://my.secretserver:9099/install.php?page=4

I selected a PRIVATE server, not a public one

Solved: In the container I renamed the link /var/www/spotnet/dbsettings.inc.php to dbsettings.inc.php.ORIG. The installation creates a new file over here. But to be sure an update doesnot overwrite this file I moved the file over to /config and created a new link to this file in /var/www/spotweb.