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

[Bug]: OCC Command breaks when maps is enabled #1128

Closed
6 of 9 tasks
aletsch opened this issue Sep 21, 2023 · 9 comments
Closed
6 of 9 tasks

[Bug]: OCC Command breaks when maps is enabled #1128

aletsch opened this issue Sep 21, 2023 · 9 comments

Comments

@aletsch
Copy link

aletsch commented Sep 21, 2023

⚠️ This issue respects the following points: ⚠️

Bug description

The occ command stops working when nextcloud maps app is active. No matter the occ command it throws the same error.

sudo -u www-data php --define apc.enable_cli=1 occ -h
An unhandled exception has been thrown:
OC\AppFramework\Utility\QueryNotFoundException: Could not resolve OCA\Maps\Service\MimetypeService! Class "OCA\Maps\Service\MimetypeService" does not exist in /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php:131
Stack trace:
#0 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(142): OC\AppFramework\Utility\SimpleContainer->resolve()
#1 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#2 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(97): OC\ServerContainer->query()
#3 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#4 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(84): array_map()
#5 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(124): OC\AppFramework\Utility\SimpleContainer->buildClass()
#6 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(142): OC\AppFramework\Utility\SimpleContainer->resolve()
#7 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#8 /var/www/nextcloud/lib/private/Console/Application.php(217): OC\ServerContainer->query()
#9 /var/www/nextcloud/lib/private/Console/Application.php(131): OC\Console\Application->loadCommandsFromInfoXml()
#10 /var/www/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#11 /var/www/nextcloud/occ(11): require_once('...')
#12 {main}

Next OCP\AppFramework\QueryException: Could not resolve OCA\Maps\Service\MimetypeService! Class "OCA\Maps\Service\MimetypeService" does not exist in /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php:110
Stack trace:
#0 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#1 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(84): array_map()
#2 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(124): OC\AppFramework\Utility\SimpleContainer->buildClass()
#3 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(142): OC\AppFramework\Utility\SimpleContainer->resolve()
#4 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#5 /var/www/nextcloud/lib/private/Console/Application.php(217): OC\ServerContainer->query()
#6 /var/www/nextcloud/lib/private/Console/Application.php(131): OC\Console\Application->loadCommandsFromInfoXml()
#7 /var/www/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#8 /var/www/nextcloud/occ(11): require_once('...')
#9 {main}

Next Exception: Failed to construct console command 'OCA\Maps\Command\RegisterMimetypes': Could not resolve OCA\Maps\Service\MimetypeService! Class "OCA\Maps\Service\MimetypeService" does not exist in /var/www/nextcloud/lib/private/Console/Application.php:223
Stack trace:
#0 /var/www/nextcloud/lib/private/Console/Application.php(131): OC\Console\Application->loadCommandsFromInfoXml()
#1 /var/www/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#2 /var/www/nextcloud/occ(11): require_once('...')
#3 {main}

Steps to reproduce

  1. install nextcloud maps
  2. enable the nexctloud maps app
  3. try to use any occ command

Expected behavior

The occ commands should work as expected.

Installation method

Manual installation

Operating system

Debian/Ubuntu

PHP engine version

Other

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install of the server?

None

Is this bug present after an update or on a fresh install of the app?

Fresh Nextcloud Maps install (never installed before)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

This config is with nextcloud maps deactivated.

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "192.168.1.*",
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED_FOR"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "26.0.7.0",
        "overwrite.cli.url": "https:\/\/***REMOVED SENSITIVE VALUE***:443",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "has_rebuilt_cache": true,
        "theme": "",
        "loglevel": 1,
        "log_type": "file",
        "log_file": "\/var\/www\/nextcloud\/data\/nextcloud.log",
        "overwriteprotocol": "https",
        "mysql.utf8mb4": true,
        "defaultapp": "activity",
        "memcache.distributed": "\\OC\\Memcache\\APCu",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "updater.release.channel": "stable",
        "app_install_overwrite": [
            "spreed",
            "podcast",
            "documentserver_community",
            "mindmap_app",
            "quickaccesssorting",
            "apporder"
        ],
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_sendmailmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "default_phone_region": "DE",
        "preview_max_x": 4096,
        "preview_max_y": 4096,
        "preview_max_memory": 4096,
        "preview_max_filesize_image": 256,
        "memories.exiftool": "\/var\/www\/nextcloud\/apps\/memories\/lib\/..\/exiftool-bin\/exiftool-amd64-glibc",
        "memories.ffmpeg_path": "\/usr\/bin\/ffmpeg",
        "memories.ffprobe_path": "\/usr\/bin\/ffprobe",
        "memories.transcoder": "\/var\/www\/nextcloud\/apps\/memories\/exiftool-bin\/go-vod-amd64",
        "memories.no_transcode": false,
        "memories.qsv": false,
        "memories.vod.path": "\/var\/www\/nextcloud\/apps\/memories\/exiftool-bin\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated Apps

This list of apps is with nextcloud maps deactivated.

Enabled:
  - activity: 2.18.0
  - announcementcenter: 6.6.2
  - bruteforcesettings: 2.6.0
  - calendar: 4.5.1
  - carnet: 0.25.2
  - checksum: 1.2.2
  - circles: 26.0.0
  - cloud_federation_api: 1.9.0
  - comments: 1.16.0
  - contacts: 5.4.1
  - contactsinteraction: 1.7.0
  - cookbook: 0.10.2
  - cospend: 1.5.10
  - dashboard: 7.6.0
  - dav: 1.25.0
  - deck: 1.9.3
  - drawio: 2.1.2
  - event_update_notification: 2.2.0
  - external: 5.1.1
  - federatedfilesharing: 1.16.0
  - federation: 1.16.0
  - files: 1.21.1
  - files_automatedtagging: 1.16.1
  - files_downloadactivity: 1.16.0
  - files_external: 1.18.0
  - files_mindmap: 0.0.28
  - files_pdfviewer: 2.7.0
  - files_retention: 1.15.0
  - files_rightclick: 1.5.0
  - files_sharing: 1.18.0
  - files_trashbin: 1.16.0
  - files_versions: 1.19.1
  - firstrunwizard: 2.15.0
  - forms: 3.3.1
  - gpoddersync: 3.8.1
  - integration_discourse: 2.0.4
  - integration_github: 2.0.6
  - integration_gitlab: 1.0.18
  - integration_mastodon: 2.0.2
  - integration_onedrive: 3.0.0
  - integration_reddit: 2.0.1
  - logreader: 2.11.0
  - lookup_server_connector: 1.14.0
  - mail: 3.4.0
  - metadata: 0.19.0
  - news: 23.0.0
  - nextcloud_announcements: 1.15.0
  - notes: 4.8.1
  - notifications: 2.14.0
  - oauth2: 1.14.1
  - password_policy: 1.16.0
  - passwords: 2023.9.30
  - photos: 2.2.0
  - previewgenerator: 5.3.0
  - privacy: 1.10.0
  - provisioning_api: 1.16.0
  - quicknotes: 0.8.10
  - quota_warning: 1.17.0
  - recognize: 4.3.2
  - recommendations: 1.5.0
  - related_resources: 1.1.0
  - richdocuments: 8.0.4
  - richdocumentscode: 23.5.301
  - serverinfo: 1.16.0
  - settings: 1.8.0
  - spreed: 16.0.6
  - survey_client: 1.14.0
  - suspicious_login: 4.4.0
  - systemtags: 1.16.0
  - tasks: 0.15.0
  - text: 3.7.2
  - theming: 2.1.1
  - twofactor_backupcodes: 1.15.0
  - twofactor_webauthn: 1.2.0
  - updatenotification: 1.16.0
  - user_status: 1.6.0
  - viewer: 1.10.0
  - weather_status: 1.6.0
  - welcome: 1.0.10
  - workflowengine: 2.8.0
Disabled:
  - admin_audit: 1.16.0
  - admin_notifications: 1.0.2 (installed 1.0.2)
  - appointments: 1.15.3 (installed 1.15.3)
  - apporder: 0.15.0 (installed 0.15.0)
  - bookmarks: 13.1.1 (installed 13.1.1)
  - breezedark: 26.0.1 (installed 26.0.1)
  - documentserver_community: 0.1.13 (installed 0.1.13)
  - encryption: 2.14.0
  - end_to_end_encryption: 1.12.5 (installed 1.12.5)
  - epubreader: 1.4.7 (installed 1.4.7)
  - extract: 1.3.6 (installed 1.3.6)
  - files_markdown: 2.4.1 (installed 2.4.1)
  - flowupload: 1.1.3 (installed 1.1.3)
  - integration_moodle: 1.0.2 (installed 1.0.2)
  - keeweb: 0.6.13 (installed 0.6.13)
  - ldap_contacts_backend: 1.6.0 (installed 1.6.0)
  - maps: 1.1.1 (installed 1.1.1)
  - memories: 5.4.1 (installed 5.4.1)
  - polls: 5.3.2 (installed 5.3.2)
  - ransomware_protection: 1.14.0 (installed 1.14.0)
  - riotchat: 0.16.0 (installed 0.16.0)
  - sharebymail: 1.16.0 (installed 1.8.0)
  - social: 0.6.1 (installed 0.6.1)
  - socialsharing_email: 2.6.0 (installed 2.6.0)
  - support: 1.9.0 (installed 1.8.0)
  - talk_matterbridge: 1.26.0 (installed 1.26.0)
  - talk_simple_poll: 1.3.1 (installed 1.3.1)
  - twofactor_totp: 8.0.0
  - user_ldap: 1.16.0
  - user_usage_report: 1.10.0 (installed 1.10.0)
  - video_converter: 1.0.6 (installed 1.0.6)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

No response

Browser Console

No response

Additional info

PHP Version is 8.2

@tacruc
Copy link
Collaborator

tacruc commented Sep 22, 2023

@aletsch your running the master branch of maps or?

@aletsch
Copy link
Author

aletsch commented Sep 22, 2023

@tacruc Yes it is the master branch

sudo -u www-data git branch --show-current
master

@aletsch aletsch closed this as completed Sep 22, 2023
@aletsch aletsch reopened this Sep 22, 2023
@tacruc
Copy link
Collaborator

tacruc commented Sep 22, 2023

@aletsch thanks for your report I guess it was PR. #1118

@tacruc tacruc closed this as completed in fd8992d Sep 26, 2023
@aletsch
Copy link
Author

aletsch commented Oct 18, 2023

Today i managed to test the new update. I made a git pull and disabled and reenabled the maps app but sadly the problem still persists:

sudo -u www-data php --define apc.enable_cli=1 occ -h
An unhandled exception has been thrown:
OC\AppFramework\Utility\QueryNotFoundException: Could not resolve OCA\Maps\Service\MimetypeService! Class "OCA\Maps\Service\MimetypeService" does not exist in /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php:131
Stack trace:
#0 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(142): OC\AppFramework\Utility\SimpleContainer->resolve()
#1 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#2 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(97): OC\ServerContainer->query()
#3 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#4 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(84): array_map()
#5 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(124): OC\AppFramework\Utility\SimpleContainer->buildClass()
#6 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(142): OC\AppFramework\Utility\SimpleContainer->resolve()
#7 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#8 /var/www/nextcloud/lib/private/Console/Application.php(217): OC\ServerContainer->query()
#9 /var/www/nextcloud/lib/private/Console/Application.php(131): OC\Console\Application->loadCommandsFromInfoXml()
#10 /var/www/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#11 /var/www/nextcloud/occ(11): require_once('...')
#12 {main}

Next OCP\AppFramework\QueryException: Could not resolve OCA\Maps\Service\MimetypeService! Class "OCA\Maps\Service\MimetypeService" does not exist in /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php:110
Stack trace:
#0 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#1 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(84): array_map()
#2 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(124): OC\AppFramework\Utility\SimpleContainer->buildClass()
#3 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(142): OC\AppFramework\Utility\SimpleContainer->resolve()
#4 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#5 /var/www/nextcloud/lib/private/Console/Application.php(217): OC\ServerContainer->query()
#6 /var/www/nextcloud/lib/private/Console/Application.php(131): OC\Console\Application->loadCommandsFromInfoXml()
#7 /var/www/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#8 /var/www/nextcloud/occ(11): require_once('...')
#9 {main}

Next Exception: Failed to construct console command 'OCA\Maps\Command\RegisterMimetypes': Could not resolve OCA\Maps\Service\MimetypeService! Class "OCA\Maps\Service\MimetypeService" does not exist in /var/www/nextcloud/lib/private/Console/Application.php:223
Stack trace:
#0 /var/www/nextcloud/lib/private/Console/Application.php(131): OC\Console\Application->loadCommandsFromInfoXml()
#1 /var/www/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#2 /var/www/nextcloud/occ(11): require_once('...')

when disabling the maps app it works again:

sudo -u www-data php --define apc.enable_cli=1 occ -h
Description:
  List commands

Usage:
  list [options] [--] [<namespace>]

Arguments:
  namespace            The namespace name

Options:
      --raw            To output raw command list
      --format=FORMAT  The output format (txt, xml, json, or md) [default: "txt"]

Help:
  The list command lists all commands:
  
    php occ list
  
  You can also display the commands for a specific namespace:
  
    php occ list test
  
  You can also output the information in other formats by using the --format option:
  
    php occ list --format=xml
  
  It's also possible to get raw list of commands (useful for embedding command runner):

The git branch is still master:

sudo -u www-data git branch --show-current
master

Do i need to do anything else besides git pull for updating?

@tacruc tacruc reopened this Oct 18, 2023
@tacruc tacruc self-assigned this Oct 18, 2023
@tacruc
Copy link
Collaborator

tacruc commented Oct 18, 2023

Do i need to do anything else besides git pull for updating?
No ?!

But the issue is wired. I will see if I can reproduce it.
You're in the maps folder when doing the pull?
Can you show
git remote get-url --all origin

@aletsch
Copy link
Author

aletsch commented Oct 25, 2023

Hi sorry for the long response times. This is what i get:

sudo -u www-data git remote get-url --all origin
https://github.com/nextcloud/maps.git

@tacruc
Copy link
Collaborator

tacruc commented Oct 25, 2023

Does this file:
lib/Service/MimetypeService.php exits in your maps folder?
https://github.com/nextcloud/maps/blob/master/lib/Service/MimetypeService.php

@aletsch
Copy link
Author

aletsch commented Oct 25, 2023

Mhhh no seems like it's missing

ls -alF /var/www/nextcloud/apps/maps/lib/Service
drwxr-x---  2 www-data www-data  4096 Sep 21 19:58 ./
drwxr-x--- 13 www-data www-data  4096 Sep 21 19:58 ../
-rw-r-----  1 www-data www-data 13015 Sep 21 19:58 AddressService.php
-rw-r-----  1 www-data www-data 27280 Sep 21 19:58 DevicesService.php
-rw-r-----  1 www-data www-data 38204 Sep 21 19:58 FavoritesService.php
-rw-r-----  1 www-data www-data 16848 Sep 21 19:58 GeophotoService.php
-rw-r-----  1 www-data www-data  7342 Sep 21 19:58 MyMapsService.php
-rw-r-----  1 www-data www-data 20194 Sep 21 19:58 PhotofilesService.php
-rw-r-----  1 www-data www-data 36655 Sep 21 19:58 TracksService.php

I try adding it manually and test if occ works again.

@aletsch
Copy link
Author

aletsch commented Oct 25, 2023

Well thanks a lot for the help this seemed to fix my problem 👍

After manually inserting the file, occ commands now work even with "maps" enabled.

@aletsch aletsch closed this as completed Oct 25, 2023
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

2 participants