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

Small Bug app.php deprecated error message #89

Closed
yupthatguy opened this issue Jun 14, 2022 · 12 comments
Closed

Small Bug app.php deprecated error message #89

yupthatguy opened this issue Jun 14, 2022 · 12 comments
Assignees

Comments

@yupthatguy
Copy link

Hey there,

Just doing some maintenance and trying to clear my NC error log. I noticed that your app leaves this error message in my log:

{"reqId":"Yp5jDSRvIDQU4afxJvGeCgAARhY","level":0,"time":"June 06, 2022 20:26:53","remoteAddr":"192.168.61.1","user":"fathertimetest","app":"metadata","method":"PUT","url":"/index.php/apps/user_status/heartbeat","message":"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36","version":"24.0.1.1"}

I am on NC24, Ubuntu 20.04, running php7.4-fpm

@gino0631
Copy link
Owner

Hi! Thanks for the information, I'll take a look, though removal of app.php will break compatibility with older NC versions, so I need to check when it was deprecated and how it's better to proceed.

@gino0631 gino0631 self-assigned this Jun 16, 2022
@killerbees19
Copy link

killerbees19 commented Jun 27, 2022

[…] removal of app.php will break compatibility with older NC versions […]

Maybe it's possible to call a method from your Application class in app.php only if Nextcloud version is <=19?

Reference: https://docs.nextcloud.com/server/latest/developer_manual/app_development/bootstrap.html

@bencomp
Copy link

bencomp commented Aug 28, 2022

My reading of https://help.nextcloud.com/t/app-files-sharing-message-migrate-everything-from-app-php-to-the-application-class/130570 is that maybe you don't have to check for the server version, because:

/appinfo/app.php is not loaded when \OCP\AppFramework\Bootstrap\IBootstrap on the application class is used.

@gino0631
Copy link
Owner

@bencomp but Nextcloud will log that message, and that would be annoying as well?
Really need to test 😟

@gino0631
Copy link
Owner

Actually, "level":0 should mean Debug level message. What loglevel do you have in your config.php? With the default 2 I don't seem to have such messages.

@bencomp
Copy link

bencomp commented Aug 28, 2022

Oh, I see. It looks like that is even an error, not just a debug message. The app development documentation about the bootstrap process is unclear about providing support for Nextcloud 19 and 20(+) in the same version of an app.

I am clearly not a Nextcloud app developer; I just recently noticed that most log messages in my Nextcloud log are about the deprecation of using appinfo/app.php, similar to the issue author described. (I also see it in the Draw.io app, like pawelrojek/nextcloud-drawio#185 – each request produces two debug messages about this deprecation, one for each app.)
Of course, I could increase the log level to make such messages go away, but I figured there is a reason for them.

Wondering how other apps support Nextcloud 19 and up with the same app version, I found that the Cookbook app checks the server version when constructing the Application class: https://github.com/nextcloud/cookbook/blob/v0.9.13/lib/AppInfo/Application.php
It doesn't look great to do it like this, to me at least. Several other apps require upgrading to Nextcloud 20 or later for their apps to receive updates. I don't know if dropping support for older Nextcloud versions is the only way forward for app developers...

@gino0631
Copy link
Owner

Thanks for the detailed information, I'll take a look.

@derritter88
Copy link

@gino0631 app.php can be removed without any issues. I have tried it on my local machine and your app continues to work for any modern, supported Nextcloud versions.

@gino0631
Copy link
Owner

@derritter88 and on not-so-modern, or even ownCloud?

@derritter88
Copy link

@derritter88 and on not-so-modern, or even ownCloud?

All Nextcloud versions which are still in support (https://nextcloud.com/changelog/) do use successor of app.php which is deprecated for them.

Owncloud is out of my personal scope as I do not use it.

@flo-mic
Copy link

flo-mic commented Jan 11, 2023

@gino0631 are there any updates on this? The messages are generating a lot of noises on my nextcloud log

@gino0631
Copy link
Owner

@flo-mic not at the moment, but the issue will be resolved in the next release.

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

6 participants