You are not logged in.

#101 2021-03-25 09:16:40

sweetthdevil
Member
Registered: 2009-10-20
Posts: 396

Re: Nextcloud 21.0.0.2-21.0.0.9 sevral issues, index in first post

Right,

Looking into it last night I realised NC is complaining on the admin page of the following:

No Memory cache - Redis is installed, service started and installed as per the wiki (see below config.php)

<?php
$CONFIG = array (
  'debug' => true,
  'config_is_read_only' => true,
  'datadirectory' => '/mnt/hd/nextcloud',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/usr/share/webapps/nextcloud/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/lib/nextcloud/apps',
      'url' => '/wapps',
      'writable' => true,
    ),
   'memcache.local' => '\OC\Memcache\Redis',
   'filelocking.enabled' => 'true',
   'memcache.locking' => '\OC\Memcache\Redis',
   'redis' => array(
        'host' => 'localhost',
        'port' => 6379,
        'timeout' => 0.0,
         )
  ),
  'passwordsalt' => '*******',
  'secret' => '*******',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '192.168.1.*',
    2 => '*******.duckdns.org',
  ),
  'dbtype' => 'mysql',
  'version' => '21.0.0.18',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '*******',
  'installed' => true,
  'instanceid' => '*******',
);

Also, went through this topic to have a look at the right issue mentioned above. When setting all user rights and owbership as per #82 NC doesn't want to start complaining it doesn't have access to config, then apps etc. I must set all to http to gain access to nc.

Edit: Looking at the wiki - I did not install uwsgi as NC is the only one website/PHP that I am running and didn't see the point. However, I can see that in its ini there is the user/uui set for nextcloud user? Would the permission issue come from there?

Last edited by sweetthdevil (2021-03-26 09:14:38)

Offline

#102 2021-03-29 16:10:32

synt4x
Member
Registered: 2010-11-30
Posts: 8

Re: Nextcloud 21.0.0.2-21.0.0.9 sevral issues, index in first post

Anyone using Nextcloud with Lighttpd and got it working with this new setup? The wiki page for Nextcloud has seemingly not had any updates for the Lighttpd section yet, and I'm struggling trying to figure out how to configure it to use multiple php-fpm pools. I'd need it to use the nextcloud pool specifically for the /nc subdir of the http root, and the normal one for everything else. I've tried this but it just leads to an empty page saying "File not found":

fastcgi.server = (
        "/nc/" =>
        ((
           "socket" => "/run/nextcloud/nextcloud.sock",
           "broken-scriptfilename" => "enable"
        )),
        ".php" =>
        ((
           "socket" => "/run/php-fpm/php-fpm.sock",
           "broken-scriptfilename" => "enable"
        ))
)

I've configured the php-fpm pool and nextcloud's config.php like the wiki says. Removing that "/nc" part of the config and setting the usual directory permissions back to "http:http" makes things work just fine as it always has, but I wanted my install to be compliant with the package going forward. Any help would be very appreciated.

Offline

#103 2021-03-30 07:12:10

str0gg
Member
Registered: 2012-12-01
Posts: 53
Website

Re: Nextcloud 21.0.0.2-21.0.0.9 sevral issues, index in first post

@sweetthdevil
have you adjust php-pfm service ReadWritePaths?

Offline

#104 2021-03-30 07:14:17

sweetthdevil
Member
Registered: 2009-10-20
Posts: 396

Re: Nextcloud 21.0.0.2-21.0.0.9 sevral issues, index in first post

Hi str0gg,

Thank you for your reply. I am pretty sure I did.

But to be honest, I gave up for the time being. I will wait when all those issues have been sorted and see then.

Offline

#105 2021-03-30 09:52:10

str0gg
Member
Registered: 2012-12-01
Posts: 53
Website

Re: Nextcloud 21.0.0.2-21.0.0.9 sevral issues, index in first post

sweetthdevil wrote:

Hi str0gg,

Thank you for your reply. I am pretty sure I did.

But to be honest, I gave up for the time being. I will wait when all those issues have been sorted and see then.

No wander, however if you change your mind you might try to enabled follow symlinks  in http server and/or make more ReadWritePaths more relaxed (/usr/share/webapps/nextcloud)

Offline

#106 2021-03-30 10:01:36

sweetthdevil
Member
Registered: 2009-10-20
Posts: 396

Re: Nextcloud 21.0.0.2-21.0.0.9 sevral issues, index in first post

Thank you, I will wait till the wiki has been updated, the permission has been fixed and also that face recognition app is working with v21.

Offline

#107 2021-03-31 15:16:33

synt4x
Member
Registered: 2010-11-30
Posts: 8

Re: Nextcloud 21.0.0.2-21.0.0.9 sevral issues, index in first post

synt4x wrote:

Anyone using Nextcloud with Lighttpd and got it working with this new setup? The wiki page for Nextcloud has seemingly not had any updates for the Lighttpd section yet, and I'm struggling trying to figure out how to configure it to use multiple php-fpm pools. I'd need it to use the nextcloud pool specifically for the /nc subdir of the http root, and the normal one for everything else. I've tried this but it just leads to an empty page saying "File not found":

fastcgi.server = (
        "/nc/" =>
        ((
           "socket" => "/run/nextcloud/nextcloud.sock",
           "broken-scriptfilename" => "enable"
        )),
        ".php" =>
        ((
           "socket" => "/run/php-fpm/php-fpm.sock",
           "broken-scriptfilename" => "enable"
        ))
)

I've configured the php-fpm pool and nextcloud's config.php like the wiki says. Removing that "/nc" part of the config and setting the usual directory permissions back to "http:http" makes things work just fine as it always has, but I wanted my install to be compliant with the package going forward. Any help would be very appreciated.

After a bit of a deeper look at this, I've ended up with this in the lighttpd config which seems to be a more proper way of doing it (?):

$HTTP["url"] =~ "^/nc" {
    fastcgi.server = (
        ".php" => (
            "nextcloud" => (
                "socket" => "/run/nextcloud/nextcloud.sock",
                "broken-scriptfilename" => "enable"
            )
        )
    )
} else {
    fastcgi.server = (
        ".php" => (
            "localhost" =>  (
                "socket" => "/run/php-fpm/php-fpm.sock",
                "broken-scriptfilename" => "enable"
            )
        )
    )
}

This still gave me the "File not found" error on the /nc/ url path, but after enabling fastcgi.debug and adding "access.log = /var/log/$pool.access.log" to the nextcloud php-fpm config, I got some errors I could google. This allowed me to realize that it's caused by wrong permissions. I then tried changing ownership of some files to be owned by nextcloud again, and then the error changed from "File not found" to a more normal 403 error. Progress!

Now to figure out the correct permissions of everything...

Offline

#108 2021-04-06 23:49:27

synt4x
Member
Registered: 2010-11-30
Posts: 8

Re: Nextcloud 21.0.0.2-21.0.0.9 sevral issues, index in first post

Another update from me. I've been somewhat successful at running nextcloud using php-fpm and lighttpd as the actual nextcloud user now. I used my above fastcgi.server lighttpd config as before.

I've been using that old script that's been going around to set nc permissions for a long time. But originally it had file permissions set to 0640 and directory permissions set to 0750. Setting them to 0644 and 0755 respectively made me go from a 403 error to an internal server error instead. Here's the script with the new permissions:

#!/bin/bash
ncpath='/usr/share/webapps/nextcloud'
htuser='nextcloud'
htgroup='nextcloud'
rootuser='root'

printf "Creating possible missing Directories\n"
mkdir -p $ncpath/data
mkdir -p $ncpath/assets

printf "chmod Files and Directories\n"
find ${ncpath}/ -type f -print0 | xargs -0 chmod 0644
find ${ncpath}/ -type d -print0 | xargs -0 chmod 0755

printf "chown Directories\n"
chown -R ${rootuser}:${htgroup} ${ncpath}/
chown -R ${htuser}:${htgroup} ${ncpath}/apps/
chown -R ${htuser}:${htgroup} ${ncpath}/config/
chown -R ${htuser}:${htgroup} ${ncpath}/data/
chown -R ${htuser}:${htgroup} ${ncpath}/themes/
chown -R ${htuser}:${htgroup} ${ncpath}/assets/

chmod +x ${ncpath}/occ

printf "chmod/chown .htaccess\n"
if [ -f ${ncpath}/.htaccess ]
 then
  chmod 0644 ${ncpath}/.htaccess
  chown ${rootuser}:${htgroup} ${ncpath}/.htaccess
fi
if [ -f ${ncpath}/data/.htaccess ]
 then
  chmod 0644 ${ncpath}/data/.htaccess
  chown ${rootuser}:${htgroup} ${ncpath}/data/.htaccess
fi

I also chowned my data directory recursively to nextcloud:nextcloud.

After inspecting the logs I noticed that Nextcloud complained about not having permissions for Redis. So I added the nextcloud user to the redis group, then restarted the lighttpd, php-fpm, and redis services. Once that was done the Nextcloud home/login page showed up again!

But, I cannot actually login. After entering the details it just takes me back to the login screen again. Looking at the nextcloud logfile there are a bunch of these kinds of exceptions:

{"reqId":"xz9o7V1piSrDMTKtuD1o","level":3,"time":"April 06, 2021 23:37:41","remoteAddr":"192.168.0.3","user":"--","app":"PHP","method":"GET","url":"/nc/index.php/svg/core/categories/workflow?color=f2f2f2&v=1","message":{"Exception":"Error","Message":"session_regenerate_id(): Session ID cannot be regenerated when there is no active session at /usr/share/webapps/nextcloud/lib/private/Session/Internal.php#137","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[2,"session_regenerate_id(): Session ID cannot be regenerated when there is no active session","/usr/share/webapps/nextcloud/lib/private/Session/Internal.php",137]},{"file":"/usr/share/webapps/nextcloud/lib/private/Session/Internal.php","line":137,"function":"session_regenerate_id","args":[true]},{"file":"/usr/share/webapps/nextcloud/lib/private/Session/CryptoSessionData.php","line":161,"function":"regenerateId","class":"OC\\Session\\Internal","type":"->","args":[true,false]},{"file":"/usr/share/webapps/nextcloud/lib/private/Session/CryptoSessionData.php","line":90,"function":"regenerateId","class":"OC\\Session\\CryptoSessionData","type":"->","args":[true,false]},{"file":"/usr/share/webapps/nextcloud/lib/private/Session/CryptoSessionData.php","line":66,"function":"initializeSession","class":"OC\\Session\\CryptoSessionData","type":"->","args":[]},{"file":"/usr/share/webapps/nextcloud/lib/private/Session/CryptoWrapper.php","line":113,"function":"__construct","class":"OC\\Session\\CryptoSessionData","type":"->","args":[{"__class__":"OC\\Session\\Internal"},{"__class__":"OC\\Security\\Crypto"},"ZLU7mCRQQzEZCxg7saIn10kKRHjWEtpPsgXPeww3p1w7MpICgI7tBvncDAcMVxLiU4o9KSs41xeXWGR9495M1qhKxgW58N/Pm2NyckMsUqIlFEul2UCbWWGVzHsHnQoU"]},{"file":"/usr/share/webapps/nextcloud/lib/base.php","line":420,"function":"wrapSession","class":"OC\\Session\\CryptoWrapper","type":"->","args":[{"__class__":"OC\\Session\\Internal"}]},{"file":"/usr/share/webapps/nextcloud/lib/base.php","line":639,"function":"initSession","class":"OC","type":"::","args":[]},{"file":"/usr/share/webapps/nextcloud/lib/base.php","line":1076,"function":"init","class":"OC","type":"::","args":[]},{"file":"/usr/share/webapps/nextcloud/index.php","line":35,"args":["/usr/share/webapps/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/usr/share/webapps/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4449.0 Safari/537.36 Edg/91.0.838.3","version":"21.0.0.18"}

Oddly however, my nextcloud desktop client was able to automatically log back in and start syncing like normal again. And same with the nextcloud app on my phone.
I'm using the TOTP app for my user, could that be the issue? On the desktop client/mobile app I'm using a login token so they will bypass the TOTP app.

Edit: I disabled the twofactor_totp app using occ and it still won't let me log in using the web interface.

Last edited by synt4x (2021-04-07 00:05:36)

Offline

#109 2021-04-10 10:30:23

doragasu
Member
Registered: 2012-03-03
Posts: 144

Re: Nextcloud 21.0.0.2-21.0.0.9 sevral issues, index in first post

str0gg wrote:
doragasu wrote:

@ElectricPrism: Great step by step explanation, thanks!

One question, are you using the TOTP plugin? Is it working for you? I also got my setup working with PHP8, but trying to enable the TOTP plugin fails.

I've spoken with totp plugin developer, check if you have secret in config.php

2FA is working for me :-)

I had no 'secret' and also no 'passwordsalt'. Added them from my old config and now TOTP works!!! Thanks!!! BTW, is passwordsalt also needed?

Offline

#110 Yesterday 22:52:13

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,139

Re: Nextcloud 21.0.0.2-21.0.0.9 sevral issues, index in first post

As of today, what is the recommendation about which user to run nextcloud in? The wiki mentions user nextcloud for v21 and also mentions that the php-fpm should have an additional pool for nextcloud but then in the TroubleShooting section for Environment variables not available indicates that the env[PATH] needs to be updated in the www.conf file. So all in all, the wiki page is in a lot of flux.

when I upgraded today from 20.0.7 to 21, it created apps and data folder for me under /var/lib/nextcloud and also chowned the /etc/webapps/nextcloud/config folder to the user nextcloud. But I had to change ownership back to http just to be able to access Nextcloud. So my permissions are all over the place with folders being present but not used and such.

Do we have an agreed upon approach to move from version v20 to v21?

thanks.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

Board footer

Powered by FluxBB