Project

General

Profile

Bug #34162

Fix Nextcloud iocage plugin

Added by TIm Walter over 2 years ago. Updated almost 2 years ago.

Status:
Done
Priority:
No priority
Assignee:
Martin Wilke
Category:
OS
Target version:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

In the new GUI with FreeNAS-11.2-MASTER-201805270440 if I go to the plugins list and install Nextcloud all seems to go OK. When I go to the manage option of the jail it declares the apps folder doesn't have the correct permissions. If I then correct that (chmod 777) I get the normal Nextcloud config (admin login and password) screen and DBase settings but nothing there completes

I've tried separately with danb35's scripted install but that fails

Maybe unrelated but I also tried to install dokuwiki via their instructions for freeBSD and that fails too. (https://www.dokuwiki.org/install:freebsd)


Related issues

Related to FreeNAS - Feature #39573: Update iocage Plugins for BETA3Done
Related to FreeNAS - Feature #44856: Update iocage Plugins for RC1Done
Related to FreeNAS - Feature #53790: Update iocage Plugins for 11.2-RC2Done
Has duplicate FreeNAS - Bug #45699: Nextcloud - finishing installation failsClosed
Has duplicate FreeNAS - Bug #46040: Nextcloud - libpcre not foundClosed
Has duplicate FreeNAS - Bug #50995: Failed to start nextcloud, jail was upClosed
Has duplicate FreeNAS - Bug #53865: FreeNAS 11.2-RC1 bug with Nextcloud plugin post installation accessClosed
Has duplicate FreeNAS - Bug #54042: Nextcloud plugin not workClosed

History

#1 Updated by TIm Walter over 2 years ago

Error
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)

#2 Updated by Dru Lavigne over 2 years ago

  • Private changed from No to Yes
  • Seen in changed from 11.2-RC2 to Master - FreeNAS Nightlies
  • Reason for Blocked set to Need additional information from Author

Tim: please reproduce the error then create a debug (System -> Advanced -> Save Debug) and attach it to this ticket.

#3 Updated by TIm Walter over 2 years ago

  • File debug.tar added

Dru Lavigne wrote:

Tim: please reproduce the error then create a debug (System -> Advanced -> Save Debug) and attach it to this ticket.

Hi Dru,
Actions

New GUI
Plugins
Nextcloud, Install with DHCP

Then Installed, Nextcloud, Management

Cannot write into "apps" directory
This can usually be fixed by giving the webserver write access to the apps directory or disabling the appstore in the config file. See https://docs.nextcloud.com/server/13/go.php?to=admin-dir_permissions

To Nextcloud jail Shell and cd /usr/local/www/nextcloud
chmod 777 apps

Now Nextcloud goes to the initial login screen, but can't find a way to register an admin role

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: NO)

Immediately saved debug, attached

BW Tim

#4 Updated by Dru Lavigne over 2 years ago

  • Category changed from GUI (new) to OS
  • Assignee changed from Release Council to Alexander Motin

Sasha: passing to your team first as the logs are full of:

May 29 00:01:00 freenas syslog-ng1939: Error opening file for writing; filename='/dev/console', error='Device not configured (6)'

#5 Updated by Alexander Motin over 2 years ago

  • Assignee changed from Alexander Motin to Benno Rice

Somehow the system ended up without any configured console:

kern.console: /ucom,ttyv0,

Benno, could you take a look, since you've touched consoles a bit recently.

#6 Updated by Dru Lavigne over 2 years ago

  • Assignee changed from Benno Rice to Alexander Motin

#7 Updated by Alexander Motin over 2 years ago

  • Category changed from OS to Middleware

My guess about the console device problem is that system may be configured/reportes as headless by ACPI BIOS, that demotes VGA use as console, while there is no other configured. I'd ask to check BIOS settings, and if there is no such option, attach `acpidump -t` output, at least "FACP" section, to confirm the guessed cause. Just yesterday patch to manually ignore that was committed to FreeBSD head (r335629). If there is no way to fix that from BIOS side, may be we could back-port it.

#8 Updated by Alexander Motin over 2 years ago

  • Assignee changed from Alexander Motin to Martin Wilke

Hi Martin, Dru told me you could take a look on the plugin side of the ticket.

#9 Updated by Martin Wilke over 2 years ago

  • Status changed from Unscreened to In Progress

#10 Updated by Dru Lavigne over 2 years ago

  • Reason for Blocked deleted (Need additional information from Author)

#11 Updated by Martin Wilke over 2 years ago

Quick update here,

i have fixed the db issue and enhance the setup, also switch to a newer php version, but after 1 1/2 days trying i cant figure out why after the first login I getting an error with to many redirects, the thing is it do not matter if its apache with mod_php or nginx with php-fpm, both leads to the same problem. I've tested it with php5.6 and 7.1.

The latest code can be found here https://github.com/miwi-fbsd/iocage-plugin-nextcloud

#12 Updated by Dru Lavigne about 2 years ago

  • Target version changed from Backlog to 11.2-BETA3

#13 Updated by Dru Lavigne about 2 years ago

  • Category changed from Middleware to OS

#14 Updated by Dru Lavigne about 2 years ago

  • Target version changed from 11.2-BETA3 to 11.2-RC1

#15 Updated by TIm Walter about 2 years ago

Just to update I too am getting the same error of redirect errors having successfully installed on FN11.2-Beta2 (fresh install)

#16 Updated by Dru Lavigne about 2 years ago

#17 Updated by Dru Lavigne about 2 years ago

  • File deleted (debug.tar)

#18 Updated by Dru Lavigne about 2 years ago

  • Status changed from In Progress to Blocked
  • Private changed from Yes to No
  • Reason for Blocked set to Need verification

Tim: this should be fixed for BETA3, due out on Monday. Please leave a comment on this ticket once you get a chance to update to let us know whether or not the issue is resolved.

#20 Updated by TIm Walter about 2 years ago

Hi Just got 11.2-beta3. :-)

On first install of Nextcloud plugin if I change off DHCP and install it immediately fails with "List index out of range"

Just trying with DHCP and will let you know

#21 Updated by TIm Walter about 2 years ago

  • File debug.tar added

Sorry no. Just get getting the same redirect loop as before :-(

#22 Updated by Nikolai Udwari about 2 years ago

Sorry for creating a duplicate, I just saw this ticket now...

Following worked for me (with DHCP disabled):
https://redmine.ixsystems.com/issues/45699

#23 Updated by TIm Walter about 2 years ago

I can't even install without DHCP but will try that link now

#24 Updated by TIm Walter about 2 years ago

I am not an expert but tried that link and it failed...

For me the fix_app_paths.json file was empty before but I pasted it in anyway...

When I got o the final step I get this

root@nextcloud:/usr/local/www/nextcloud # su -m www -c "php ./occ config:import< /usr/local/share/nextcloud/fix-apps_paths.json" 
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20160303/curl.so' - Shared object "libnghttp2.so.14" not found, required by "libcurl.so.4" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20160303/gd.so' - Shared object "libfontconfig.so.1" not found, required by "libgd.so.6" in Unknown on line 0
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
PHP module GD not installed.
Please ask your server administrator to install the module.

PHP module cURL not installed.
Please ask your server administrator to install the module.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /usr/local/www/nextcloud/lib/private/Console/Application.php:148
Stack trace:
#0 /usr/local/www/nextcloud/console.php(89): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/nextcloud/occ(11): require_once('/usr/local/www/...')
#2 {main}root@nextcloud:/usr/local/www/nextcloud #

Happy to go further to help but beyond my own personal bleeding edge!!! without a bit of direction. HTH Tim

#25 Updated by Nikolai Udwari about 2 years ago

You have to create "fix-apps_paths.json" and paste the contents into it.

Make sure that there is a space between "import" and "<" as well as "/usr..."

su -m www -c "php ./occ config:import < /usr/local/share/nextcloud/fix-apps_paths.json" 

#26 Updated by TIm Walter about 2 years ago

Still no joy, this is what I am doing

Install Plugin with DHCP (because it doens't allow otherwise!)

Complete initial screen from management link in installed plugins

Goes to redirect error page as expected (at this stage)

Open Jail shell

chown -R www:www /usr/local/
ee /usr/local/www/nextcloud/fix-apps_paths.json

copy and paste (correcting formatting) so I end up with

{"system": {"apps_paths":
    [
        {
            "path": "\/usr\/local\/www\/nextcloud\/apps",
            "url": "\/apps",
            "writable": true
        },
        {
            "path": "\/usr\/local\/www\/nextcloud\/apps-pkg",
            "url": "\/apps-pkg",
            "writable": false
        }
    ]
}}

cd /usr/local/www/nextcloud

su -m www -c "php ./occ config:import < /usr/local/share/nextcloud/fix-apps_paths.json" 

The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
Config successfully imported from:

Restart Nextcloud, same redirect error. Sorry

#27 Updated by Dru Lavigne about 2 years ago

  • Status changed from Blocked to Unscreened
  • Reason for Blocked deleted (Need verification)

#28 Updated by Dru Lavigne about 2 years ago

  • Related to Bug #45699: Nextcloud - finishing installation fails added

#29 Updated by Dru Lavigne about 2 years ago

  • Related to deleted (Bug #45699: Nextcloud - finishing installation fails)

#30 Updated by Dru Lavigne about 2 years ago

  • Has duplicate Bug #45699: Nextcloud - finishing installation fails added

#31 Updated by Dru Lavigne about 2 years ago

  • Has duplicate Bug #46040: Nextcloud - libpcre not found added

#32 Updated by Dru Lavigne about 2 years ago

  • Status changed from Unscreened to In Progress
  • Private changed from No to Yes

#33 Updated by Dru Lavigne about 2 years ago

  • Has duplicate Bug #50995: Failed to start nextcloud, jail was up added

#34 Updated by Dru Lavigne about 2 years ago

  • Target version changed from 11.2-RC1 to 11.2-RC2

#35 Updated by Dru Lavigne about 2 years ago

#36 Updated by Dru Lavigne about 2 years ago

  • File deleted (debug.tar)

#37 Updated by Dru Lavigne about 2 years ago

  • Subject changed from Nextcloud iocage plugin fails to Fix Nextcloud iocage plugin
  • Private changed from Yes to No

#38 Updated by Dru Lavigne almost 2 years ago

#39 Updated by Dru Lavigne almost 2 years ago

  • Has duplicate Bug #53865: FreeNAS 11.2-RC1 bug with Nextcloud plugin post installation access added

#40 Updated by Dru Lavigne almost 2 years ago

  • Has duplicate Bug #54042: Nextcloud plugin not work added

#41 Updated by Dru Lavigne almost 2 years ago

  • Related to Bug #52689: Allow Plex to browse outside of its home directory added

#42 Updated by Dru Lavigne almost 2 years ago

  • Status changed from In Progress to Not Started
  • Target version changed from 11.2-RC2 to Backlog

#44 Updated by Martin Wilke almost 2 years ago

  • Status changed from Not Started to Ready for Testing

#46 Updated by Dru Lavigne almost 2 years ago

  • Status changed from Ready for Testing to In Progress

#47 Updated by Dru Lavigne almost 2 years ago

  • Target version changed from Backlog to 11.2-RC2

#48 Updated by Dru Lavigne almost 2 years ago

  • Status changed from In Progress to Ready for Testing
  • Needs Merging changed from Yes to No

#49 Updated by Bonnie Follweiler almost 2 years ago

  • Status changed from Ready for Testing to Passed Testing

Test passed in FreeNAS-11.2-INTERNAL39

#50 Updated by Dru Lavigne almost 2 years ago

  • Needs QA changed from Yes to No

#51 Updated by Dru Lavigne almost 2 years ago

  • Status changed from Passed Testing to Done
  • Needs Doc changed from Yes to No

#52 Updated by Dru Lavigne almost 2 years ago

  • Related to deleted (Bug #52689: Allow Plex to browse outside of its home directory)

#53 Updated by Dan Bright almost 2 years ago

Not sure if this is the correct place to report this - apologies if not. Is this plugin supposed to be working on 11.2-RC2 now? It does appear in the plugin list.
I've just attempted to install, but the post install seems to be broken.
The database is not being created with the credentials (as per the files in /root, referenced by post_install.sh); connection fails (both through the GUI set page, and if attempting to connect directly with mysql on the cli).

#54 Updated by Dru Lavigne almost 2 years ago

Dan: go ahead and create a new ticket that contains your debug (System -> Advanced -> Save debug) and we'll investigate.

#55 Updated by Stilez y almost 2 years ago

I just did a clean install of the Nextcloud plugin on 11.2-REL, and hit the "can't authenticate/can't create admin/bad permissions" issue on the Nextcloud wizard, after jail creation.

The correct fix was given in this post: https://forums.freenas.org/index.php?threads/fn-11-2-nextcloud-database.68690/post-471133 -

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").

This should be done as part of the plugin setup, because there's no hint to the user about this, and the user is left to enter stuff and guess why they can't complete its one page setup wizard and use the plugin. If the info is provided as part of the "plugin installation log", that's not really adequate, as it's not clear/explicit and it's not explained what to do if you didn't make a note of them at the time.

After that it seems to now work fine.

#56 Updated by Stilez y almost 2 years ago

Also on startup it had this report. Don't know if any of these matter, but noting them so someone can review

There are some warnings regarding your setup.

PHP does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response. Please check the installation documentation ↗ for PHP configuration notes and the PHP configuration of your server, especially when using php-fpm.
Use of the the built in php mailer is no longer supported. Please update your email server settings ↗.
Accessing site insecurely via HTTP. You are strongly adviced to set up your server to require HTTPS instead, as described in the security tips ↗.
The PHP OPcache is not properly configured. For better performance it is recommended to use the following settings in the php.ini:
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1
The "Referrer-Policy" HTTP header is not set to "no-referrer", "no-referrer-when-downgrade", "strict-origin" or "strict-origin-when-cross-origin". This can leak referer information. See the W3C Recommendation ↗.

Also available in: Atom PDF