MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.87k stars 496 forks source link

Multiple Issues updating buster to bullseye #5605

Closed ZiggyPi closed 2 years ago

ZiggyPi commented 2 years ago

@MichaIng @Joulinar

Hey Guys,

I recently came back from a vacation and came to the conclusion that setting up a reverse proxy in lighttpd for sonarr, radarr etc. would be a good idea. As i was setting this up and got it to work, i thought to myself "wouldn't it be nice the have Organizr running to have everything nicely accessable". Well that is when the problems started. Organizr website gave the error : Your Composer dependencies require a PHP version ">= 7.4.0". So i did some searching on the internet en installed PHP7.4. And after that everything went belly up.

So i have managed to get some stuff working again after some removes, reinstalls and installs. I have made a matrix of the issues i still have now.

i am running dietpi 8.6.1 (buster), PHP7.3, PHP7.2-fpm, Lighttpd 1.4.53 (ssl)

Hope you guys can help me out with getting everything working again. If you can help me with getting Organizr to work, that would be a great plus.

|   Service  |IP:port Result                |IP/service Result                                              |
-----------------|----------------------------------------------|---------------------------------------------------------------------------------------------------------------|
|Sonarr      |Perfect                   |Perfect                                                    |
|Radarr      |Perfect                   |Perfect                                                    |
|Lidarr      |Perfect                   |Perfect                                                    |
|Deluge      |Perfect                   |No Such Resource, No such child resource                                   |
|Jackett     |Perfect                   |Perfect                                                    |
|Plex        |Perfect                   |401 Unauthorized                                               |
|Webmin ssl=1    |Perfect                   |ERROR - DOCUMENT FOLLOWS - This web server is running in SSL mode. Try the URL https://localhost:10000/ instead|
|Webmin ssl=0    |This site can't provide a secure connection   |Basic text, no graphics, after Login : 404 Not Found                               |
|HTPC Manager    |Can't be reached              |Perfect                                                    |
|Dietpi Dashboard|Perfect                   |Blank Page                                                 |
|Ubooquity   |Perfect                   |Basic text, no graphics                                            |
|Ubooquity Admin |Perfect                   |HTTP ERROR 500 - Could not find matching provider (worng URL)                  
|Nextcloud   |-                     |404 Not Found                                                  |
MichaIng commented 2 years ago

That was directly after you tried to access Nextcloud (log files are cleared hourly with RAM log)?

What are the last Nextcloud logs?

tail -5 /mnt/dietpi_userdata/nextcloud_data/nextcloud.log

Sonarr has no write permissions for that directory. It's limited to /mnt and /media dirs. But check our docs about how to add access to a custom dir: https://dietpi.com/docs/software/bittorrent/#sonarr

The sonarr user requires write access as well, of course.

ZiggyPi commented 2 years ago

Ran it again after tried to open nextcloud

root@DietPi-HTPC:~# journalctl -u nginx -u php7.4-fpm
-- Journal begins at Fri 2022-07-08 07:17:02 CEST, ends at Fri 2022-07-08 08:09:08 CEST. --
-- No entries --
root@DietPi-HTPC:~# cat /var/log/nginx/error.log /var/log/php7.4-fpm.log
2022/07/08 08:08:58 [crit] 16064#16064: *70 connect() to unix:/run/php/php7.4-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 10.0.0.15, server: dietpi-htpc, request: "GET /nextcloud/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "10.0.0.30"

How can sonarr not have access after the update? It was working before

MichaIng commented 2 years ago

If you didn't edit the Sonarr service, the completed downloads dir and didn't move that download directory, it should never had access.

Is the PHP server running?

systemctl status php7.4-fpm
ZiggyPi commented 2 years ago

It should start download in HTPC/downloads/incomplete/ then move to HTPC/downloads/complete where sonarr should copy it to HTPC/series. And that is how it always worked. So maybe there is another issue with permissions that got wrecked in the update and maybe that is the reason that Samba isnt working correctly either

root@DietPi-HTPC:~# cat /var/log/nginx/error.log /var/log/php7.4-fpm.log
2022/07/08 08:08:58 [crit] 16064#16064: *70 connect() to unix:/run/php/php7.4-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 10.0.0.15, server: dietpi-htpc, request: "GET /nextcloud/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "10.0.0.30"
root@DietPi-HTPC:~# systemctl status php7.4-fpm
● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/php7.4-fpm.service.d
             └─dietpi-process_tool.conf
     Active: inactive (dead) since Fri 2022-07-08 00:18:22 CEST; 7h ago
       Docs: man:php-fpm7.4(8)
   Main PID: 507 (code=exited, status=0/SUCCESS)
     Status: "Processes active: 0, idle: 4, Requests: 5, slow: 0, Traffic: 0req/sec"
        CPU: 1.573s

Warning: journal has been rotated since unit was started, output may be incomplete.
MichaIng commented 2 years ago

Start PHP:

systemctl start php7.4-fpm
sleep 3
systemctl status php7.4-fpm

The Bullseye upgrade shouldn't touch any permissions. But let's check:

systemctl cat htpc-manager
ls -dl /HTPC/downloads/{in,}complete
ZiggyPi commented 2 years ago
root@DietPi-HTPC:~# systemctl start php7.4-fpm
root@DietPi-HTPC:~# sleep 3
root@DietPi-HTPC:~# systemctl status php7.4-fpm
● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/php7.4-fpm.service.d
             └─dietpi-process_tool.conf
     Active: active (running) since Fri 2022-07-08 08:30:24 CEST; 5s ago
       Docs: man:php-fpm7.4(8)
    Process: 30715 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74 (code=exited, status=0/SUCCESS)
   Main PID: 30710 (php-fpm7.4)
     Status: "Ready to handle connections"
      Tasks: 5 (limit: 4915)
        CPU: 247ms
     CGroup: /system.slice/php7.4-fpm.service
             ├─30710 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
             ├─30711 php-fpm: pool www
             ├─30712 php-fpm: pool www
             ├─30713 php-fpm: pool www
             └─30714 php-fpm: pool www

Jul 08 08:30:23 DietPi-HTPC systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...
Jul 08 08:30:24 DietPi-HTPC systemd[1]: Started The PHP 7.4 FastCGI Process Manager.
root@DietPi-HTPC:~# systemctl cat htpc-manager
# /etc/systemd/system/htpc-manager.service
[Unit]
Description=HTPC Manager (DietPi)
Wants=network-online.target
After=network-online.target

[Service]
SyslogIdentifier=HTPC Manager
ExecStart=/usr/bin/python3 -OO /mnt/dietpi_userdata/htpc-manager/Htpc.py

[Install]
WantedBy=multi-user.target

Things are getting weirder and weirder

root@DietPi-HTPC:~# ls -dl /HTPC/downloads/{in,}complete
ls: cannot access '/HTPC/downloads/incomplete': No such file or directory
ls: cannot access '/HTPC/downloads/complete': No such file or directory
MichaIng commented 2 years ago

Then you need to check where those have gone. Are/were those local directories or an external drive?

Ah wrong service about systemd permissions:

systemctl cat sonarr
ZiggyPi commented 2 years ago

These were on an external drive. I have noticed something weird. During our session yesterday night i checked sonarr and it status, and it was showing my external drive.... 245Gb free from 1.8TB. but now if i look.... it's no longer in the list. (EDIT: But it shows in the settings>media management tab)

systemctl cat sonarr

``` root@DietPi-HTPC:~# systemctl cat sonarr # /etc/systemd/system/sonarr.service [Unit] Description=Sonarr Daemon (DietPi) Wants=network-online.target After=network-online.target dietpi-boot.service [Service] SyslogIdentifier=Sonarr User=sonarr UMask=002 ExecStart=/usr/bin/mono /usr/lib/sonarr/bin/Sonarr.exe -nobrowser -data=/mnt/dietpi_userdata/sonarr TimeoutStopSec=20 KillMode=process Restart=on-failure # Hardening ProtectSystem=strict ProtectHome=true PrivateDevices=true ProtectKernelTunables=true ProtectControlGroups=true ReadWritePaths=/usr/lib/sonarr /mnt /media /var/log/sonarr /tmp [Install] WantedBy=multi-user.target # /etc/systemd/system/sonarr.service.d/dietpi-services_edit.conf [Unit] #Description=Sonarr Daemon (DietPi) #Wants=network-online.target #After=network-online.target dietpi-boot.service [Service] #SyslogIdentifier=Sonarr #User=sonarr #Group=dietpi #UMask=002 #ExecStart=/usr/bin/mono /usr/lib/sonarr/bin/Sonarr.exe -nobrowser -data=/mnt/dietpi_userdata/sonarr #TimeoutStopSec=20 #KillMode=process #Restart=on-failure # Hardening #ProtectSystem=strict #ProtectHome=true #PrivateDevices=true #ProtectKernelTunables=true #ProtectControlGroups=true #ReadWritePaths=/usr/lib/sonarr /mnt /media /var/log/sonarr /tmp [Install] #WantedBy=multi-user.target ```

I can reach the dietpi-HTCP via my windows explorer and can see 2 folders. dietpi and the HTPC (my external harddrive). HTPC i can access. but dietpi i cant... so this means the external drive is working

ZiggyPi commented 2 years ago

@MichaIng A quick update. Sonarr is working correctly again. Don't know what happened here. The only thing i did was a reboot

ZiggyPi commented 2 years ago

@MichaIng Another update. Samba is working again after i hashed out "widelinks = yes" in the samba conf file.

Apparently there is a samba-vfs-modules missing after the buster -> bullseye upgrade. And cant install it because i get an error that the file cant be found on the repo.

Joulinar commented 2 years ago

can you share the exact error?

ZiggyPi commented 2 years ago

@Joulinar

root@DietPi-HTPC:~# sudo apt install samba-vfs-modules
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  liburing1
Recommended packages:
  libcephfs2 libgfapi0
The following NEW packages will be installed:
  liburing1 samba-vfs-modules
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 458 kB/466 kB of archives.
After this operation, 1,549 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 https://mirror.netcologne.de/raspbian/raspbian bullseye/main armhf samba-vfs-modules armhf 2:4.13.13+dfsg-1~deb11u3
  404  Not Found [IP: 194.8.197.22 443]
E: Failed to fetch https://mirror.netcologne.de/raspbian/raspbian/pool/main/s/samba/samba-vfs-modules_4.13.13%2bdfsg-1%7edeb11u3_armhf.deb  404  Not Found [IP: 194.8.197.22 443]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
root@DietPi-HTPC:~#
ZiggyPi commented 2 years ago

And i dont know if this is a problem. But i get text messages running through eachother.

20220710_135050

Joulinar commented 2 years ago

maybe a temp issue of the apt package mirror? Because I see the file being available at https://mirror.netcologne.de/raspbian/raspbian/pool/main/s/samba/

Does following is working

cd /tmp
wget https://mirror.netcologne.de/raspbian/raspbian/pool/main/s/samba/samba-vfs-modules_4.13.13%2Bdfsg-1~deb11u4_armhf.deb
apt install ./samba-vfs-modules_4.13.13+dfsg-1~deb11u4_armhf.deb
rm samba-vfs-modules_4.13.13+dfsg-1~deb11u4_armhf.deb
Joulinar commented 2 years ago

But i get text messages running through eachother.

This is just cosmetic. Somehow text overlapping on the login page. Can be ignored.

dietpi-banner 1

ZiggyPi commented 2 years ago

Get a new error on the samba-vfs-modules install "broken packages"

root@DietPi-HTPC:~# cd /tmp
root@DietPi-HTPC:/tmp# wget https://mirror.netcologne.de/raspbian/raspbian/pool/main/s/samba/samba-vfs-modules_4.13.13%2Bdfsg-1~deb11u4_armhf.deb
--2022-07-10 13:52:58--  https://mirror.netcologne.de/raspbian/raspbian/pool/main/s/samba/samba-vfs-modules_4.13.13%2Bdfsg-1~deb11u4_armhf.deb
Resolving mirror.netcologne.de (mirror.netcologne.de)... 194.8.197.22, 2001:4dd0:1234:1::deb
Connecting to mirror.netcologne.de (mirror.netcologne.de)|194.8.197.22|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 459684 (449K) [application/octet-stream]
Saving to: ‘samba-vfs-modules_4.13.13+dfsg-1~deb11u4_armhf.deb’

samba-vfs-modules_ 100%[===============>] 448.91K  --.-KB/s    in 0.06s

2022-07-10 13:52:58 (7.88 MB/s) - ‘samba-vfs-modules_4.13.13+dfsg-1~deb11u4_armhf.deb’ saved [459684/459684]

root@DietPi-HTPC:/tmp# apt install ./samba-vfs-modules_4.13.13+dfsg-1~deb11u4_armhf.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'samba-vfs-modules' instead of './samba-vfs-modules_4.13.13+dfsg-1~deb11u4_armhf.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 samba-vfs-modules : Depends: samba-libs (= 2:4.13.13+dfsg-1~deb11u4) but 2:4.13.13+dfsg-1~deb11u3 is to be installed
                     Depends: libwbclient0 (= 2:4.13.13+dfsg-1~deb11u4) but 2:4.13.13+dfsg-1~deb11u3 is to be installed
E: Unable to correct problems, you have held broken packages.
root@DietPi-HTPC:/tmp# rm samba-vfs-modules_4.13.13+dfsg-1~deb11u4_armhf.deb
root@DietPi-HTPC:/tmp#
MichaIng commented 2 years ago

Don't install it like that if your APT repo lists are not up-to-date (causing the dependency mismatch), always install via APT:

apt update
apt install samba-vfs-modules
Joulinar commented 2 years ago

that's what he did @MichaIng https://github.com/MichaIng/DietPi/issues/5605#issuecomment-1179709304

However it seems the mirror has some issues, or the release file. The packages got updated yesterday at 10pm. Maybe it has not been synced fully. At least all files are available.

ZiggyPi commented 2 years ago

Ran it again as @MichaIng discribed, and that seems to work. Gonna check if unhashing widelinks will work

MichaIng commented 2 years ago

Jep, retry with proceeding apt update until the mirror is in sync again. Probably do once before:

/boot/dietpi/func/dietpi-set_software apt clean
ZiggyPi commented 2 years ago

Okay Samba is working as it should again with my original settings.

So only HTPC-Manager, Nextcloud and Organizr issues remain

MichaIng commented 2 years ago

Can you show again the HTPC Manager logs:

journalctl -u htpc-manager
ZiggyPi commented 2 years ago
root@DietPi-HTPC:~# journalctl -u htpc-manager
-- Journal begins at Sun 2022-07-10 13:17:02 CEST, ends at Sun 2022-07-10 14:12:43 CEST. --
-- No entries --
root@DietPi-HTPC:~#
Joulinar commented 2 years ago

Did you setup your revers proxy already. Because HTPC was listen to localhost only

ZiggyPi commented 2 years ago

No haven't figured it out for nginx yet. So before i go messing with that i want to get everything working normal again. So if i mess up something with the reverse proxy i know were to look for the issues

Joulinar commented 2 years ago

Actually HTPC is not reachable from something else than the local host only. That's why you need that proxy. At least on your current scenario

MichaIng commented 2 years ago

Ah right, the localhost issue. Can you run:

apt update
apt install sqlite3
sqlite3 /mnt/dietpi_userdata/htpc-manager/userdata/database.db 'select * from setting'
ZiggyPi commented 2 years ago

But before i had setup lighttpd reverse proxy, HTPC-Manager was working just fine

ZiggyPi commented 2 years ago

Okay ran that and restarted htpc-manager service, but still cant reach it in the browser

ZiggyPi commented 2 years ago
root@DietPi-HTPC:~# sqlite3 /mnt/dietpi_userdata/htpc-manager/userdata/database.db 'select * from setting'
1|stats_limit_processes|
2|stats_use_bars|0
3|stats_filesystem|
4|stats_reverse_proxy_link|
5|stats_scripts_enabled|0
6|stats_enable|on
7|stats_name|
8|stats_use_whitelist|0
9|stats_smart_enabled|0
10|stats_dash_message_enabled|0
11|stats_ohm_enabled|0
12|stats_ohm_ip|
13|stats_psutil_enabled|0
14|stats_ohm_port|
15|stats_mountpoint|
16|sonarr_port|
17|sonarr_ssl|0
18|sonarr_host|
19|sonarr_apikey|
20|sonarr_enable|on
21|sonarr_name|
22|sonarr_reverse_proxy_link|
23|sonarr_basepath|
24|radarr_ssl|0
25|radarr_enable|on
26|radarr_port|7878
27|radarr_basepath|
28|radarr_reverse_proxy_link|
29|radarr_host|127.0.0.1
30|radarr_apikey|
31|radarr_name|Radarr
32|plex_password|
33|plex_name|DietPi-HTPC
34|gdm_plex_servers|ec80fa267cb853ae1f4d289861ad98adb88f5fd1
35|plex_disable_img_resize|0
36|plex_mac|
37|plex_hide_homemovies|0
38|plex_hide_watched|0
39|plex_host|10.0.0.30
40|plex_username|
41|plex_enable|on
42|plex_ignore_sections|
43|plex_ssl|0
44|plex_port|32400
45|plex_reverse_proxy_link|
46|deluge_port|8112
47|deluge_basepath|
48|deluge_name|Deluge
49|deluge_ssl|0
50|deluge_reverse_proxy_link|
51|deluge_host|10.0.0.30
52|deluge_enable|on
53|deluge_password|********
54|app_updated_at|1619657858.39
55|app_auto_update|on
56|app_use_secure_headers|on
57|app_use_cdn|0
58|app_host|127.0.0.1
59|app_port|8085
60|app_use_proxy_headers_basepath|
61|app_username|
62|openbrowser|0
63|app_use_ssl|0
64|app_password|
65|app_use_proxy_headers|0
66|app_disable_cache_on_update|on
67|app_ssl_key|
68|branch|master2
69|app_webdir|/HTPC
70|app_check_for_updates|0
71|robots|0
72|git_path|git
73|app_loglevel|info
74|app_ssl_cert|
75|app_open_otherlink_in_iframe|0
76|git_cleanup|0
77|app_disable_menu_highlight|on
MichaIng commented 2 years ago

Okay ran that and restarted htpc-manager service, but still cant reach it in the browser

This was meant to show the database values, not to change something.

Run the following to change it:

sqlite3 /mnt/dietpi_userdata/htpc-manager/userdata/database.db "UPDATE setting SET val='0.0.0.0' WHERE key='app_host'"
systemctl restart htpc-manager
ZiggyPi commented 2 years ago

Okay will run that. But what about radarr... thats the same , but radarr is working

ZiggyPi commented 2 years ago

10.0.0.30:8085 is now giving a 404 error 10.0.0.30:8085/HTPC is working

So nextcloud internal server error and Organizr Webserver not setup for Organizr v2.1

MichaIng commented 2 years ago

Whenever there is an error, run this command to check the logs:

journalctl -u htpc-manager

So you changed the base path as well to make HTPC Manager working with the proxy. I think it would be much easier to bring up the proxy first instead of manually changing databases of all software (as you say it's the same with Radarr, Nextcloud most likely related to this as well) first back, then forth again.

For HTPC Manager base path, from what I see in your output, however it would be:

sqlite3 /mnt/dietpi_userdata/htpc-manager/userdata/database.db "UPDATE setting SET val='/' WHERE key='app_webdir'"
systemctl restart htpc-manager
ZiggyPi commented 2 years ago

I know i never touched the settings in nextcloud. Per default the link to nextcloud is 10.0.0.30/nextcloud, so never had to setup a reverse proxy for that

Joulinar commented 2 years ago

Can you try to fix one thing first before jumping on another one. Let's do HTPC for now

ZiggyPi commented 2 years ago

@Joulinar is already fixed. It was reachable via ip:8085/HTPC. And i changed that to empty the webdir again

MichaIng commented 2 years ago

Okay, for Nextcloud check:

tail -5 /mnt/dietpi_userdata/nextcloud_data/nextcloud.log
ZiggyPi commented 2 years ago
root@DietPi-HTPC:~# tail -5 /mnt/dietpi_userdata/nextcloud_data/nextcloud.log
{"reqId":"jrPOxsZCoCxMHFw4GjR7","level":2,"time":"2022-05-01T22:21:29+00:00","remoteAddr":"","user":"--","app":"appstoreFetcher","method":"","url":"--","message":"Could not connect to appstore: cURL error 28: Operation timed out after 60000 milliseconds with 817940 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://apps.nextcloud.com/api/v1/apps.json","userAgent":"--","version":"21.0.1.1"}
{"reqId":"JDzMczPHgXzOjX4doQmm","level":2,"time":"2022-05-20T23:31:05+00:00","remoteAddr":"","user":"--","app":"appstoreFetcher","method":"","url":"--","message":"Could not connect to appstore: cURL error 28: Operation timed out after 60000 milliseconds with 2904074 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://apps.nextcloud.com/api/v1/apps.json","userAgent":"--","version":"21.0.1.1"}
{"reqId":"0KFxvr9saoAiDqt1tdyG","level":2,"time":"2022-06-03T00:26:14+00:00","remoteAddr":"","user":"--","app":"appstoreFetcher","method":"","url":"--","message":"Could not connect to appstore: cURL error 28: Operation timed out after 60000 milliseconds with 2241588 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://apps.nextcloud.com/api/v1/apps.json","userAgent":"--","version":"21.0.1.1"}
{"reqId":"W3fYTRt1diHUrMRjCZ13","level":2,"time":"2022-06-13T01:00:40+00:00","remoteAddr":"","user":"--","app":"appstoreFetcher","method":"","url":"--","message":"Could not connect to appstore: cURL error 35: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to apps.nextcloud.com:443  (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://apps.nextcloud.com/api/v1/apps.json","userAgent":"--","version":"21.0.1.1"}
{"reqId":"TQeyuHTtt1suz8VrVVnm","level":2,"time":"2022-06-23T01:41:32+00:00","remoteAddr":"","user":"--","app":"appstoreFetcher","method":"","url":"--","message":"Could not connect to appstore: cURL error 28: Operation timed out after 60000 milliseconds with 2682890 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://apps.nextcloud.com/api/v1/apps.json","userAgent":"--","version":"21.0.1.1"}
root@DietPi-HTPC:~#
MichaIng commented 2 years ago

So no (related/current) errors on that end. Check again (shortly after trying to access Nextcloud):

journalctl -u nginx -u php7.4-fpm
cat /var/log/nginx/error.log /var/log/php7.4-fpm.log
ZiggyPi commented 2 years ago
root@DietPi-HTPC:~# journalctl -u nginx -u php7.4-fpm                      -- Journal begins at Sun 2022-07-10 14:17:02 CEST, ends at Sun 2022-07-10 15:06:09 CEST. --                                                           Jul 10 14:44:59 DietPi-HTPC systemd[1]: Stopping A high performance web server and a reverse proxy server...                                          Jul 10 14:44:59 DietPi-HTPC systemd[1]: nginx.service: Succeeded.          Jul 10 14:44:59 DietPi-HTPC systemd[1]: Stopped A high performance web server and a reverse proxy server.
Jul 10 14:44:59 DietPi-HTPC systemd[1]: Starting A high performance web server and a reverse proxy server...                                          Jul 10 14:44:59 DietPi-HTPC systemd[1]: Started A high performance web server and a reverse proxy server.                                             Jul 10 14:49:47 DietPi-HTPC systemd[1]: Stopping The PHP 7.4 FastCGI Process Manager...
Jul 10 14:49:47 DietPi-HTPC systemd[1]: php7.4-fpm.service: Succeeded.     Jul 10 14:49:47 DietPi-HTPC systemd[1]: Stopped The PHP 7.4 FastCGI Process Manager.                                                                  Jul 10 14:49:47 DietPi-HTPC systemd[1]: php7.4-fpm.service: Consumed 26.827s CPU time.                                                                Jul 10 14:49:47 DietPi-HTPC systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...                                                               Jul 10 14:49:48 DietPi-HTPC systemd[1]: Started The PHP 7.4 FastCGI Process Manager.                                                                  Jul 10 14:49:54 DietPi-HTPC systemd[1]: Stopping A high performance web server and a reverse proxy server...                                          Jul 10 14:49:54 DietPi-HTPC systemd[1]: Stopping The PHP 7.4 FastCGI Process Manager...                                                               Jul 10 14:49:54 DietPi-HTPC systemd[1]: nginx.service: Succeeded.
Jul 10 14:49:54 DietPi-HTPC systemd[1]: Stopped A high performance web server and a reverse proxy server.
Jul 10 14:49:54 DietPi-HTPC systemd[1]: php7.4-fpm.service: Succeeded.
Jul 10 14:49:54 DietPi-HTPC systemd[1]: Stopped The PHP 7.4 FastCGI Process Manager.
-- Boot 5888ff0e51e0422f80d7ca5a56f5c76d --
Jul 10 14:50:04 DietPi-HTPC systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...
Jul 10 14:50:06 DietPi-HTPC systemd[1]: Started The PHP 7.4 FastCGI Process Manager.
Jul 10 14:50:11 DietPi-HTPC systemd[1]: Starting A high performance web server and a reverse proxy server...
Jul 10 14:50:11 DietPi-HTPC systemd[1]: Started A high performance web server and a reverse proxy server.
root@DietPi-HTPC:~# cat /var/log/nginx/error.log /var/log/php7.4-fpm.log
[10-Jul-2022 14:49:47] NOTICE: Terminating ...
[10-Jul-2022 14:49:47] NOTICE: exiting, bye-bye!
[10-Jul-2022 14:49:48] NOTICE: fpm is running, pid 9065
[10-Jul-2022 14:49:48] NOTICE: ready to handle connections
[10-Jul-2022 14:49:48] NOTICE: systemd monitor interval set to 10000ms
[10-Jul-2022 14:49:54] NOTICE: Terminating ...
[10-Jul-2022 14:49:54] NOTICE: exiting, bye-bye!
[10-Jul-2022 14:50:06] NOTICE: fpm is running, pid 509
[10-Jul-2022 14:50:06] NOTICE: ready to handle connections
[10-Jul-2022 14:50:06] NOTICE: systemd monitor interval set to 10000ms
root@DietPi-HTPC:~#
MichaIng commented 2 years ago

Hmm, does Nginx work with PHP at all? Can you access ip/phpinfo.php?

And does not Nextcloud CLI work?

ncc
ZiggyPi commented 2 years ago

phpinfo

PHP Version 7.4.30 page loaded, so that works

root@DietPi-HTPC:~# ncc
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'oc_admin1'@'localhost' (using password: YES) in /var/www/nextcloud/lib/private/DB/Connection.php:85
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(226): Doctrine\DBAL\Connection->executeQuery()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery()
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/nextcloud/lib/private/AppConfig.php(345): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/nextcloud/lib/private/AppConfig.php(110): OC\AppConfig->loadConfigValues()
#7 /var/www/nextcloud/lib/private/AppConfig.php(301): OC\AppConfig->getApps()
#8 /var/www/nextcloud/lib/private/legacy/OC_App.php(957): OC\AppConfig->getValues()
#9 /var/www/nextcloud/lib/private/Server.php(682): OC_App::getAppVersions()#10 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}()
#11 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#12 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet()
#13 /var/www/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query()
#14 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#15 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(177): OC\AppFramework\Utility\SimpleContainer->get()
#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#17 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#18 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet()
#19 /var/www/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query()
#20 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#21 /var/www/nextcloud/lib/private/Server.php(1031): OC\AppFramework\Utility\SimpleContainer->get()
#22 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}()
#23 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#24 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet()
#25 /var/www/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query()
#26 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#27 /var/www/nextcloud/lib/private/Server.php(1990): OC\AppFramework\Utility\SimpleContainer->get()
#28 /var/www/nextcloud/lib/private/Files/View.php(119): OC\Server->getLockingProvider()
#29 /var/www/nextcloud/lib/private/Server.php(430): OC\Files\View->__construct()
#30 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}()
#31 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#32 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet()
#33 /var/www/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query()
#34 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#35 /var/www/nextcloud/lib/private/Server.php(1353): OC\AppFramework\Utility\SimpleContainer->get()
#36 /var/www/nextcloud/lib/base.php(588): OC\Server->boot()
#37 /var/www/nextcloud/lib/base.php(1076): OC::init()
#38 /var/www/nextcloud/console.php(49): require_once('/var/www/nextcl...')
#39 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
root@DietPi-HTPC:~#
Joulinar commented 2 years ago

Uhh I guess the access to the database got corrupted while you removed the symbolic at the beginning of your journey. You could try to set a new one

Set new passowrd for NectCloud

root@DietPi:~# cat /var/www/nextcloud/config/config.php | grep dbpassword 
      'dbpassword' => 'topsecret', 
root@DietPi:~#
mysql -u root -e "SET PASSWORD FOR 'oc_admin'@localhost = PASSWORD(\"topsecret\");"
dietpi-services restart
MichaIng commented 2 years ago

The database user oc_admin1 configured, doesn't have permissions to access the database. This user is normally called oc_admin, the suffixed 1 may be due to a fresh reinstall while the old database user still existed.

Jep, probably has something to do with the removed database symlink. However, you need to change oc_admin1 to oc_admin as well in /var/www/nextcloud/config/config.php.

ZiggyPi commented 2 years ago

Okay changed oc_admin1 to oc_admin. But changing passwords gives me this

root@DietPi-HTPC:~# mysql -u root -e "SET PASSWORD FOR 'oc_admin'@localhost = PASSWORD(\"topsecret\");"
ERROR 1133 (28000) at line 1: Can't find any matching row in the user tableroot
Joulinar commented 2 years ago

What user do you have inside the database

mysql -e "SELECT User, Host FROM mysql.user;"

ZiggyPi commented 2 years ago
root@DietPi-HTPC:~# mysql -e "SELECT User, Host FROM mysql.user;"
+-------------+-----------+
| User        | Host      |
+-------------+-----------+
| mariadb.sys | localhost |
| root        | localhost |
+-------------+-----------+
root@DietPi-HTPC:~#
Joulinar commented 2 years ago

Looks like you lost your nextcloud database completely. Can you check what DBs existing

mysql -e "SHOW DATABASES;"

ZiggyPi commented 2 years ago
root@DietPi-HTPC:~# mysql -e "SHOW DATABASES;"
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+