FN 11.2 Nextcloud Database

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
It wouldn't be much of a plugin if you still had to create a database yourself, IMO. What makes you ask? Are you seeing a problem that makes you suspect a database is missing?
 

don_sangiorgio

Dabbler
Joined
Jul 21, 2018
Messages
11
In my case, the plugin installs very well. But I have no idea what to put in the configuration fields for the database password. Am I supposed to know the credentials?
If I try my own credentials, I get this error:

Code:
Error while trying to create admin user: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)


I hope this is also what ZodiacUHD is encountering.
 

ZodiacUHD

Patron
Joined
Aug 28, 2015
Messages
226
Exactly that, I don’t know what to write in the databases’s fields. I tried looking around to see if after installation i get a text file with credentials but I couldn’t find anything useful.
 

gimbalpooper

Cadet
Joined
Jul 21, 2018
Messages
7
Just ran into the same issue. Transpires the database credentials are in text files in the root directory of the jail. To access from the UI go to the Jails from the sidebar, then click the 3 vertical dots to the right of your Nextcloud jail to open the menu, then select "Shell".

Once in the shell, type "ls" (without the quotes) and you'll see the dbname, dbuser and dbpassword files. To get your credentials, just cat them (e.g.: "cat dbname").
 

don_sangiorgio

Dabbler
Joined
Jul 21, 2018
Messages
11
Just ran into the same issue. Transpires the database credentials are in text files in the root directory of the jail. To access from the UI go to the Jails from the sidebar, then click the 3 vertical dots to the right of your Nextcloud jail to open the menu, then select "Shell".

Once in the shell, type "ls" (without the quotes) and you'll see the dbname, dbuser and dbpassword files. To get your credentials, just cat them (e.g.: "cat dbname").
Thanks a lot!! It would have gotten me ages to find this. Is there any official documentation where you found this, or did you stumble upon it?

Cheers,
Alex

(ps: for those who afterwards run into the "too many redirects" issue, the solution is here -> https://help.nextcloud.com/t/freebsd-nextcloud-13-0-1-update-too-many-redirects-error-bug/30494/3 )
 

gimbalpooper

Cadet
Joined
Jul 21, 2018
Messages
7
Is there any official documentation where you found this, or did you stumble upon it?

Very welcome Alex, glad it helped. Not sure if there's any official documentation yet - I just found it by looking around in the jail to see how they implemented the NC installation. Those database credential files are generated by the post_install.sh script, which is run during the plugin install process.

(ps: for those who afterwards run into the "too many redirects" issue, the solution is here -> https://help.nextcloud.com/t/freebsd-nextcloud-13-0-1-update-too-many-redirects-error-bug/30494/3 )

I was just about to sort that redirect issue, as I also ran into that. Thanks for the link!
 

ZodiacUHD

Patron
Joined
Aug 28, 2015
Messages
226
Thank you! I'm running in the "too many redirects" issue... I don't really understand what i have to do in order to fix it, could anyone explain it here? (sorry for the stupid question)
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I'd suggest that both of these issues should be logged as bugs against the plugin. The point of a plugin is that you push the button and it's installed and running. It's (IMO) OK, though not ideal, if there's some well-documented configuration you need to do, but you shouldn't need to go digging at random through the jail and such to get it running.
 

gimbalpooper

Cadet
Joined
Jul 21, 2018
Messages
7
Thank you! I'm running in the "too many redirects" issue... I don't really understand what i have to do in order to fix it, could anyone explain it here? (sorry for the stupid question)

To fix the redirect issue, I just edited the config.php file (can't remember the exact path as I deleted the plugin and installed NC in a jail myself as I wanted it configured differently), but think it was something like /usr/local/www/nextcloud/config/config.php). The app_paths, as described in the link above, need to be added to the $CONFIG array, as the plugin installs NC from the FreeBSD package which requires the additional config. So this is what you'd add:

Code:
'apps_paths' =>
  array (
   0 =>
   array (
	 'path' => '/usr/local/www/nextcloud/apps',
	 'url' => '/apps',
	 'writable' => true,
   ),
   1 =>
   array (
	 'path' => '/usr/local/www/nextcloud/apps-pkg',
	 'url' => '/apps-pkg',
	 'writable' => false,
   ),
  ),


However, that's not the 'correct' way to do it - normally to avoid messing up your installation, you're supposed to edit the config using the occ commands, but I couldn't be bothered with that as was only a test install.

danb35 is right - this is really is something you'd expect the plugin installation to automate, so it's a bug. I'll try to remember to file it when I've got a moment, unless someone beats me to it.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

don_sangiorgio

Dabbler
Joined
Jul 21, 2018
Messages
11
Thank you! I'm running in the "too many redirects" issue... I don't really understand what i have to do in order to fix it, could anyone explain it here? (sorry for the stupid question)
If you have used the default location, you can use the following commands to fix it:
cd /usr/local/www/nextcloud
su -m www -c “php ./occ config:import < /usr/local/share/nextcloud/fix-apps_paths.json”
 

drros

Dabbler
Joined
Aug 27, 2018
Messages
10
Still not fixed as for today
 

StoneT

Cadet
Joined
Sep 20, 2018
Messages
1
To fix the redirect issue, I just edited the config.php file (can't remember the exact path as I deleted the plugin and installed NC in a jail myself as I wanted it configured differently), but think it was something like /usr/local/www/nextcloud/config/config.php). The app_paths, as described in the link above, need to be added to the $CONFIG array, as the plugin installs NC from the FreeBSD package which requires the additional config. So this is what you'd add:

Code:
'apps_paths' =>
  array (
   0 =>
   array (
	 'path' => '/usr/local/www/nextcloud/apps',
	 'url' => '/apps',
	 'writable' => true,
   ),
   1 =>
   array (
	 'path' => '/usr/local/www/nextcloud/apps-pkg',
	 'url' => '/apps-pkg',
	 'writable' => false,
   ),
  ),


However, that's not the 'correct' way to do it - normally to avoid messing up your installation, you're supposed to edit the config using the occ commands, but I couldn't be bothered with that as was only a test install.

danb35 is right - this is really is something you'd expect the plugin installation to automate, so it's a bug. I'll try to remember to file it when I've got a moment, unless someone beats me to it.

can you decribe how do you manage to install NC in a jail? or point me to a install procedure?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Joined
Dec 11, 2018
Messages
8
This problem persists in the official plugin for Nextcloud 15 on FreeNAS 11.2. Additionally it seems not to set up SSL anymore as part of the plugin.
 
Top