Internal Server Error on all devices except one

Hi Everyone,

I am running Nextcloud AIO for a couple of weeks. Everything worked well until I started getting an Interner Server Error message this week. I can still access one of my laptops where I am logged in. I do get the same error message if I try to log in in incognito.

Nextcloud version (eg, 29.0.5): AIO v9.4.1
Operating system and version (eg, Ubuntu 24.04): DSM 7.2
Apache or nginx version (eg, Apache 2.4.25): taken care by AIO
PHP version (eg, 8.3): taken care by AIO

The issue you are facing: The frontend shows Internal Server Error. The sync client on 2 MacBooks works fine.

Is this the first time you’ve seen this error? (Y/N): Since I installed the AIO yes. I had it before when I using the server but I do not remember how I fixed it.

Steps to replicate it:

  1. Open the login page

The output of your Nextcloud log in Admin > Logging:

I cannot access it.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

Don't have access to it as I am running an AIO installation.

The output of your Apache/nginx/system log in /var/log/____:

Don't have access to it as I am running an AIO installation.

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.

Apache container log:

2024-09-07T13:44:21.855104809Z Waiting for Nextcloud to start...
2024-09-07T13:44:26.857694873Z Waiting for Nextcloud to start...
2024-09-07T13:44:31.859763135Z Waiting for Nextcloud to start...
2024-09-07T13:44:36.861684698Z Waiting for Nextcloud to start...
2024-09-07T13:44:41.863583492Z Waiting for Nextcloud to start...
2024-09-07T13:44:46.882405387Z Connection to nextcloud-aio-nextcloud (172.27.0.6) 9000 port [tcp/*] succeeded!
2024-09-07T13:44:55.095963537Z {"level":"warn","ts":1725716695.0958323,"msg":"failed to set GOMAXPROCS","error":"open /sys/fs/cgroup/cpu/cpu.cfs_quota_us: no such file or directory"}
2024-09-07T13:45:09.584243365Z {"level":"warn","ts":1725716709.583853,"msg":"failed to set GOMAXPROCS","error":"open /sys/fs/cgroup/cpu/cpu.cfs_quota_us: no such file or directory"}
2024-09-07T13:45:09.585374612Z {"level":"info","ts":1725716709.5850525,"msg":"using config from file","file":"/tmp/Caddyfile"}
2024-09-07T13:45:09.588480277Z {"level":"info","ts":1725716709.588224,"msg":"adapted config to JSON","adapter":"caddyfile"}
2024-09-07T13:45:12.470112478Z [Sat Sep 07 15:45:12.469832 2024] [mpm_event:notice] [pid 89:tid 89] AH00489: Apache/2.4.62 (Unix) configured -- resuming normal operations
2024-09-07T13:45:14.681082978Z [Sat Sep 07 15:45:12.470208 2024] [core:notice] [pid 89:tid 89] AH00094: Command line: '/usr/local/apache2/bin/httpd -D FOREGROUND'

Hi, you should be able to retreive the log with sudo docker exec -it nextcloud-aio-nextcloud tail data/nextcloud.log

All I get is multiple errors like this:

{
  "reqId": "UnCs2BO1a2R1wFzegTk9",
  "level": 2,
  "time": "2024-09-08T12:21:36+00:00",
  "remoteAddr": "",
  "user": "--",
  "app": "context_chat",
  "method": "",
  "url": "--",
  "message": "Temporary problem with indexing, trying again soon",
  "userAgent": "--",
  "version": "29.0.4.1",
  "exception": {
    "Exception": "RuntimeException",
    "Message": "AppAPI is not enabled, please enable it or install the AppAPI app from the Nextcloud AppStore",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/custom_apps/context_chat/lib/Service/LangRopeService.php",
        "line": 216,
        "function": "requestToExApp",
        "class": "OCA\\ContextChat\\Service\\LangRopeService",
        "type": "->",
        "args": [
          "/loadSources",
          "PUT",
          [
            [
              "sources",
              "files__default: 4",
              null,
              [
                "admin",
                "/admin/files/Documents/Example.md",
                "text/markdown",
                1723844157,
                "files__default"
              ]
            ]
          ],
          "multipart/form-data"
        ]
      },
      {
        "file": "/var/www/html/custom_apps/context_chat/lib/BackgroundJobs/IndexerJob.php",
        "line": 151,
        "function": "indexSources",
        "class": "OCA\\ContextChat\\Service\\LangRopeService",
        "type": "->",
        "args": [
          [
            [
              "OCA\\ContextChat\\Type\\Source",
              "admin",
              "files__default: 4",
              "/admin/files/Documents/Example.md",
              null,
              1723844157,
              "text/markdown",
              "files__default"
            ]
          ]
        ]
      },
      {
        "file": "/var/www/html/custom_apps/context_chat/lib/BackgroundJobs/IndexerJob.php",
        "line": 84,
        "function": "index",
        "class": "OCA\\ContextChat\\BackgroundJobs\\IndexerJob",
        "type": "->",
        "args": [
          [
            [
              "OCA\\ContextChat\\Db\\QueueFile",
              218
            ],
            [
              "OCA\\ContextChat\\Db\\QueueFile",
              221
            ],
            [
              "OCA\\ContextChat\\Db\\QueueFile",
              223
            ],
            [
              "OCA\\ContextChat\\Db\\QueueFile",
              225
            ],
            [
              "OCA\\ContextChat\\Db\\QueueFile",
              228
            ],
            "And 18 more entries, set log level to debug to see all entries"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/public/BackgroundJob/Job.php",
        "line": 80,
        "function": "run",
        "class": "OCA\\ContextChat\\BackgroundJobs\\IndexerJob",
        "type": "->",
        "args": [
          [
            1,
            1
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/public/BackgroundJob/TimedJob.php",
        "line": 102,
        "function": "start",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->",
        "args": [
          [
            "OC\\BackgroundJob\\JobList"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/public/BackgroundJob/TimedJob.php",
        "line": 92,
        "function": "start",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->",
        "args": [
          [
            "OC\\BackgroundJob\\JobList"
          ]
        ]
      },
      {
        "file": "/var/www/html/cron.php",
        "line": 177,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->",
        "args": [
          [
            "OC\\BackgroundJob\\JobList"
          ]
        ]
      }
    ],
    "File": "/var/www/html/custom_apps/context_chat/lib/Service/LangRopeService.php",
    "Line": 60,
    "message": "Temporary problem with indexing, trying again soon",
    "exception": {},
    "CustomMessage": "Temporary problem with indexing, trying again soon"
  }
}

Please look at the log in real-time (when you’re attempting to access the Web UI and see the internal server error). You need the entry/entries associated with your connection attempts.

The log entry you posted is from a background job associated with the app “context_chat” ( Nextcloud Assistant Context Chat). That appears to be failing because the dependencies for it aren’t installed: Nextcloud Assistant Context Chat - Apps - App Store - Nextcloud

That particular error isn’t triggered by your connection attempt, but it’s possible it’s related. Either way it’ll need to get remedied too.

1 Like

It should be this then:

{
  "reqId": "Umoc3YVDh5qusmz2pZ9R",
  "level": 3,
  "time": "2024-09-09T06:23:51+00:00",
  "remoteAddr": "192.168.68.123",
  "user": "--",
  "app": "index",
  "method": "GET",
  "url": "/login?redirect_url=/apps/files/",
  "message": "Call to undefined method OCP\\AppFramework\\Http\\Events\\BeforeLoginTemplateRenderedEvent::isLoggedIn()",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
  "version": "29.0.4.1",
  "exception": {
    "Exception": "Error",
    "Message": "Call to undefined method OCP\\AppFramework\\Http\\Events\\BeforeLoginTemplateRenderedEvent::isLoggedIn()",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php",
        "line": 86,
        "function": "handle",
        "class": "OCA\\Unsplash\\EventListener\\BeforeTemplateRenderedEventListener",
        "type": "->",
        "args": [
          [
            "OCP\\AppFramework\\Http\\Events\\BeforeLoginTemplateRenderedEvent"
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 230,
        "function": "__invoke",
        "class": "OC\\EventDispatcher\\ServiceEventListener",
        "type": "->",
        "args": [
          [
            "OCP\\AppFramework\\Http\\Events\\BeforeLoginTemplateRenderedEvent"
          ],
          "OCP\\AppFramework\\Http\\Events\\BeforeLoginTemplateRenderedEvent",
          [
            "Symfony\\Component\\EventDispatcher\\EventDispatcher"
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 59,
        "function": "callListeners",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          [
            [
              "Closure"
            ],
            [
              "Closure"
            ],
            [
              "Closure"
            ],
            [
              "Closure"
            ],
            [
              "Closure"
            ]
          ],
          "OCP\\AppFramework\\Http\\Events\\BeforeLoginTemplateRenderedEvent",
          [
            "OCP\\AppFramework\\Http\\Events\\BeforeLoginTemplateRenderedEvent"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 86,
        "function": "dispatch",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          [
            "OCP\\AppFramework\\Http\\Events\\BeforeLoginTemplateRenderedEvent"
          ],
          "OCP\\AppFramework\\Http\\Events\\BeforeLoginTemplateRenderedEvent"
        ]
      },
      {
        "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 98,
        "function": "dispatch",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          "OCP\\AppFramework\\Http\\Events\\BeforeLoginTemplateRenderedEvent",
          [
            "OCP\\AppFramework\\Http\\Events\\BeforeLoginTemplateRenderedEvent"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/Middleware/AdditionalScriptsMiddleware.php",
        "line": 50,
        "function": "dispatchTyped",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          [
            "OCP\\AppFramework\\Http\\Events\\BeforeLoginTemplateRenderedEvent"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php",
        "line": 142,
        "function": "afterController",
        "class": "OC\\AppFramework\\Middleware\\AdditionalScriptsMiddleware",
        "type": "->",
        "args": [
          [
            "OC\\Core\\Controller\\LoginController"
          ],
          "showLoginForm",
          [
            "OCP\\AppFramework\\Http\\TemplateResponse"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 175,
        "function": "afterController",
        "class": "OC\\AppFramework\\Middleware\\MiddlewareDispatcher",
        "type": "->",
        "args": [
          [
            "OC\\Core\\Controller\\LoginController"
          ],
          "showLoginForm",
          [
            "OCP\\AppFramework\\Http\\TemplateResponse"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          [
            "OC\\Core\\Controller\\LoginController"
          ],
          "showLoginForm"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Route/Router.php",
        "line": 338,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OC\\Core\\Controller\\LoginController",
          "showLoginForm",
          [
            "OC\\AppFramework\\DependencyInjection\\DIContainer"
          ],
          [
            "core.login.showloginform"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/base.php",
        "line": 1050,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/login"
        ]
      },
      {
        "file": "/var/www/html/index.php",
        "line": 49,
        "function": "handleRequest",
        "class": "OC",
        "type": "::",
        "args": []
      }
    ],
    "File": "/var/www/html/custom_apps/unsplash/lib/EventListener/BeforeTemplateRenderedEventListener.php",
    "Line": 82,
    "message": "Call to undefined method OCP\\AppFramework\\Http\\Events\\BeforeLoginTemplateRenderedEvent::isLoggedIn()",
    "exception": {},
    "CustomMessage": "Call to undefined method OCP\\AppFramework\\Http\\Events\\BeforeLoginTemplateRenderedEvent::isLoggedIn()"
  }
}

"class": "OCA\\Unsplash\\EventListener\\BeforeTemplateRenderedEventListener",

Disable the Unsplash/Splash app.
Or, better yet, upgrade it. It looks like this matter was fixed a couple days ago.

can this be done from the terminal?

Yep:

Just updated it and it works good! Silly that I did not notice the log.

Thank you for your help!

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.