Support intro
Remove apps at docker compose up with occ and hook folders
Nextcloud version: nextcloud:latest
Operating system and version: RHEL 8 x64
Apache or nginx version: nginx:latest
PHP version: 8.2.23
The issue you are facing:
None of the hooks I am attempting to use are working
Is this the first time you’ve seen this error? : Y
Steps to replicate it:
- docker compose up
- proper folder structure and shell file in the right locations
- watch logs
The output of your Nextcloud log in Admin > Logging:
[PHP] Error: fopen(/var/www/html/config/config.php): Failed to open stream: No such file or directory at /var/www/html/lib/private/Config.php#221
from ? by -- at Sep 15, 2024, 10:34:03 AM
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'htaccess.RewriteBase' => '/',
'memcache.local' => '\\OC\\Memcache\\APCu',
'apps_paths' =>
array (
0 =>
array (
'path' => '/var/www/html/apps',
'url' => '/apps',
'writable' => false,
),
1 =>
array (
'path' => '/var/www/html/custom_apps',
'url' => '/custom_apps',
'writable' => true,
),
),
'overwritewebroot' => '/nextcloud',
'upgrade.disable-web' => true,
'passwordsalt' => 'iW8qXpp4aFJ0+r/7E2zU2mddhatcnx',
'secret' => 'Kt5vFL9Vg0dXAcrPQqWAgrhpDHEA56pbTWKgUu4YJ1CylR4B',
'trusted_domains' =>
array (
0 => 'localhost',
1 => 'www.example.net',
),
'datadirectory' => '/var/www/html/data',
'dbtype' => 'mysql',
'version' => '29.0.6.1',
'overwrite.cli.url' => 'http://localhost/nextcloud',
'dbname' => 'nextcloud_data',
'dbhost' => 'mariadb',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextcloud_dbuser',
'dbpassword' => 'mysql_password',
'installed' => true,
'instanceid' => 'occgqbthroo7',
);
The output of your Apache/nginx/system log in /var/log/____
:
2024/09/15 15:35:08 [warn] 29#29: *5 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/1/00/0000000001 while reading upstream, client: 99.99.99.99, server: www.example.net, request: "GET /portainer/main.33e0a59057a6399dbb8d.css HTTP/1.1", upstream: "https://192.168.16.3:9443/main.33e0a59057a6399dbb8d.css", host: "www.example.net", referrer: "https://www.example.net/portainer/"
2024/09/15 15:35:08 [warn] 29#29: *6 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/2/00/0000000002 while reading upstream, client: 99.99.99.99, server: www.example.net, request: "GET /portainer/vendor.9b54dbb269b29babe8e2.js HTTP/1.1", upstream: "https://192.168.16.3:9443/vendor.9b54dbb269b29babe8e2.js", host: "www.example.net", referrer: "https://www.example.net/portainer/"
2024/09/15 15:35:08 [warn] 29#29: *7 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/3/00/0000000003 while reading upstream, client: 99.99.99.99, server: www.example.net, request: "GET /portainer/main.f2b632d7a448eaa5d9e6.js HTTP/1.1", upstream: "https://192.168.16.3:9443/main.f2b632d7a448eaa5d9e6.js", host: "www.example.net", referrer: "https://www.example.net/portainer/"
2024/09/15 15:35:09 [error] 29#29: *7 open() "/etc/nginx/html/locales/en-US/translation.json" failed (2: No such file or directory), client: 99.99.99.99, server: www.example.net, request: "GET /locales/en-US/translation.json HTTP/1.1", host: "www.example.net", referrer: "https://www.example.net/portainer/"
2024/09/15 15:35:09 [error] 29#29: *6 open() "/etc/nginx/html/locales/en/translation.json" failed (2: No such file or directory), client: 99.99.99.99, server: www.example.net, request: "GET /locales/en/translation.json HTTP/1.1", host: "www.example.net", referrer: "https://www.example.net/portainer/"
2024/09/15 15:35:59 [error] 29#29: *1 open() "/etc/nginx/html/locales/en/translation.json" failed (2: No such file or directory), client: 99.99.99.99, server: www.example.net, request: "GET /locales/en/translation.json HTTP/1.1", host: "www.example.net", referrer: "https://www.example.net/portainer/"
2024/09/15 15:35:59 [error] 29#29: *7 open() "/etc/nginx/html/locales/en-US/translation.json" failed (2: No such file or directory), client: 99.99.99.99, server: www.example.net, request: "GET /locales/en-US/translation.json HTTP/1.1", host: "www.example.net", referrer: "https://www.example.net/portainer/"
2024/09/15 15:38:30 [warn] 29#29: *50 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/4/00/0000000004 while reading upstream, client: 99.99.99.99, server: www.example.net, request: "GET /portainer/api/motd HTTP/1.1", upstream: "https://192.168.16.3:9443/api/motd", host: "www.example.net", referrer: "https://www.example.net/portainer/"
2024/09/15 15:39:47 [warn] 29#29: *53 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/5/00/0000000005 while reading upstream, client: 99.99.99.99, server: www.example.net, request: "GET /nextcloud/apps/firstrunwizard/img/Nextcloud.webm HTTP/1.1", upstream: "http://192.168.16.5:80/apps/firstrunwizard/img/Nextcloud.webm", host: "www.example.net"
2024/09/15 15:39:59 [warn] 29#29: *49 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/6/00/0000000006 while reading upstream, client: 99.99.99.99, server: www.example.net, request: "GET /nextcloud/settings/apps/list HTTP/1.1", upstream: "http://192.168.16.5:80/settings/apps/list", host: "www.example.net"
2024/09/15 15:40:00 [warn] 29#29: *53 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/7/00/0000000007 while reading upstream, client: 99.99.99.99, server: www.example.net, request: "GET /nextcloud/settings/apps/list HTTP/1.1", upstream: "http://192.168.16.5:80/settings/apps/list", host: "www.example.net"
2024/09/15 15:59:21 [warn] 29#29: *314 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/8/00/0000000008 while reading upstream, client: 99.99.99.99, server: www.example.net, request: "GET /nextcloud/apps/logreader/js/logreader-main.mjs?v=75be6180-0 HTTP/1.1", upstream: "http://192.168.16.5:80/apps/logreader/js/logreader-main.mjs?v=75be6180-0", host: "www.example.net"
2024/09/15 16:01:08 [warn] 29#29: *429 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/9/00/0000000009 while reading upstream, client: 99.99.99.99, server: www.example.net, request: "GET /portainer/main.33e0a59057a6399dbb8d.css HTTP/1.1", upstream: "https://192.168.16.3:9443/main.33e0a59057a6399dbb8d.css", host: "www.example.net", referrer: "https://www.example.net/portainer/"
2024/09/15 16:01:09 [error] 29#29: *426 open() "/etc/nginx/html/locales/en/translation.json" failed (2: No such file or directory), client: 99.99.99.99, server: www.example.net, request: "GET /locales/en/translation.json HTTP/1.1", host: "www.example.net", referrer: "https://www.example.net/portainer/"
2024/09/15 16:01:09 [error] 29#29: *429 open() "/etc/nginx/html/locales/en-US/translation.json" failed (2: No such file or directory), client: 99.99.99.99, server: www.example.net, request: "GET /locales/en-US/translation.json HTTP/1.1", host: "www.example.net", referrer: "https://www.example.net/portainer/"
Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.
{"reqId":"S7p7DNDwTcyApkeU6hLu","level":3,"time":"2024-09-15T15:34:03+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"/nextcloud/occ","message":"fopen(/var/www/html/config/config.php): Failed to open stream: No such file or directory at /var/www/html/lib/private/Config.php#221","userAgent":"--","version":"29.0.6.1","data":{"app":"PHP"}}
I have no idea what I’m doing yet so I have two folder in my docker project folder;
-example.net
–app-hooks
—before-starting
—post-installation
–kc
–nginx
–sociallogin
Here is the removeapps.sh file
./occ app:disable activity
./occ app:disable bruteforcesettings
./occ app:disable circles
./occ app:disable cloud_federation_api
./occ app:disable comments
./occ app:disable contactsinteraction
./occ app:disable dashboard
./occ app:disable dav
./occ app:disable encryption
./occ app:disable federatedfilesharing
./occ app:disable federation
./occ app:disable files_downloadlimit
./occ app:disable files_reminders
./occ app:disable files_sharing
./occ app:disable files_trashbin
./occ app:disable files_versions
./occ app:disable firstrunwizard
./occ app:disable lookup_server_connector
./occ app:disable nextcloud_announcements
./occ app:disable notifications
./occ app:disable oauth2
./occ app:disable privacy
./occ app:disable recommendations
./occ app:disable related_resources
./occ app:disable sharebymail
./occ app:disable support
./occ app:disable survey_client
./occ app:disable suspicious_login
./occ app:disable systemtags
./occ app:disable twofactor_backupcodes
./occ app:disable twofactor_totp
./occ app:disable updatenotification
./occ app:disable user_ldap
./occ app:disable user_status
./occ app:disable viewer
./occ app:disable weather_status
./occ app:disable workflowengine
cp -R /tmp/sociallogin /var/www/html/apps/
./occ app:install sociallogin
./occ app:remove activity
./occ app:remove bruteforcesettings
./occ app:remove circles
./occ app:remove cloud_federation_api
./occ app:remove comments
./occ app:remove contactsinteraction
./occ app:remove dashboard
./occ app:remove dav
./occ app:remove encryption
./occ app:remove federatedfilesharing
./occ app:remove federation
./occ app:remove files_downloadlimit
./occ app:remove files_reminders
./occ app:remove files_sharing
./occ app:remove files_trashbin
./occ app:remove files_versions
./occ app:remove firstrunwizard
./occ app:remove lookup_server_connector
./occ app:remove nextcloud_announcements
./occ app:remove notifications
./occ app:remove oauth2
./occ app:remove privacy
./occ app:remove recommendations
./occ app:remove related_resources
./occ app:remove sharebymail
./occ app:remove support
./occ app:remove survey_client
./occ app:remove suspicious_login
./occ app:remove systemtags
./occ app:remove twofactor_backupcodes
./occ app:remove twofactor_totp
./occ app:remove updatenotification
./occ app:remove user_ldap
./occ app:remove user_status
./occ app:remove viewer
./occ app:remove weather_status
./occ app:remove workflowengine
./occ app:enable sociallogin
Here is the nextcloud part of my docker-compose.yml file
nextcloud:
image: nextcloud:latest
container_name: nextcloud
restart: unless-stopped
environment:
MYSQL_PASSWORD: mysql_password
MYSQL_DATABASE: nextcloud_data
MYSQL_USER: nextcloud_dbuser
MYSQL_HOST: mariadb
OVERWRITEWEBROOT: /nextcloud
NEXTCLOUD_ADMIN_USER: admin
NEXTCLOUD_ADMIN_PASSWORD: adminpassword
NEXTCLOUD_HOSTNAME: www.example.net
NEXTCLOUD_TRUSTED_DOMAINS: www.example.net
volumes:
- ./nextcloud:/var/www/html
- ./app-hooks/post-installation:/docker-entrypoint-hooks.d/post-installation
- ./sociallogin:/tmp/sociallogin
depends_on:
- mariadb
networks:
- nextcloud-net
The errors I see at docker compose up
nextcloud | => Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/post-installation
nextcloud | ==> Running the script (cwd: /var/www/html): "/docker-entrypoint-hooks.d/post-installation/removeapps.sh"
nextcloud | No such app enabled: activity
nextcloud | No such app enabled: bruteforcesettings
nextcloud | No such app enabled: circles
nextcloud | No such app enabled: cloud_federation_api
nextcloud | No such app enabled: comments
nextcloud | No such app enabled: contactsinteraction
nextcloud | No such app enabled: dashboard
nextcloud | No such app enabled: dav
nextcloud | No such app enabled: encryption
nextcloud | No such app enabled: federatedfilesharing
nextcloud | No such app enabled: federation
nextcloud | No such app enabled: files_downloadlimit
nextcloud | No such app enabled: files_reminders
nextcloud | No such app enabled: files_sharing
nextcloud | No such app enabled: files_trashbin
nextcloud | No such app enabled: files_versions
nextcloud | No such app enabled: firstrunwizard
nextcloud | No such app enabled: lookup_server_connector
nextcloud | No such app enabled: nextcloud_announcements
nextcloud | No such app enabled: notifications
nextcloud | No such app enabled: oauth2
nextcloud | No such app enabled: privacy
nextcloud | No such app enabled: recommendations
nextcloud | No such app enabled: related_resources
nextcloud | No such app enabled: sharebymail
nextcloud | No such app enabled: support
nextcloud | No such app enabled: survey_client
nextcloud | No such app enabled: suspicious_login
nextcloud | No such app enabled: systemtags
nextcloud | No such app enabled: twofactor_backupcodes
nextcloud | No such app enabled: twofactor_totp
nextcloud | No such app enabled: updatenotification
nextcloud | No such app enabled: user_ldap
nextcloud | No such app enabled: user_status
nextcloud | No such app enabled: viewer
nextcloud | No such app enabled: weather_status
nextcloud | No such app enabled: workflowengine
nextcloud | Error: Could not download app sociallogin
is not installedvity
is not installedeforcesettings
is not installedles
is not installedd_federation_api
is not installedents
is not installedactsinteraction
is not installedboard
is not installed
is not installedyption
is not installedratedfilesharing
is not installedration
is not installeds_downloadlimit
is not installeds_reminders
is not installeds_sharing
is not installeds_trashbin
is not installeds_versions
is not installedtrunwizard
is not installedup_server_connector
is not installedcloud_announcements
is not installedfications
is not installedh2
is not installedacy
is not installedmmendations
is not installedted_resources
is not installedebymail
is not installedort
is not installedey_client
is not installedicious_login
is not installedemtags
is not installedactor_backupcodes
is not installedactor_totp
is not installedtenotification
is not installed_ldap
is not installed_status
is not installeder
is not installedher_status
is not installedflowengine
nextcloud | sociallogin 5.6.6 enabled
nextcloud | ==> Finished the script: "/docker-entrypoint-hooks.d/post-installation/removeapps.sh"
nextcloud | Initializing finished
nextcloud | => Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/before-starting