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

PHP8.2 support #983

Closed
derritter88 opened this issue Feb 28, 2023 · 25 comments
Closed

PHP8.2 support #983

derritter88 opened this issue Feb 28, 2023 · 25 comments

Comments

@derritter88
Copy link

derritter88 commented Feb 28, 2023

How to use GitHub

  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Is your feature request related to a problem? Please describe.
I am running the current NC 26 beta 5 to test/use PHP8.2 FPM.
I just recognised that Maps is not supporting it so I edited the info.xml the bypass the restriction.

So far the Maps app works but if I move the map it hangs sometimes.
Zooming in & out again usually solves the problem.
I think this is a similar problem to #786

Describe the solution you'd like
Make Maps compatible to PHP 8.2

Describe alternatives you've considered

Additional context
I am currently using v0.2.5-9-nightly

@tacruc
Copy link
Collaborator

tacruc commented Mar 2, 2023

#984

@derritter88
Copy link
Author

#984

Thanks!

@tacruc
Copy link
Collaborator

tacruc commented Mar 2, 2023

Can you test #985 ?

@derritter88
Copy link
Author

Simply by downloading the new package-lock.json and putting it into the maps directory?

@tacruc
Copy link
Collaborator

tacruc commented Mar 2, 2023

I think you will need the package.json, too
Then you would need to rebuild it with
Npm ci
And
npm run build

@derritter88
Copy link
Author

As you have already merged your change to master I just cloned the repo and compiled it.
#985 fixed the problem with the tiles - thanks!

@tacruc tacruc closed this as completed Mar 2, 2023
@tacruc tacruc reopened this Mar 2, 2023
@derritter88
Copy link
Author

derritter88 commented Mar 2, 2023

I get several error messages at my NC log (upgraded to 26.0.0 RC1):

{"reqId":"ZAESEX0DXXLRfNeASNG5aQAAAgc","level":4,"time":"2023-03-02T22:16:01+01:00","remoteAddr":"192.168.10.2","user":"3A60C52D-9415-4F28-A2B7-71A8CBD7A9E3","app":"no app in context","method":"GET","url":"/apps/logreader/get?offset=0&count=50&levels=00111","message":"Could not boot maps: Failed opening required '/var/www/cloud/apps/maps/lib/Service/../../vendor/autoload.php' (include_path='/var/www/cloud/apps/news/vendor/pear/net_url2:/var/www/cloud/3rdparty/pear/archive_tar:/var/www/cloud/3rdparty/pear/console_getopt:/var/www/cloud/3rdparty/pear/pear-core-minimal/src:/var/www/cloud/3rdparty/pear/pear_exception:/var/www/cloud/apps')","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"26.0.0.8","exception":{"Exception":"Error","Message":"Failed opening required '/var/www/cloud/apps/maps/lib/Service/../../vendor/autoload.php' (include_path='/var/www/cloud/apps/news/vendor/pear/net_url2:/var/www/cloud/3rdparty/pear/archive_tar:/var/www/cloud/3rdparty/pear/console_getopt:/var/www/cloud/3rdparty/pear/pear-core-minimal/src:/var/www/cloud/3rdparty/pear/pear_exception:/var/www/cloud/apps')","Code":0,"Trace":[{"file":"/var/www/cloud/lib/composer/composer/ClassLoader.php","line":578,"function":"include"},{"file":"/var/www/cloud/lib/composer/composer/ClassLoader.php","line":432,"function":"Composer\\Autoload\\{closure}","class":"Composer\\Autoload\\ClassLoader","type":"::","args":["*** sensitive parameters replaced ***"]},{"function":"loadClass","class":"Composer\\Autoload\\ClassLoader","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":122,"function":"__construct","class":"ReflectionClass","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":142,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":493,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/cloud/lib/private/ServerContainer.php","line":155,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/cloud/apps/maps/lib/AppInfo/Application.php","line":78,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":171,"function":"OCA\\Maps\\AppInfo\\{closure}","class":"OCA\\Maps\\AppInfo\\Application","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/cloud/3rdparty/pimple/pimple/src/Pimple/Container.php","line":122,"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":138,"function":"offsetGet","class":"Pimple\\Container","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":487,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":465,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/cloud/apps/maps/lib/AppInfo/Application.php","line":86,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":200,"function":"boot","class":"OCA\\Maps\\AppInfo\\Application","type":"->"},{"file":"/var/www/cloud/lib/private/legacy/OC_App.php","line":213,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/cloud/lib/private/legacy/OC_App.php","line":141,"function":"loadApp","class":"OC_App","type":"::"},{"file":"/var/www/cloud/lib/base.php","line":1030,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/var/www/cloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/cloud/apps/maps/lib/Service/PhotofilesService.php","Line":37,"message":"Could not boot maps: Failed opening required '/var/www/cloud/apps/maps/lib/Service/../../vendor/autoload.php' (include_path='/var/www/cloud/apps/news/vendor/pear/net_url2:/var/www/cloud/3rdparty/pear/archive_tar:/var/www/cloud/3rdparty/pear/console_getopt:/var/www/cloud/3rdparty/pear/pear-core-minimal/src:/var/www/cloud/3rdparty/pear/pear_exception:/var/www/cloud/apps')","exception":[],"CustomMessage":"Could not boot maps: Failed opening required '/var/www/cloud/apps/maps/lib/Service/../../vendor/autoload.php' (include_path='/var/www/cloud/apps/news/vendor/pear/net_url2:/var/www/cloud/3rdparty/pear/archive_tar:/var/www/cloud/3rdparty/pear/console_getopt:/var/www/cloud/3rdparty/pear/pear-core-minimal/src:/var/www/cloud/3rdparty/pear/pear_exception:/var/www/cloud/apps')"},"id":"64011211ce444"}

{"reqId":"ZAESEX0DXXLRfNeASNG5aQAAAgc","level":3,"time":"2023-03-02T22:16:01+01:00","remoteAddr":"192.168.10.2","user":"3A60C52D-9415-4F28-A2B7-71A8CBD7A9E3","app":"PHP","method":"GET","url":"/apps/logreader/get?offset=0&count=50&levels=00111","message":"require_once(/var/www/cloud/apps/maps/lib/Service/../../vendor/autoload.php): Failed to open stream: No such file or directory at /var/www/cloud/apps/maps/lib/Service/PhotofilesService.php#37","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"26.0.0.8","data":{"app":"PHP"},"id":"64011211ce452"}

{"reqId":"ZAESEX0DXXLRfNeASNG5aQAAAgc","level":3,"time":"2023-03-02T22:16:01+01:00","remoteAddr":"192.168.10.2","user":"--","app":"PHP","method":"GET","url":"/apps/logreader/get?offset=0&count=50&levels=00111","message":"include_once(/var/www/cloud/apps/maps/lib/AppInfo/../../vendor/autoload.php): Failed to open stream: No such file or directory at /var/www/cloud/apps/maps/lib/AppInfo/Application.php#48","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"26.0.0.8","data":{"app":"PHP"},"id":"64011211ce581"}
´´´

@derritter88
Copy link
Author

derritter88 commented Mar 3, 2023

I just tried the regular app from the NC app store. There are also some log entries:

{"reqId":"ZAGZzzQmL7bnpPZPhb0nmgAAVgU","level":3,"time":"2023-03-03T07:55:16+01:00","remoteAddr":"192.168.10.2","user":"3A60C52D-9415-4F28-A2B7-71A8CBD7A9E3","app":"PHP","method":"POST","url":"/settings/apps/enable","message":"include(/var/www/cloud/apps/maps/lib//AppInfo/Application.php): Failed to open stream: No such file or directory at /var/www/cloud/lib/composer/composer/ClassLoader.php#578","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"26.0.0.8","data":{"app":"PHP"},"id":"64019a09905ea"}

{"reqId":"ZAGZzzQmL7bnpPZPhb0nmgAAVgU","level":3,"time":"2023-03-03T07:55:16+01:00","remoteAddr":"192.168.10.2","user":"3A60C52D-9415-4F28-A2B7-71A8CBD7A9E3","app":"no app in context","method":"POST","url":"/settings/apps/enable","message":"App maps threw an error during app.php load and will be disabled: Class \"OCP\\AppFramework\\Db\\Mapper\" not found","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"26.0.0.8","exception":{"Exception":"Error","Message":"Class \"OCP\\AppFramework\\Db\\Mapper\" not found","Code":0,"Trace":[{"file":"/var/www/cloud/lib/composer/composer/ClassLoader.php","line":578,"function":"include"},{"file":"/var/www/cloud/lib/composer/composer/ClassLoader.php","line":432,"function":"Composer\\Autoload\\{closure}","class":"Composer\\Autoload\\ClassLoader","type":"::","args":["*** sensitive parameters replaced ***"]},{"function":"loadClass","class":"Composer\\Autoload\\ClassLoader","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":122,"function":"__construct","class":"ReflectionClass","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":142,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":493,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":465,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":97,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":84,"function":"array_map"},{"file":"/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":124,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":142,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":493,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/cloud/lib/private/ServerContainer.php","line":155,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/cloud/apps/maps/appinfo/application.php","line":33,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":171,"function":"OCA\\Maps\\AppInfo\\{closure}","class":"OCA\\Maps\\AppInfo\\Application","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/cloud/3rdparty/pimple/pimple/src/Pimple/Container.php","line":122,"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":138,"function":"offsetGet","class":"Pimple\\Container","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":487,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":465,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/cloud/apps/maps/appinfo/application.php","line":41,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/cloud/lib/private/ServerContainer.php","line":107,"function":"__construct","class":"OCA\\Maps\\AppInfo\\Application","type":"->"},{"file":"/var/www/cloud/lib/private/ServerContainer.php","line":186,"function":"getAppContainer","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/cloud/lib/private/ServerContainer.php","line":153,"function":"getAppContainerForService","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/cloud/apps/maps/appinfo/app.php","line":20,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/cloud/lib/private/legacy/OC_App.php","line":316,"args":["/var/www/cloud/apps/maps/appinfo/app.php"],"function":"require_once"},{"file":"/var/www/cloud/lib/private/legacy/OC_App.php","line":192,"function":"requireAppFile","class":"OC_App","type":"::"},{"file":"/var/www/cloud/lib/private/legacy/OC_App.php","line":1062,"function":"loadApp","class":"OC_App","type":"::"},{"file":"/var/www/cloud/lib/private/Installer.php","line":164,"function":"executeRepairSteps","class":"OC_App","type":"::"},{"file":"/var/www/cloud/apps/settings/lib/Controller/AppSettingsController.php","line":451,"function":"installApp","class":"OC\\Installer","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"enableApps","class":"OCA\\Settings\\Controller\\AppSettingsController","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/cloud/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/cloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/cloud/apps/maps/lib/DB/GeophotoMapper.php","Line":18,"message":"App maps threw an error during app.php load and will be disabled: Class \"OCP\\AppFramework\\Db\\Mapper\" not found","CustomMessage":"App maps threw an error during app.php load and will be disabled: Class \"OCP\\AppFramework\\Db\\Mapper\" not found"},"id":"64019a09905cf"}

{"reqId":"ZAGZzzQmL7bnpPZPhb0nmgAAVgU","level":3,"time":"2023-03-03T07:55:16+01:00","remoteAddr":"192.168.10.2","user":"3A60C52D-9415-4F28-A2B7-71A8CBD7A9E3","app":"PHP","method":"POST","url":"/settings/apps/enable","message":"include(/var/www/cloud/apps/maps/lib//AppInfo/Application.php): Failed to open stream: No such file or directory at /var/www/cloud/lib/composer/composer/ClassLoader.php#578","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"26.0.0.8","data":{"app":"PHP"},"id":"64019a09905ea"}

@tacruc
Copy link
Collaborator

tacruc commented Mar 3, 2023

The second one is a duplicate of #948
The others I looks like files are missing. What does the signing status say?

@derritter88
Copy link
Author

The second one is a duplicate of #948 The others I looks like files are missing. What does the signing status say?

How do I verify the signing status?

@tacruc
Copy link
Collaborator

tacruc commented Mar 3, 2023

In the admin settings somewhere.
Anyhow on maps v0.2.4 you will run into the issue #948 such that it won't work on NC26.

@derritter88
Copy link
Author

Ah okay the regular Nextcloud signing status.
It says that everything is fine and nothing found.

Also the integrity check didn't show any errors.

I just pulled the current master repo and modified it for PHP8.2 and compiled it with the above mentioned npm commands.

@tacruc
Copy link
Collaborator

tacruc commented Mar 3, 2023

#984
Apprently there is some conflict in the dependencies. So we will have to wait with php8.2 until we can drop php8.0 support. Or someone has to have a clever Idea how to solve the conflicts.

@derritter88
Copy link
Author

Where are the dependencies listed? package.json?

@tacruc
Copy link
Collaborator

tacruc commented Mar 3, 2023

composer.json
its the php dependencies.

@derritter88
Copy link
Author

Thanks.

I just crosschecked my NC folders now + the error message.
According to the the error message your app tries to register to some kind of service

[PHP] Fehler: include_once(): Failed opening '/var/www/cloud/apps/maps/lib/AppInfo/../../vendor/autoload.php' for inclusion (include_path='/var/www/cloud/3rdparty/pear/archive_tar:/var/www/cloud/3rdparty/pear/console_getopt:/var/www/cloud/3rdparty/pear/pear-core-minimal/src:/var/www/cloud/3rdparty/pear/pear_exception:/var/www/cloud/apps') at /var/www/cloud/apps/maps/lib/AppInfo/Application.php#48

PROPFIND /remote.php/dav/files/3A60C52D-9415-4F28-A2B7-71A8CBD7A9E3/KSV
from 192.168.10.2 at 2023-03-03T09:14:47+01:00
        public function register(IRegistrationContext $context): void {
                // ... registration logic goes here ...

                // Register the composer autoloader for packages shipped by this app, if applicable
                include_once __DIR__ . '/../../vendor/autoload.php';
                $context->registerEventListener(
                        LoadAdditionalScriptsEvent::class,
                        LoadAdditionalScriptsListener::class

But I wasn't able to find this file.
May I ask what exactly does this autoload.php?

@tacruc
Copy link
Collaborator

tacruc commented Mar 3, 2023

Sorry maybe I forgot, you should probably also run
make
to install the php dependencies. But this is what is failing in the test https://github.com/nextcloud/maps/actions/runs/4315929083/jobs/7531002675#step:8:25

@derritter88
Copy link
Author

Thanks - the make command removed the error messages.
As you have mentioned it also showed the dependency error.

With my little dev knowledge I have just done what the shell recommended and ran composer update which downloaded new versions of the dependencies.

After that the whole make process was running without any error message regarding maps.
Only some I guess general PHP warning messages appeared:

Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Symfony/Component/Console/Command/DumpCompletionCommand.php:48
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Symfony/Component/Console/Command/DumpCompletionCommand.php:56
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:879
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:884

I then moved the compiled maps app to Nextcloud and enabled it.
It runs, there are no errors and also the tiles are moving as expected.

@tacruc
Copy link
Collaborator

tacruc commented Mar 3, 2023

Yes the problem is that after composer update
make fails on php8.0 and php7.4
Dropping php7.4 is fine for me, but I would like to provide one release with php8.0 before dropping the support.

@tacruc
Copy link
Collaborator

tacruc commented Mar 3, 2023

Also NC25 supports php8.0 and php8.1, but not php8.2

@derritter88
Copy link
Author

Ah okay so the issue comes from older PHP versions..

Would it work to ship dependencies for more PHP versions within the same app and the client uses the right one depending on the local version?

@tacruc
Copy link
Collaborator

tacruc commented Mar 3, 2023

I don't know how.
It might even be that some release I between supports both.

@nodiscc
Copy link

nodiscc commented Jun 19, 2023

@tacruc Is it possible to release a new version that supports PHP8.2/Nextcloud 26?

I understand that the nightly releases are already supposed to support it (correct?), but they cannot be installed through occ as far as I know.

This prevents me from upgrading to Nextcloud 26 (or I would have to disable the app). In turn, this prevents me from upgrading to Debian 12, as the only supported PHP version in Debian 12 is 8.2.

Or is there something blocking for a new release?

Thanks in advance.

@tacruc
Copy link
Collaborator

tacruc commented Jun 25, 2023

Could you test v1.1.0-nightly?

@tacruc tacruc closed this as completed Jul 2, 2023
@nodiscc
Copy link

nodiscc commented Jul 21, 2023

Sorry for the late feedback, it appears to work perfectly, thanks!

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

No branches or pull requests

3 participants