Allowed memory size exhausted running occ maps:scan-photos
Open
Nobody has claimed this yet.
0. Needs triage
bug
feature: 🖼 photos
performance
- Dominant language
- JavaScript
- Stars
- 598
- Forks
- 113
- PR merge metrics
- No merged PRs in 30d
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- Maps app is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
Have around 800k photos and running map version 1.0.2 on Nextcloud 25.0.5. I realize not all the photos are showing in the map so I ran the occ cmd and I get.
PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Result.php on line 121
{"reqId":"tEjayR76q1BY31SxzE1J","level":3,"time":"March 26, 2023 15:32:39","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Allowed memory size of 2147483648 bytes exhausted (tried to allocate 20480 bytes) at /var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Result.php#121","userAgent":"--","version":"25.0.5.1","data":{"app":"PHP"}}
I am guessing the number of photos lead to this?
Steps to reproduce
- run the cmd occ maps:scan-photos
Expected behavior
All photos being scanned
Installation method
None
Operating system
None
PHP engine version
PHP 8.1
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?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
No response
List of activated Apps
- activity: 2.17.0
- admin_audit: 1.15.0
- audioplayer: 3.3.1
- bruteforcesettings: 2.5.0
- calendar: 4.3.1
- camerarawpreviews: 0.8.1
- cloud_federation_api: 1.8.0
- comments: 1.15.0
- contacts: 5.2.0
- contactsinteraction: 1.6.0
- dav: 1.24.0
- federatedfilesharing: 1.15.0
- files: 1.20.1
- files_accesscontrol: 1.15.1
- files_downloadactivity: 1.16.0
- files_external: 1.17.0
- files_pdfviewer: 2.6.0
- files_rightclick: 1.4.0
- files_sharing: 1.17.0
- files_trashbin: 1.15.0
- files_versions: 1.18.0
- firstrunwizard: 2.14.0
- groupfolders: 13.1.1
- groupquota: 0.1.10
- logreader: 2.10.0
- lookup_server_connector: 1.13.0
- maps: 1.0.2
- memories: 4.12.4
- metadata: 0.17.0
- music: 1.8.1
- nextcloud_announcements: 1.14.0
- notifications: 2.13.1
- oauth2: 1.13.0
- password_policy: 1.15.0
- photos: 2.0.1
- previewgenerator: 5.2.1
- privacy: 1.9.0
- provisioning_api: 1.15.0
- ransomware_protection: 1.14.0
- related_resources: 1.0.4
- richdocuments: 7.1.2
- serverinfo: 1.15.0
- settings: 1.7.0
- spreed: 15.0.4
- support: 1.8.0
- survey_client: 1.13.0
- suspicious_login: 4.3.0
- systemtags: 1.15.0
- tasks: 0.14.5
- text: 3.6.0
- theming: 2.0.1
- twofactor_backupcodes: 1.14.0
- twofactor_totp: 7.0.0
- twofactor_webauthn: 1.1.2
- updatenotification: 1.15.0
- user_status: 1.5.0
- viewer: 1.9.0
- workflowengine: 2.7.0
Nextcloud Signing status
No response
Nextcloud Logs
No response
Browser Console
No response
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the occ maps:scan-photos entry point and reproduce the failure using the reported large photo collection. Inspect the memory exhaustion at 3rdparty/doctrine/dbal/src/Driver/PDO/Result.php line 121; done means all photos are scanned without the fatal error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mariadb, php
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100