Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

OC 9.1 and News 8.8.0 does not play well: Class '\OCP\Backgroundjob' not found in /var/www/owncloud/apps/news/config/appconfig.php #1008

Open
jas4711 opened this issue Jul 21, 2016 · 16 comments

Comments

@jas4711
Copy link

jas4711 commented Jul 21, 2016

IMPORTANT

Read and tick the following checkbox after you have created the issue or place an x inside the brackets ;)

Explain the Problem

Enabling the news 8.8.0 app in ownCloud 9.1 results in immediate failure:

PHP Fatal error: Class '\OCP\Backgroundjob' not found in /var/www/owncloud/apps/news/config/appconfig.php on line 88

Steps to Reproduce

Explain what you did to encounter the issue

  1. Upgrade OC from 9.0.4 to 9.1
  2. occ app:enable news
  3. do anything, visit web page, or run 'occ'.

System Information

  • News app version: 8.8.0
  • ownCloud version: 9.1.0
  • PHP version: 5.6.23
  • Database and version: MySQL 5.5.49
  • Browser and version: FireFox 45.2
  • Distribution and version: Debian Jessie

Contents of owncloud/data/owncloud.log

{"reqId":"RvMIkEOfwNePjD+ZnD1x","remoteAddr":"","app":"PHP","message":"Class '\\OCP\\Backgroundjob' not found at \/var\/www\/owncloud\/apps\/news\/config\/appconfig.php#88","level":3,"time":"2016-07-21T09:47:32+00:00","method":"--","url":"\/owncloud\/occ","user":"--"}
@jas4711
Copy link
Author

jas4711 commented Jul 21, 2016

Here is a possible patch.... at least it silences the hard failure, but I'm not sure it does what it is supposed to do.

--- news/config/appconfig.php.orig  2016-07-21 10:07:37.644578259 +0000
+++ news/config/appconfig.php   2016-07-21 10:08:09.212578280 +0000
@@ -83,9 +83,7 @@
     public function registerAll() {
         $this->registerNavigation();
         $this->registerHooks();
-        // IJob API is fucked up, so silence the code checker
-        $class = '\OCP\Backgroundjob';
-        $class::addRegularTask($this->config['cron']['job'], 'run');
+        \OC::$server->getJobList()->add($this->config['cron']['job']);
         App::registerAdmin($this->config['id'], $this->config['admin']);
     }

@mis4s
Copy link

mis4s commented Jul 21, 2016

@jas4711 thx

@DeepDiver1975 DeepDiver1975 self-assigned this Jul 21, 2016
@jajaX
Copy link

jajaX commented Jul 21, 2016

Hi (sorry same problem for me)

I have this msg "Erreur : Cette application ne peut pas être activer car cela le serveur instable ." (error, this application don't be actived because the server is instable)

jas4711, it must just replace your text in the appconfig.php file ?

@DeepDiver1975 DeepDiver1975 removed their assignment Jul 21, 2016
@DeepDiver1975
Copy link
Contributor

The correct class name is \OCP\BackgroundJob not \OCP\Backgroundjob

@ebugnet
Copy link

ebugnet commented Jul 22, 2016

@jajaX
Yes, changing Backgroundjob by BackgroundJob let me install the apps !
Éric

@jajaX
Copy link

jajaX commented Jul 22, 2016

Hi !

ok, I make that yesterday and it works again ! thanks ;)

I propose same thing for boorkmarks apps on comments in apps owncloud website !

@Dark-Fenix
Copy link

Hi,

I just corrected the appconfig.php according to DeepDiver1975's comment, it works !

@zkvvoob
Copy link

zkvvoob commented Jul 23, 2016

Hello,

I followed your suggestions above and managed to get the News app running in OC 9.1 with 32-bit PHP/Ubuntu. However, even though the cron seems to be working fine (every 15 min) the news feed have not updated in more than 3 hours.

Any idea how I can solve this without having to go back to OC 9.0.1?

Thanks!

@LennartRoeder
Copy link

sometimes the cron gets hung up.
check with htop or top if it is still running. If it is, kill it and wait, or run it with:
sudo -u www-data php -f /var/www/owncloud/cron.php

@paroj
Copy link

paroj commented Jul 23, 2016

fixed in #999. Just need a new release of the news app.

@pbek
Copy link

pbek commented Jul 27, 2016

great, thank you! renaming the class-name to \OCP\BackgroundJob did the trick for me to!

@farga93
Copy link

farga93 commented Jul 27, 2016

Renaming \OCP\Backgroundjob to OCP\BackgroundJob in apps/news/config/appconfig.php works.

@alandolsi
Copy link

This worked for me!

@nille02
Copy link

nille02 commented Aug 5, 2016

Today i updated my box and i run in the same problem. Why is it after 2 Weeks not fixed upstream?

By the Way the music app is also affected by the Rename.

@paroj
Copy link

paroj commented Aug 5, 2016

the news app is currently unmaintained as the original maintainer moved to nextcloud.

@okias
Copy link

okias commented Aug 7, 2016

same issue (that it need renaming s/Backgroundjob/BackgroundJob/ ) is needed even in nextcloud 10 beta...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests