Nextcloud stopped working after updatting to v158

Having issues with your DietPi installation, or, found a bug? Post it here.
molnart
Posts: 17
Joined: Sat Apr 15, 2017 12:56 am

Nextcloud stopped working after updatting to v158

Post by molnart »

Hi, nextcloud shows a blank page and desktop app cannot connect since i have updated to v158. all services are running without problems.
lighttpd log says

Code: Select all

2017-11-17 01:51:47: (mod_fastcgi.c.2543) FastCGI-stderr: PHP message: PHP Fatal error:  Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [1044] Access denied for user 'oc_admin'@'localhost' to database 'nextcloud' in /var/www/nextcloud/lib/private/DB/Connection.php:61
any ideas how to troubleshoot the isssue?

edit: i was able to solve it by editing /var/www/nextcloud/config/config.php and changing the mysql login data to root / dietpi, but i don't understand what broke it...

thanks
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: Nextcloud stopped working after updatting to v158

Post by k-plan »

Hi,
molnart wrote:any ideas how to troubleshoot the isssue?
for NextCloud is at the moment a "work-in-process" on GitHub: https://github.com/Fourdee/DietPi/issues/1067

But it's a monster thread and I personally don't use NextCloud, OwnCloud, ... sorry.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: Nextcloud stopped working after updatting to v158

Post by johnvick »

Tonido is a good alternative.
molnart
Posts: 17
Joined: Sat Apr 15, 2017 12:56 am

Re: Nextcloud stopped working after updatting to v158

Post by molnart »

i am aware of the alternatives, but i started to use dietpi because i was looking for a solution to host nextcloud specifically. anyhow, issue solved, linking this to the github issue so that michaling is aware of it.
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: Nextcloud stopped working after updatting to v158

Post by k-plan »

Hi molnart,
molnart wrote:i am aware of the alternatives, but ...
It was more a hint from @johnvick , not especially only for you.Nore for all readers who will do a research for help.

Nice to see, you have post a link on github, so @MichaIng can have a look on it.
He work now for several months on this, and never give up! Really great job!
Wish here are more coder, who help @Fourdee to solve problems in code.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
User avatar
MichaIng
Site Admin
Posts: 2422
Joined: Sat Nov 18, 2017 6:21 pm

Re: Nextcloud stopped working after updatting to v158

Post by MichaIng »

Hey there, yes I accidently introduced this bug with the last update. As database users were not removed in the past on uninstall, it slipped through tests.

Yes Nextcloud installation is under heavy rework, but this should not affect running systems, I will do way more testing an careful review before touching running systems again. So deeply sorry for that!

Simplest solution to fix database access is just to regrant access for the user, your nc instance uses, which should be oc_admin@localhost:

$ mysql -uroot -pdietpi -e "grant all privileges on nextcloud.* to 'oc_admin'@'localhost'"

You could also create a new user with that privilege just named oc_admin without host appendix, which will automatically bequieth it's privileges to oc_admin@localhost, to totally restore the situation before bugdate:

$ mysql -uroot -pdietpi -e "grant all privileges on nextcloud.* to 'oc_admin' identified by '<password_from_config.php>'"

Giving Nextcloud root user access to database (set root and dietpi as dbuser and dbpass in config.php) is not recommended due to security reasons and will further not work for MariaDB setups.

Here PR to fix creation of bug and installation problems on MariaDB: https://github.com/Fourdee/DietPi/pull/1242
I am not yet sure if I should actually fix running systems on update or expact users to fix it by themself. I guess most users want to have their nc running fast again instead of waiting for next dietpi-update, or what you think?
rlamans
Posts: 9
Joined: Thu Jul 07, 2016 9:38 pm

Re: Nextcloud stopped working after updatting to v158

Post by rlamans »

So, for whatever reason, I had to reload DietPi on my Odroid XU4 and all went well except I am not able to install either Owncloud or Nextcloud. Install fails as noted by others in this forum ... so my question is what should I do?? (Don't be nasty) I was heavily using Owncloud between 3 computers and 4 phones at home with family members - actually Owncloud on the XU4 and Nextcloud app on our phones to auto upload pictures as the Owncloud app auto upload does not function.

Owncloud and Nextcloud fail install if Dietpi-software is used or apt-get install xx from the Owncloud/Nextcloud web site directions are used. I would be more than happy to test per directions posted here if that would help.
MonZon
Posts: 45
Joined: Fri Mar 31, 2017 6:07 pm

Re: Nextcloud stopped working after updatting to v158

Post by MonZon »

Damn, my nextcloud is down as well... :x

EDIT: Tried this

Code: Select all

$ mysql -uroot -pdietpi -e "grant all privileges on nextcloud.* to 'oc_admin'@'localhost'"
but still get error HTTP ERROR 500 on my nextcloud page.

Please, help. I'm kinda stuck without my cloud =(

EDIT2: I've had to reinstall it via:

Code: Select all

$ sudo dietpi-software uninstall 114
$ sudo dietpi-software install 114
This does not delete your user files (don't know about admin files, I do not store anything there), so you login via web page, add you old user and voila - your files are there. Most probably all other info would be gone, i.e. calendars etc. So use only if you have to.
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: Nextcloud stopped working after updatting to v158

Post by Fourdee »

MonZon wrote:Damn, my nextcloud is down as well... :x

EDIT: Tried this

Code: Select all

$ mysql -uroot -pdietpi -e "grant all privileges on nextcloud.* to 'oc_admin'@'localhost'"
but still get error HTTP ERROR 500 on my nextcloud page.

Please, help. I'm kinda stuck without my cloud =(

EDIT2: I've had to reinstall it via:

Code: Select all

$ sudo dietpi-software uninstall 114
$ sudo dietpi-software install 114
This does not delete your user files (don't know about admin files, I do not store anything there), so you login via web page, add you old user and voila - your files are there. Most probably all other info would be gone, i.e. calendars etc. So use only if you have to.
Hi,

We just released v159, which has some fixes for NextCloud. If the issue still occurs after updating, please let us know.
This does not delete your user files
Yep, we didnt really want to remove user data from NextCloud to avoid misuse. However, if problems persist, we may need to consider a complete removal system.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
carltonb
Posts: 6
Joined: Mon Oct 17, 2016 9:57 pm

Re: Nextcloud stopped working after updatting to v158

Post by carltonb »

I have been following the git hub thread because last month my Nextcloud went down again.
Tried to reinstall my backed up image but it was foobar.
Did a fresh install. Worked fine on Sunday night when I finished, went to use it lastnight and it had a xxx is currently unable to handle this request.
HTTP ERROR 500
I have dietpi version 159 installed.

Also had to do a lot of work in apache to get port 443 to be recognized. It used to be done automatically before after letsencrypt was installed.

Where should I go from here.
Thanks
Carltonb
Post Reply