System not working after apt upgrade

Having issues with your DietPi installation, or, found a bug? Post it here.
zartarr88
Posts: 20
Joined: Sun Jul 05, 2020 4:18 am

Re: System not working after apt upgrade

Post by zartarr88 »

Hi again Joulinar,
ya I checked a bunch of places with little help, I figured my system is done and it all started from leaving the dietpi ecosystem with having little knowledge. Lesson learned, my plan is to stick to dietpi-update and avoid anything in the apt-get etc environment and not even upgrade in Nextcloud until its pushed through dietpi haha . So I'm at a stage where I just want to start fresh, I have DietPi User Data (with my 500 GB nextcloud stuff) on the external drive. In my mind I'm thinking to start fresh but then I don't have an idea of how to link the external drive to the new install and how a migration of Nextcloud could work. I found a post on these forums from 2017/2018 but was wanted to get your opinion on the process before I fudge up anymore.

Where I'm at right now is a working nextcloud page when I go to my IP ; but the family had 2 user accounts and their logins aren't working (I had done "dietpi-software reinstall 114" after uninstalling PHP, ETC. everything ; and went to a LIGHTTPD stack as recommended. When I go to my mnt/dietpi user data I can still see that folders with the 2 user accounts and the data still in tact ; I'm assuming there are steps to bridge the two steps ?
User avatar
MichaIng
Site Admin
Posts: 2262
Joined: Sat Nov 18, 2017 6:21 pm

Re: System not working after apt upgrade

Post by MichaIng »

Please do apt upgrades and especially Nextcloud updates whenever you can. dietpi-update calls apt upgrade as well, so you'd run into the same error but more difficult to debug since it's more packages at once are upgraded then. We nearly never force Nextcloud updates and even reinstalls do not touch an existing instance but refers to the internal updater.

The key is to upgrade things in small pieces, either more regularly or apt packages in smaller chunks of things that belong together, like the MariaDB package set or webserver/PHP and then check back service states directly. If a large amount is upgraded at once, errors at one place might cause error in other places, making it difficult to debug.

I'll come back to you about the Nextcloud logins later today. In the meantime could you check for kernel errors, e.g. file system I/O: dmesg | tail -10
User avatar
Joulinar
Posts: 2022
Joined: Sat Nov 16, 2019 12:49 am

Re: System not working after apt upgrade

Post by Joulinar »

I highly recommend to create a backup of your external HDD if you really like to recreate your system from scratch. Just in case thinks will not work out :)

Theoretically you could install everything on a new image. Once you setup a new NextCloud instance, you would need to create your users and move dietpi user data to the external HDD. Hopefully it's not gonna overwrite existing data. But thats why we have the backup ;) Once done you are able to reload all data from file system into NextCloud be running ncc files:scan --all. This will take a while depending on the amount of data.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
zartarr88
Posts: 20
Joined: Sun Jul 05, 2020 4:18 am

Re: System not working after apt upgrade

Post by zartarr88 »

Hey guys,
Ok understood Micha, I will do upgrades then if you suggest. Believe it or not but on the Nextcloud forums if you can see how many profile views you get, about 90% of fixing my errors was literally me just clicking on your name and browsing your posts haha; initially I thought it was just a coincidence but everytime dietpi is mentioned on there you are on top of it; so many thanks for your help and suggestion.

dmesg output:

Code: Select all

root@DietPi:~# dmesg | tail -10
[32862.601364] sd 0:0:0:0: [sda] tag#3 CDB: opcode=0x2a 2a 00 00 00 08 00 00 00 08 00
[32862.601439] sd 0:0:0:0: [sda] tag#2 uas_eh_abort_handler 0 uas-tag 9 inflight: CMD OUT 
[32862.601444] sd 0:0:0:0: [sda] tag#2 CDB: opcode=0x2a 2a 00 6a 40 09 68 00 00 10 00
[32862.601519] sd 0:0:0:0: [sda] tag#1 uas_eh_abort_handler 0 uas-tag 8 inflight: CMD OUT 
[32862.601524] sd 0:0:0:0: [sda] tag#1 CDB: opcode=0x2a 2a 00 6a 40 08 08 00 00 08 00
[32862.601600] sd 0:0:0:0: [sda] tag#0 uas_eh_abort_handler 0 uas-tag 7 inflight: CMD OUT 
[32862.601605] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 00 4e c0 0d f8 00 00 08 00
[32862.640065] scsi host0: uas_eh_device_reset_handler start
[32862.790714] usb 2-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[32862.824116] scsi host0: uas_eh_device_reset_handler success
Joulinar, regarding backing up ; I wanted to but everytime I plug another drive in it isn't recognized. and in drive-manager I didn't see a place to mount a secondary drive so I got confused and didn't want to mess up anything else.

to anyone else looking to migrate I will document what has worked so far:
Prerequisite: you user data is stored on external drive via drive-manager
1) Go to dietpi-software and Uninstall LEMP (nginx, mariadb, php) ; NGINX, MariaDB, PHP, Redis
2) Reinstall Nextcloud (will force install the stack all over again with dietpi magic the configurations will work and you will be up and running)
3) your logins will not work ; you will have admin for user name and dietpi for password
4) login as admin then do ncc files:scan -all ; this will reload your admin documents and you can go ahead and change your password back to what it was
5) ... now these are the problems I am awaiting for support;
- only my files were transfered via ncc files:scan -all ; I'm missing my calendar & contacts ... also I can't create a second user from the Nextcloud interface
* my understanding is that as long as nextcloud saves data under files its an easy restore. My gut says that my calendar and contacts are lost because there isn't a .ics or anything in the files for me to import back into my calendar apps. Suggestion would be if dietpi could have a script that backs this up to files ?
* Edit 1: I ssee a dietpi-nextcloud-database-backup.sql file in /mnt/dietpi_userdata/nextcloud_data ; so might be able to get calendar/contacts back
User avatar
Joulinar
Posts: 2022
Joined: Sat Nov 16, 2019 12:49 am

Re: System not working after apt upgrade

Post by Joulinar »

Calender entries are stored within the database

https://help.nextcloud.com/t/where-is-t ... r-app/6233
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
zartarr88
Posts: 20
Joined: Sun Jul 05, 2020 4:18 am

Re: System not working after apt upgrade

Post by zartarr88 »

Joulinar wrote: Tue Aug 11, 2020 6:36 pm Calender entries are stored within the database

https://help.nextcloud.com/t/where-is-t ... r-app/6233
hmm doesn't help me move forward ; I feel like someone on your team has thoughtfully gone through this process

I've seen several instances of mentioning restore but can't wrap my head around how to go about doing this in a newbie friendly step.
Most of my searches on how to restore speak about a .bak file ; and all I have to play with is in my /mnt/dietpi_userdata/nextcloud_data which has a dietpi-nextcloud-database-backup.sql . I think restoration of this somehow might bring things back because I can't recreate the second user with the Nextcloud web page nor through the terminal "Username is invalid because files already exist for this user"

Outstanding questions
1) restoration of calendar/contacts for admin
2) creation of the 2nd user so that I can file ncc files:scan --all and then restore their calendar/contacts

Everything else works out of the box, atleast for admin. I installed Joplin, Carnet and since they reference the 'files' folder for admin user it just synced up perfectly.


viewtopic.php?f=9&t=2734&p=10473&hilit= ... 6.0#p10473
https://github.com/MichaIng/DietPi/issues/672
User avatar
Joulinar
Posts: 2022
Joined: Sat Nov 16, 2019 12:49 am

Re: System not working after apt upgrade

Post by Joulinar »

you can try to create users on OS level as well.

https://docs.nextcloud.com/server/15/ad ... ands-label

on DietPi command looks like

Code: Select all

ncc user:add
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply