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

Application is not setup via query() but directly at <<closure>> #849

Closed
adripo opened this issue Apr 22, 2021 · 7 comments
Closed

Application is not setup via query() but directly at <<closure>> #849

adripo opened this issue Apr 22, 2021 · 7 comments

Comments

@adripo
Copy link

adripo commented Apr 22, 2021

Hello,

After enabling debug on Nextcloud 21, I get this error in the logs.

[music] Error: RuntimeException: App class OCA\Music\App\Music is not setup via query() but directly at <<closure>>

0. /var/www/html/custom_apps/music/lib/App/Music.php line 73
   OCP\AppFramework\App->__construct("music", [])
1. /var/www/html/custom_apps/music/appinfo/app.php line 19
   OCA\Music\App\Music->__construct()
2. /var/www/html/lib/private/legacy/OC_App.php line 295
   require_once("/var/www/html/c ... p")
3. /var/www/html/lib/private/legacy/OC_App.php line 177
   OC_App::requireAppFile("music")
4. /var/www/html/lib/private/legacy/OC_App.php line 137
   OC_App::loadApp("music")
5. /var/www/html/lib/base.php line 979
   OC_App::loadApps()
6. /var/www/html/index.php line 37
   OC::handleRequest()

GET /apps/logreader/poll?lastReqId=mmKFibsGS2Ok8GHfVH5I
from 192.168.80.2 by adm_ax at 2021-04-22T22:35:55+00:00

As I read on this issue for calendar the solution should be something like this.

@paulijar
Copy link
Collaborator

paulijar commented May 2, 2021

Thanks for the report. Which "logs" do you mean? I couldn't find anything like that from nextcloud.log when I tested with NC 21.0.0 and NC 21.0.1 with logging level set to "Debug" (0).

@adripo
Copy link
Author

adripo commented May 6, 2021

Those logs are visible from the interface. Simply go in Settings -> Logs from an admin account.
I enabled debug by adding 'debug' => true, in config/config.php

@paulijar
Copy link
Collaborator

paulijar commented May 6, 2021

Okay, now I got this. The log shown in Settings > Logs is just the nextcloud.log file. But there were two reasons, why I didn't see those errors:

  1. I didn't have the config 'debug' => true. What I had tried, was to set the logging level to 'debug' with the config 'loglevel' => 0. But this is completely different thing and it enables many other logging lines but not this one (which is actually logged on the level 3 i.e. error).
  2. The block of code checking and printing this error is disabled when running with PHP 7.4 or newer. Looking at the Nextcloud repository history, the check has been disabled there because it didn't work with PHP 7.4, producing false positives for all applications (see nextcloud/server@cba7219).

Edit: And just for completeness, the check producing these error messages has been first introduced in Nextcloud 18, so version 21 is not needed to observe this.

paulijar added a commit that referenced this issue May 6, 2021
This prevents error log spamming on NC18+ when the debug mode has been
enabled with `'debug' => true` and PHP version older than 7.4 is used.
Probably this also might have a positive performance impact.

refs #849
@adripo
Copy link
Author

adripo commented May 11, 2021

Thanks for the investigation and fix. When will you release the new version?

@paulijar
Copy link
Collaborator

The new version is probably released later this week.

@paulijar
Copy link
Collaborator

Music v1.2.0 including this fix is now released.

@adripo
Copy link
Author

adripo commented May 13, 2021

Thank you

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

No branches or pull requests

2 participants