Skip to content

Bug: post-restore script 20configure fails on line 39 - Nextcloud database not ready #7988

Closed

Description

@stephdl

Steps to reproduce

  • Restore NethServer backup of nextcloud with collabora enabled
  • System automatically runs the post-restore script (20configure)
  • The restore process tries to configure collabora

Expected behavior

Nextcloud configuration should proceed only when the related database is fully restored and available.

2026-05-02T16:51:43+02:00 [1:nextcloud1:podman] c983b51f6232ba2a4fc3bda9244e9b5fe7dd132a0d51eeb628c405da7e6cf6f3
2026-05-02T16:51:43+02:00 [1:nextcloud1:systemd] Started Podman nextcloud-nginx.service.
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
2026-05-02T16:51:43+02:00 [1:nextcloud1:systemd] Started libcrun container.
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] /docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] /docker-entrypoint.sh: Configuration complete; ready for start up
2026-05-02T16:51:43+02:00 [1:nextcloud1:podman] 3da405884e5dab26eeed839877ec85ac6359074fb6e0a575a045abecb9a3ad79
2026-05-02T16:51:43+02:00 [1:nextcloud1:systemd] Started Podman nextcloud-notify_push.service.
2026-05-02T16:51:43+02:00 [1:nextcloud1:agent@nextcloud1] task/module/nextcloud1/0832fad4-1bc0-4487-ada1-f601ba322852: configure-module/80configure_collabora is starting
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] 2026/05/02 14:51:43 [notice] 1#1: using the "epoll" event method
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] 2026/05/02 14:51:43 [notice] 1#1: nginx/1.29.2
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] 2026/05/02 14:51:43 [notice] 1#1: built by gcc 14.2.0 (Alpine 14.2.0)
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] 2026/05/02 14:51:43 [notice] 1#1: OS: Linux 5.14.0-611.5.1.el9_7.x86_64
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] 2026/05/02 14:51:43 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 524288:524288
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] 2026/05/02 14:51:43 [notice] 1#1: start worker processes
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] 2026/05/02 14:51:43 [notice] 1#1: start worker process 25
2026-05-02T16:51:43+02:00 [1:nextcloud1:nextcloud-nginx] 2026/05/02 14:51:43 [notice] 1#1: start worker process 26
2026-05-02T16:51:45+02:00 [1:nextcloud1:agent@nextcloud1] task/module/nextcloud1/0832fad4-1bc0-4487-ada1-f601ba322852: action "configure-module" status is "aborted" (1) at step 80configure_collabora
2026-05-02T16:51:45+02:00 [1:nextcloud1:agent@nextcloud1] _acontrol_task request recovered successfully at attempt 2
2026-05-02T16:51:45+02:00 [1:nextcloud1:agent@nextcloud1] The configure-module subtask failed!
2026-05-02T16:51:45+02:00 [1:nextcloud1:agent@nextcloud1]   File "/home/nextcloud1/.config/actions/restore-module/20configure", line 39, in <module>
2026-05-02T16:51:45+02:00 [1:nextcloud1:agent@nextcloud1]     agent.assert_exp(configure_retval['exit_code'] == 0, "The configure-module subtask failed!")
2026-05-02T16:51:45+02:00 [1:nextcloud1:agent@nextcloud1] task/module/nextcloud1/4d6338ba-d627-4f05-a7d6-39f564a410ce: action "restore-module" status is "aborted" (2) at step 20configure
2026-05-02T16:52:02+02:00 [1:nextcloud1:nextcloud-db]
2026-05-02T16:52:02+02:00 [1:nextcloud1:nextcloud-db]
2026-05-02T16:52:02+02:00 [1:nextcloud1:nextcloud-db] 2026-05-02 14:52:02+00:00 [Note] [Entrypoint]: Stopping temporary server
2026-05-02T16:52:02+02:00 [1:nextcloud1:nextcloud-db] 2026-05-02 14:52:02 0 [Note] mariadbd (initiated by: unknown): Normal shutdown

see : 2026-05-02T16:52:02+02:00 [1:nextcloud1:nextcloud-db]

Actual behavior

The 20configure script fails on line 39 because it attempts to configure collabora before the completion of database restoration. This leads to an error as some required database resources are not yet present.

Components

  • NethServer 8
  • Module: Collabora + Nextcloud

See also


thank canduccimauro

Activity

  1. self-assigned this
    on May 4, 2026
  2. added theissue type on May 4, 2026
  3. moved this from ToDo to In Progress in NethServeron May 4, 2026
  4. added this to the NethServer 8.9 milestone on May 4, 2026
  5. stephdl commented on May 6, 2026

    @stephdl
    Author

    QA

    Version: nextcloud:1.7.1-dev.4
    Purpose: Restore must not configure Collabora until the Nextcloud DB is ready.

    Steps

    1. Install Nextcloud (nextcloud:1.7.1-dev.4) and finish initial setup.
    2. Install Collabora.
    3. In Nextcloud settings, enable/configure Collabora/Office integration.
    4. Verify it works: upload a .docx/.odt and open/edit it in the browser.
    5. Backup the Nextcloud instance.
    6. Restore that backup onto the same instance (self-restore).
    7. During restore, watch the task/logs: it must wait for DB readiness before running Collabora configuration.

    Pass criteria

    • Restore completes successfully (no abort on restore-module/20configure or configure-module/80configure_collabora).
    • After restore:
      • Nextcloud login works
      • Your files are present
      • Collabora still opens/edits documents from Nextcloud

    Fail criteria (this issue)

    • Restore aborts because Collabora configuration runs too early (DB not ready), like the previous failure at 20configure / 80configure_collabora.
  6. moved this from In Progress to Testing in NethServeron May 6, 2026
  7. removed their assignment
    on May 6, 2026
  8. added
    testing
    on May 6, 2026
  9. gsanchietti commented on May 19, 2026

    @gsanchietti
    Member

    Restore procedure ends with success:

    May 19 11:55:40 rl1 agent@nextcloud2[1945643]: task/module/nextcloud2/4f64f4fb-e410-42c8-962e-47f68e81aeab: restore-module/00progress is starting
    May 19 11:55:40 rl1 agent@nextcloud2[1945643]: Action restore-module skipped step 05replace: fork/exec /usr/local/agent/actions/restore-module/05replace: permission denied
    May 19 11:55:40 rl1 agent@nextcloud2[1945643]: task/module/nextcloud2/4f64f4fb-e410-42c8-962e-47f68e81aeab: restore-module/10restore is starting
    May 19 11:55:41 rl1 agent@nextcloud2[1945643]: restic restore --json 6221cd8d4810b1212155126be80ab1f33fb29e8e42105133a3a036f61e1012d9 --target . --exclude state/environment --exclude-xattr security.*
    May 19 11:55:55 rl1 agent@nextcloud2[1945643]: task/module/nextcloud2/4f64f4fb-e410-42c8-962e-47f68e81aeab: restore-module/20configure is starting
    May 19 11:56:36 rl1 agent@nextcloud2[1945643]: task/module/nextcloud2/4f64f4fb-e410-42c8-962e-47f68e81aeab: restore-module/20label is starting
    May 19 11:56:36 rl1 agent@nextcloud2[1945643]: task/module/nextcloud2/4f64f4fb-e410-42c8-962e-47f68e81aeab: restore-module/20note is starting
    May 19 11:56:36 rl1 agent@nextcloud2[1945643]: task/module/nextcloud2/4f64f4fb-e410-42c8-962e-47f68e81aeab: action "restore-module" status is "completed" (0) at step 20note
    May 19 11:56:36 rl1 agent@cluster[1940381]: task/cluster/69767c36-f91d-4d4d-a35e-d60776bb7a58: action "restore-module" status is "completed" (0) at step 50restore_module
    

    But Nextcloud is not accessible, this is the error after the login. Bot local administrator and user login failes:

    May 19 11:58:16 rl1 nextcloud-app[1947296]: NOTICE: PHP message: [nextcloud][index][3] {"reqId":"PVBoQI4eb4ayxsll8tKy","level":3,"time":"2026-05-19T11:58:16+00:00","remoteAddr":"2.119.67.169","user":"abad6d5c-6909-461b-898d-974710a96dd4","app":"index","method":"POST","url":"/login","scriptName":"/index.php","message":"{\"Exception\":\"Exception\",\"Message\":\"strtolower(): Argument #1 ($string) must be of type string, string given in file '/var/www/html/lib/private/Config/UserConfig.php' line 688\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/html/lib/private/AppFramework/App.php\",\"line\":153,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Core\\\\Controller\\\\LoginController\"},\"tryLogin\"]},{\"file\":\"/var/www/html/lib/private/Route/Router.php\",\"line\":321,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\",\"args\":[\"OC\\\\Core\\\\Controller\\\\LoginController\",\"tryLogin\",{\"__class__\":\"OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer\"},{\"_route\":\"core.login.trylogin\"}]},{\"file\":\"/var/www/html/lib/base.php\",\"line\":1155,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\",\"args\":[\"/login\"]},{\"file\":\"/var/www/html/index.php\",\"line\":25,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\",\"args\":[]}],\"File\":\"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php\",\"Line\":150,\"Previous\":{\"Exception\":\"TypeError\",\"Message\":\"strtolower(): Argument #1 ($string) must be of type string, string given\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/html/lib/private/Config/UserConfig.php\",\"line\":688,\"function\":\"strtolower\",\"args\":[\"false\"]},{\"file\":\"/var/www/html/apps/user_ldap/lib/User/DeletedUsersIndex.php\",\"line\":88,\"function\":\"getValueBool\",\"class\":\"OC\\\\Config\\\\UserConfig\",\"type\":\"->\",\"args\":[\"abad6d5c-6909-461b-898d-974710a96dd4\",\"user_ldap\",\"isDeleted\"]},{\"file\":\"/var/www/html/apps/user_ldap/lib/User_LDAP.php\",\"line\":651,\"function\":\"isUserMarked\",\"class\":\"OCA\\\\User_LDAP\\\\User\\\\DeletedUsersIndex\",\"type\":\"->\",\"args\":[\"abad6d5c-6909-461b-898d-974710a96dd4\"]},{\"function\":\"isUserEnabled\",\"class\":\"OCA\\\\User_LDAP\\\\User_LDAP\",\"type\":\"->\",\"args\":[\"abad6d5c-6909-461b-898d-974710a96dd4\",{\"__class__\":\"Closure\"}]},{\"file\":\"/var/www/html/apps/user_ldap/lib/User_Proxy.php\",\"line\":67,\"function\":\"call_user_func_array\",\"args\":[[{\"__class__\":\"OCA\\\\User_LDAP\\\\User_LDAP\"},\"isUserEnabled\"],[\"abad6d5c-6909-461b-898d-974710a96dd4\",{\"__class__\":\"Closure\"}]]},{\"file\":\"/var/www/html/apps/user_ldap/lib/Proxy.php\",\"line\":153,\"function\":\"walkBackends\",\"class\":\"OCA\\\\User_LDAP\\\\User_Proxy\",\"type\":\"->\",\"args\":[\"abad6d5c-6909-461b-898d-974710a96dd4\",\"isUserEnabled\",[\"abad6d5c-6909-461b-898d-974710a96dd4\",{\"__class__\":\"Closure\"}]]},{\"file\":\"/var/www/html/apps/user_ldap/lib/User_Proxy.php\",\"line\":404,\"function\":\"handleRequest\",\"class\":\"OCA\\\\User_LDAP\\\\Proxy\",\"type\":\"->\",\"args\":[\"abad6d5c-6909-461b-898d-974710a96dd4\",\"isUserEnabled\",[\"abad6d5c-6909-461b-898d-974710a96dd4\",{\"__class__\":\"Closure\"}]]},{\"file\":\"/var/www/html/lib/private/User/User.php\",\"line\":470,\"function\":\"isUserEnabled\",\"class\":\"OCA\\\\User_LDAP\\\\User_Proxy\",\"type\":\"->\",\"args\":[\"abad6d5c-6909-461b-898d-974710a96dd4\",{\"__class__\":\"Closure\"}]},{\"file\":\"/var/www/html/lib/private/User/Session.php\",\"line\":227,\"function\":\"isEnabled\",\"class\":\"OC\\\\User\\\\User\",\"type\":\"->\",\"args\":[]},{\"file\":\"/var/www/html/lib/base.php\",\"line\":973,\"function\":\"isLoggedIn\",\"class\":\"OC\\\\User\\\\Session\",\"type\":\"->\",\"args\":[]},{\"function\":\"{closure:OC::registerCleanupHooks():972}\",\"class\":\"OC\",\"type\":\"::\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"/var/www/html/lib/private/Hooks/EmitterTrait.php\",\"line\":89,\"function\":\"call_user_func_array\",\"args\":[{\"__class__\":\"Closure\"},[\"*** sensitive parameters replaced ***\",\"*** sensitive parameters replaced ***\",\"*** sensitive parameters replaced ***\",\"*** sensitive parameters replaced ***\"]]},{\"file\":\"/var/www/html/lib/private/Hooks/PublicEmitter.php\",\"line\":23,\"function\":\"emit\",\"class\":\"OC\\\\Hooks\\\\BasicEmitter\",\"type\":\"->\",\"args\":[\"\\\\OC\\\\User\",\"postLogin\",[\"*** sensitive parameters replaced ***\",\"*** sensitive parameters replaced ***\",\"*** sensitive parameters replaced ***\",\"*** sensitive parameters replaced ***\"]]},{\"file\":\"/var/www/html/lib/private/User/Session.php\",\"line\":351,\"function\":\"emit\",\"class\":\"OC\\\\Hooks\\\\PublicEmitter\",\"type\":\"->\",\"args\":[\"\\\\OC\\\\User\",\"postLogin\",[\"*** sensitive parameters replaced ***\",\"*** sensitive parameters replaced ***\",\"*** sensitive parameters replaced ***\",\"*** sensitive parameters replaced ***\"]]},{\"file\":\"/var/www/html/lib/private/Authentication/Login/CompleteLoginCommand.php\",\"line\":22,\"function\":\"completeLogin\",\"class\":\"OC\\\\User\\\\Session\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php\",\"line\":22,\"function\":\"process\",\"class\":\"OC\\\\Authentication\\\\Login\\\\CompleteLoginCommand\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Authentication\\\\Login\\\\LoginData\"}]},{\"file\":\"/var/www/html/lib/private/Authentication/Login/LoggedInCheckCommand.php\",\"line\":41,\"function\":\"processNextOrFinishSuccessfully\",\"class\":\"OC\\\\Authentication\\\\Login\\\\ALoginCommand\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Authentication\\\\Login\\\\LoginData\"}]},{\"file\":\"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php\",\"line\":22,\"function\":\"process\",\"class\":\"OC\\\\Authentication\\\\Login\\\\LoggedInCheckCommand\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Authentication\\\\Login\\\\LoginData\"}]},{\"file\":\"/var/www/html/lib/private/Authentication/Login/UidLoginCommand.php\",\"line\":36,\"function\":\"processNextOrFinishSuccessfully\",\"class\":\"OC\\\\Authentication\\\\Login\\\\ALoginCommand\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Authentication\\\\Login\\\\LoginData\"}]},{\"file\":\"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php\",\"line\":22,\"function\":\"process\",\"class\":\"OC\\\\Authentication\\\\Login\\\\UidLoginCommand\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Authentication\\\\Login\\\\LoginData\"}]},{\"file\":\"/var/www/html/lib/private/Authentication/Login/UserDisabledCheckCommand.php\",\"line\":39,\"function\":\"processNextOrFinishSuccessfully\",\"class\":\"OC\\\\Authentication\\\\Login\\\\ALoginCommand\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Authentication\\\\Login\\\\LoginData\"}]},{\"file\":\"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php\",\"line\":22,\"function\":\"process\",\"class\":\"OC\\\\Authentication\\\\Login\\\\UserDisabledCheckCommand\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Authentication\\\\Login\\\\LoginData\"}]},{\"file\":\"/var/www/html/lib/private/Authentication/Login/PreLoginHookCommand.php\",\"line\":34,\"function\":\"processNextOrFinishSuccessfully\",\"class\":\"OC\\\\Authentication\\\\Login\\\\ALoginCommand\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Authentication\\\\Login\\\\LoginData\"}]},{\"file\":\"/var/www/html/lib/private/Authentication/Login/Chain.php\",\"line\":43,\"function\":\"process\",\"class\":\"OC\\\\Authentication\\\\Login\\\\PreLoginHookCommand\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Authentication\\\\Login\\\\LoginData\"}]},{\"file\":\"/var/www/html/core/Controller/LoginController.php\",\"line\":358,\"function\":\"process\",\"class\":\"OC\\\\Authentication\\\\Login\\\\Chain\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Authentication\\\\Login\\\\LoginData\"}]},{\"file\":\"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":205,\"function\":\"tryLogin\",\"class\":\"OC\\\\Core\\\\Cont...
    May 19 11:58:16 rl1 nextcloud-app[1947296]: NOTICE: PHP message: [nextcloud][PHP][3] {"reqId":"PVBoQI4eb4ayxsll8tKy","level":3,"time":"2026-05-19T11:58:16+00:00","remoteAddr":"2.119.67.169","user":"abad6d5c-6909-461b-898d-974710a96dd4","app":"PHP","method":"POST","url":"/login","scriptName":"/index.php","message":"TypeError: strtolower(): Argument #1 ($string) must be of type string, string given at /var/www/html/lib/private/Config/UserConfig.php#688","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36","version":"33.0.3.2","data":{"app":"PHP"}}
    May 19 11:58:16 rl1 nextcloud-app[1947296]: 127.0.0.1 -  19/May/2026:11:58:16 +0000 "POST /index.php" 500
    
  10. removed
    testing
    on May 19, 2026
  11. moved this from Testing to In Progress in NethServeron May 19, 2026
  12. 4 remaining items

  13. stephdl commented on May 20, 2026

    @stephdl
    Author

    new testing version 1.7.1-dev.4, slow servers can go to timeout, the timeout has been increased to 90s.
    The issue must not be present anymore and the server should go to systemd timeout

  14. added
    testing
    on May 20, 2026
  15. moved this from In Progress to Testing in NethServeron May 20, 2026
  16. gsanchietti commented on May 20, 2026

    @gsanchietti
    Member

    The issue is fixed, still at lease once I had to reconfigure the module from the UI to make it fully working.
    Probably it's a small race condition but I could not be able to reproduce nor to extract some useful log.

    Let's set the issue to verified.

  17. added
    verified
    and removed
    testing
    on May 20, 2026
  18. removed their assignment
    on May 20, 2026
  19. moved this from Testing to Verified in NethServeron May 20, 2026
  20. moved this from Verified to In Progress in NethServeron May 20, 2026
  21. moved this from In Progress to Verified in NethServeron May 22, 2026
  22. stephdl commented on Jun 8, 2026

    @stephdl
    Author
  23. moved this from Verified to Done in NethServeron Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    verified

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions