Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Class 'OCP\Server' not found #388

Closed
MarceloBastos5 opened this issue Feb 28, 2024 · 10 comments
Closed

Error: Class 'OCP\Server' not found #388

MarceloBastos5 opened this issue Feb 28, 2024 · 10 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@MarceloBastos5
Copy link

After install the app analytics , nextcloud display this message

Exception: Class 'OCP\Server' not found

/var/www/nextcloud/lib/private/AppFramework/App.php - line 156:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/nextcloud/lib/private/Route/Router.php - line 301:

OC\AppFramework\App::main()

/var/www/nextcloud/lib/base.php - line 1000:

OC\Route\Router->match()

/var/www/nextcloud/index.php - line 36:

OC::handleRequest()

help me , please

@Rello
Copy link
Owner

Rello commented Feb 28, 2024

that is a strange one.
which NC version are you using?
when you disable Analytics, working again?

@Rello Rello self-assigned this Feb 28, 2024
@MarceloBastos5
Copy link
Author

Version 22.

Yes, working.

My installation the nextcloud can't access internet.
Can be it?

Very thanks for help

@MarceloBastos5
Copy link
Author

i installed manually the analytics

@Rello
Copy link
Owner

Rello commented Feb 28, 2024

thats strange. how did you install it?
just extracting the archive you got from github into the apps folder? did you use the oder 4.11 version? current is not nc20.
I think there is some dependency that I might be missing. being airgapped in general is not the issue

@MarceloBastos5
Copy link
Author

yes, i used the version 4.11 indicated for nextcloud 22.

i extracted the content for file in folder /var/www/nextcloud/apps
then i granted permission for user www-data with chown www-data.www-data ./analytics -R

On nextcloud habilited the plugin

@mudassir1996
Copy link

I am facing the same issue on nextcloud 22.2.10. I installed the analytics 4.11.1 manually and when I visit the app it gives me internal server error. I have checked the logs and this is what I got.

{
   "reqId":"7SaFiP2ovJzPksnfvpHn",
   "level":3,
   "time":"2024-03-04T06:13:51+00:00",
   "remoteAddr":"",
   "user":"nextcloud_admin",
   "app":"index",
   "method":"GET",
   "url":"/index.php/apps/analytics/",
   "message":"Class 'OCP\\Server' not found",
   "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0",
   "version":"22.2.10.2",
   "exception":{
      "Exception":"Exception",
      "Message":"Class 'OCP\\Server' not found",
      "Code":0,
      "Trace":[
         {
            "file":"/var/www/ec_nextcloud/lib/private/AppFramework/App.php",
            "line":156,
            "function":"dispatch",
            "class":"OC\\AppFramework\\Http\\Dispatcher",
            "type":"->"
         },
         {
            "file":"/var/www/ec_nextcloud/lib/private/Route/Router.php",
            "line":302,
            "function":"main",
            "class":"OC\\AppFramework\\App",
            "type":"::"
         },
         {
            "file":"/var/www/ec_nextcloud/lib/base.php",
            "line":1008,
            "function":"match",
            "class":"OC\\Route\\Router",
            "type":"->"
         },
         {
            "file":"/var/www/ec_nextcloud/index.php",
            "line":50,
            "function":"handleRequest",
            "class":"OC",
            "type":"::"
         }
      ],
      "File":"/var/www/ec_nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
      "Line":158,
      "Previous":{
         "Exception":"Error",
         "Message":"Class 'OCP\\Server' not found",
         "Code":0,
         "Trace":[
            {
               "file":"/var/www/ec_nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
               "line":217,
               "function":"index",
               "class":"OCA\\Analytics\\Controller\\PageController",
               "type":"->"
            },
            {
               "file":"/var/www/ec_nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
               "line":126,
               "function":"executeController",
               "class":"OC\\AppFramework\\Http\\Dispatcher",
               "type":"->"
            },
            {
               "file":"/var/www/ec_nextcloud/lib/private/AppFramework/App.php",
               "line":156,
               "function":"dispatch",
               "class":"OC\\AppFramework\\Http\\Dispatcher",
               "type":"->"
            },
            {
               "file":"/var/www/ec_nextcloud/lib/private/Route/Router.php",
               "line":302,
               "function":"main",
               "class":"OC\\AppFramework\\App",
               "type":"::"
            },
            {
               "file":"/var/www/ec_nextcloud/lib/base.php",
               "line":1008,
               "function":"match",
               "class":"OC\\Route\\Router",
               "type":"->"
            },
            {
               "file":"/var/www/ec_nextcloud/index.php",
               "line":50,
               "function":"handleRequest",
               "class":"OC",
               "type":"::"
            }
         ],
         "File":"/var/www/ec_nextcloud/apps/analytics/lib/Controller/PageController.php",
         "Line":90
      },
      "CustomMessage":"--"
   }
}

This is how I installed the app

tar -zxvf analytics-4.11.1.tar.gz
chown -R www-data:www-data analytics
sudo -u www-data php occ app:enable analytics

@Rello
Copy link
Owner

Rello commented Mar 4, 2024

that is strange. this is a feature that was added to NC later. But for that reasons I added the try-part around it.
I will start a NC22 on my side an let you know..

@MarceloBastos5
Copy link
Author

Ok, Rello. Thank for your attention.

@mudassir1996
Copy link

Hi @Rello, did you get a chance to review this?

@Rello
Copy link
Owner

Rello commented May 4, 2024

Hello,
it is related to the outdated NC version. Unfortunately I do not have time to maintain app versions for older releases. I changed the version dependencies for the current version.

...you should definitely update your NC to a newer version. there were so many performance improvements implemented. whats your reason to remain on 22?!

@Rello Rello added the wontfix This will not be worked on label May 4, 2024
@Rello Rello closed this as completed May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants