Use remi source to install php74-php-pecl-redis5, then the nextcloud server cannot be used
Nextcloud.log
reqId : "tHlIej2E4v9Co5HnsmIE"
level : 3
time : "2021-04-26T11:42:18+00:00"
remoteAddr : "x.x.x.x"
user : "--"
app : "index"
method : "GET"
url : "/"
message
Exception : "RedisException"
Message : "No such file or directory"
Code : 0
Trace
0
file : "/apps/nextcloud/lib/private/RedisFactory.php"
line : 92
function : "connect"
class : "Redis"
type : "->"
1
JSON
reqId : "tHlIej2E4v9Co5HnsmIE"
level : 3
time : "2021-04-26T11:42:18+00:00"
remoteAddr : "x.x.x.x"
user : "--"
app : "no app in context"
method : "GET"
url : "/"
message
Exception : "OCP\AppFramework\QueryException"
Message : "Could not resolve trashManager! Class trashManager does not exist"
Code : 0
Nginx.log
x.x.x.x - vincent [26/Apr/2021:11:54:16 +0000] "GET /status.php HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows) mirall/3.2.0stable-Win64 (build 20210409) (Nextcloud, windows-10.0.18363 ClientArchitecture: x86_64 OsArchitecture: x86_64)" "-"
I have to close the php-redis extension to access the nextcloud server normally,How can I solve it?
PHP Version:7.4.16
Nextcloud Version:21.0.1
j-ed
April 26, 2021, 12:08pm
4
Please provide an excerpt of your config.php file which shows how you’ve configured Redis. Additionally please make sure that you’ve installed and activated a separate Redis server on your server to which Nextcloud can connect to.
config.php
<?php
$CONFIG = array (
'instanceid' => 'ocg8f4m9m99v',
'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => '/tmp/redis.sock',
'port' => 0,
'timeout' => 0.0,
),
'passwordsalt' => 'xxxxxxxxxxxxxxxxxxx',
'secret' => 'PfdjCQ/mGnKNGVfzNrpBI7pcOO6ip3rlYKCw4vGNOgCH4TDh',
'trusted_domains' =>
array (
0 => 'www.xxxxxxxxx.com',
),
'datadirectory' => '/apps/nextcloud/data',
'dbtype' => 'mysql',
'version' => '21.0.1.1',
'overwrite.cli.url' => 'https://www.xxxxxxxxx.com',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'oc_vincent',
'dbpassword' => 'xxxxxxxxxxxxxxxxxxx',
'installed' => true,
'mail_smtpmode' => 'smtp',
'mail_sendmailmode' => 'smtp',
'mail_smtpauthtype' => 'LOGIN',
'mail_smtpauth' => 1,
'mail_smtphost' => xxxxxxxxxxxxx',
'mail_smtpport' => '465',
'mail_from_address' => 'xxxxxxxxxx',
'mail_domain' => 'xxxxxxxxx',
'mail_smtpname' => 'xxxxxxxxxx',
'mail_smtppassword' => 'xxxxxxxxxxxxxx',
'mail_smtpsecure' => 'ssl',
);
redis.conf
protected-mode yes
port 0
tcp-backlog 511
unixsocket /tmp/redis.sock
unixsocketperm 770
timeout 0
tcp-keepalive 300
daemonize yes
supervised no
pidfile /var/run/redis_6379.pid
loglevel notice
logfile "/apps/redis/log/redis.log"
databases 16
always-show-logo yes
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir "/tmp"
redis info
redis /tmp/redis.sock> info
# Server
redis_version:5.0.7
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:d921284ccd229517
redis_mode:standalone
os:Linux 4.14.129-bbrplus x86_64
arch_bits:64
multiplexing_api:epoll
atomicvar_api:atomic-builtin
gcc_version:4.8.5
process_id:28502
run_id:6f62a57ac38088874a70126d3e67e7f582b945c2
tcp_port:0
uptime_in_seconds:3014
uptime_in_days:0
hz:10
configured_hz:10
lru_clock:8827590
Good morning Vincent, hope you are doing well…
Please try to set the right Redis configuration inside your config.php
Like the following:
'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => 'localhost',
'port' => 6379,
),
Hope this helps, good luck mate.
Have a nice week!
1 Like
Good morning Beltran, Thank you very much。
I solved the problem according to your method,Do you know why you can’t use sock connection? I saw in the official document that sock can be used
1 Like
That’s nice! Glad I could help.
I don’t actually know how to do that, but I think you need to configure the redis.conf before the nextcloud’s config.php
Follow this: Redis: How to set the path to redis.sock — CARREFAX
Hope that helps too, have a nice day fella.
Good work!
1 Like
Yes, I changed redis to sock connection, and then also changed config.php to sock connection, but it didn’t work, I provided redis.conf above.
Thank you very much anyway!
have a nice weekend!
1 Like
j-ed
April 26, 2021, 1:27pm
11
Ok, to be able to establish a Redis socket connection you have to make sure that the user under which your web server is running, is allowed to access the Redis socket /tmp/redis.sock
. First you should check the ownership and access rights of the socket file (ls -al /tmp/redis.sock
). Depending on the result, it might be necessary to add e.g. the web server user to the redis group and/or to adjust the Redis socket permissions (e.g. unixsocketperm 0770).
Thank you j-ed.
I added the Nginx user to the redis group, and the redis sock permission is 770, but this still cannot be used normally. Finally, I modified to TCP connection to solve the problem
I will redeploy on another machine and try to connect with sock again
1 Like