nextcloud / nextcloud/maps

[Bug]: Error when reshare a remote shared file with Maps enabled: `Call to a member function getUID() on null in file '[...]/maps/lib/Service/PhotofilesService.php' line 92`

Open
#1,427 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
JavaScript
Stars
598
Forks
113
PR merge metrics
No merged PRs in 30d

Description

⚠️ This issue respects the following points: ⚠️
Bug description

When trying to reshare (by link or to an user) a file in a folder shared by another NC instance to my user lead to an error 500

Steps to reproduce

1.Share a folder to a remote account, from a NC instance 1 to instance 2, with the reshare right.
2. On the instance 2, try to share a file in this folder to a user of the instance 2 or by link
3. See the error 500 in the console log and in the NC journal

Expected behavior

Maps don't interfere with shares

Installation method

Manual installation

Operating system

Debian/Ubuntu

PHP engine version

Other

Web server

Nginx

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?

Encryption is Disabled

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report

List of activated Apps
- activity: 3.0.0
  - announcementcenter: 7.1.3
  - app_api: 4.0.6
  - bruteforcesettings: 3.0.0
  - calendar: 5.3.3
  - calendar_resource_management: 0.9.0
  - circles: 30.0.0
  - cloud_federation_api: 1.13.0
  - collectives: 2.18.0
  - comments: 1.20.1
  - contacts: 7.1.3
  - contactsinteraction: 1.11.0
  - cospend: 3.0.11
  - dashboard: 7.10.0
  - data_request: 2.0.1
  - dav: 1.31.1
  - deck: 1.14.5
  - drawio: 3.0.9
  - drop_account: 2.7.1
  - federatedfilesharing: 1.20.0
  - federation: 1.20.0
  - files: 2.2.0
  - files_downloadlimit: 3.0.0
  - files_external: 1.22.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - fileslibreofficeedit: 2.0.1
  - firstrunwizard: 3.0.0
  - forms: 5.1.0
  - groupfolders: 18.1.2
  - impersonate: 1.17.1
  - integration_dropbox: 3.1.0
  - integration_gitlab: 3.2.0
  - integration_google: 3.2.0
  - integration_openstreetmap: 2.1.0
  - intros: 1.1.2
  - keeweb: 0.6.21
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - maps: 1.5.0
  - nextcloud_announcements: 2.0.0
  - notifications: 3.0.0
  - notify_push: 1.1.0
  - oauth2: 1.18.1
  - password_policy: 2.0.0
  - photos: 3.0.2
  - polls: 7.4.4
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - quota_warning: 1.21.0
  - recommendations: 3.0.0
  - registration: 2.7.0
  - related_resources: 1.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - side_menu: 4.1.1
  - spreed: 20.1.7
  - survey_client: 2.0.0
  - suspicious_login: 8.0.0
  - systemtags: 1.20.0
  - tables: 0.9.3
  - tasks: 0.16.1
  - text: 4.1.0
  - theming: 2.6.0
  - theming_customcss: 1.18.0
  - timemanager: 0.3.18
  - twofactor_backupcodes: 1.19.0
  - updatenotification: 1.20.0
  - uppush: 2.3.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - webhook_listeners: 1.1.0-dev
  - workflow_ocr: 1.30.1
  - workflowengine: 2.12.0
Nextcloud Signing status

Nextcloud Logs
Paramètres d'administration: Journalisation
Lecteur de journaux
Message
Actions de journalisation entrantes
Erreur
	no app in context
	
Exception Call to a member function getUID() on null in file '/srv/nextcloud/apps/maps/lib/Service/PhotofilesService.php' line 92
18 juin 2025, 22:46:07
	
Erreur
	no app in context
	
Exception Call to a member function getUID() on null in file '/srv/nextcloud/apps/maps/lib/Service/PhotofilesService.php' line 92
18 juin 2025, 22:45:20
	
Erreur
	no app in context
	
Exception Call to a member function getUID() on null in file '/srv/nextcloud/apps/maps/lib/Service/PhotofilesService.php' line 92
18 juin 2025, 22:27:44
	
Erreur
	no app in context
	
Exception Call to a member function getUID() on null in file '/srv/nextcloud/apps/maps/lib/Service/PhotofilesService.php' line 92
18 juin 2025, 22:27:44
	
Erreur
	webdav
	
NoUserException User not found in backend
18 juin 2025, 22:14:45
	
Erreur
	webdav
	
NoUserException User not found in backend
18 juin 2025, 22:14:45
	
Erreur
	webdav
	
NoUserException User not found in backend
18 juin 2025, 22:14:29
	
Erreur
	webdav
	
NoUserException User not found in backend
18 juin 2025, 22:14:29
	
Erreur
	no app in context
	
Exception array_merge(): Argument #2 must be of type array, null given in file '/srv/nextcloud/apps/spreed/lib/Files/Util.php' line 56
18 juin 2025, 22:14:14
	
Erreur
	no app in context
	
Exception array_merge(): Argument #2 must be of type array, null given in file '/srv/nextcloud/apps/spreed/lib/Files/Util.php' line 56
18 juin 2025, 22:14:14
	
Erreur
	no app in context
	
Exception array_merge(): Argument #2 must be of type array, null given in file '/srv/nextcloud/apps/spreed/lib/Files/Util.php' line 56
18 juin 2025, 22:14:14
	
Erreur
	no app in context
	
Exception array_merge(): Argument #2 must be of type array, null given in file '/srv/nextcloud/apps/spreed/lib/Files/Util.php' line 56
18 juin 2025, 22:14:14
	
Erreur
	no app in context
	
Exception Call to a member function getUID() on null in file '/srv/nextcloud/apps/maps/lib/Service/PhotofilesService.php' line 92
18 juin 2025, 21:50:04
	
Erreur
	no app in context
	
Exception Call to a member function getUID() on null in file '/srv/nextcloud/apps/maps/lib/Service/PhotofilesService.php' line 92
18 juin 2025, 21:50:04
	
Erreur
	webdav
	
NoUserException User not found in backend
18 juin 2025, 21:47:11
	
Erreur
	webdav
	
NoUserException User not found in backend
18 juin 2025, 21:47:11
	
Erreur
	webdav
	
NoUserException User not found in backend
18 juin 2025, 21:43:08
	
Erreur
	webdav
	
NoUserException User not found in backend
18 juin 2025, 21:43:08
	
Erreur
	webdav
	
NoUserException User not found in backend
18 juin 2025, 21:42:16
	
Erreur
	webdav
	
NoUserException User not found in backend
18 juin 2025, 21:42:16
	
Erreur
	webdav
	
NoUserException User not found in backend
18 juin 2025, 21:41:53
	
Erreur
	webdav
	
NoUserException User not found in backend
18 juin 2025, 21:41:53
	
Erreur
	webdav
	
NoUserException User not found in backend
18 juin 2025, 21:41:43
	
Chargement des anciennes entrées de journaux

Niveau
    Erreur
App
    no app in context 
Date et heure
    18 juin 2025, 22:45:20

Exception Call to a member function getUID() on null in file '/srv/nextcloud/apps/maps/lib/Service/PhotofilesService.php' line 92

    /srv/nextcloud/lib/private/AppFramework/App.phpLigne 161

    OC\AppFramework\Http\Dispatcher->dispatch()

    /srv/nextcloud/lib/private/Route/Router.phpLigne 303

    OC\AppFramework\App::main()

    /srv/nextcloud/ocs/v1.phpLigne 44

    OC\Route\Router->match()

    /srv/nextcloud/ocs/v2.phpLigne 8

    undefinedundefinedrequire_once(
      "/srv/nextcloud/ocs/v1.php"
    )

Causé par Error Call to a member function getUID() on null
Entrée brute dans le journal

{
  "reqId": "27PvCNyRlFD7Mb0Tp6Wk",
  "level": 3,
  "time": "2025-06-18T20:45:20+00:00",
  "remoteAddr": "10.12.200.200",
  "user": "wargreen",
  "app": "no app in context",
  "method": "POST",
  "url": "/ocs/v2.php/apps/files_sharing/api/v1/shares",
  "message": "Call to a member function getUID() on null in file '/srv/nextcloud/apps/maps/lib/Service/PhotofilesService.php' line 92",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0",
  "version": "30.0.12.2",
  "exception": {
    "Exception": "Exception",
    "Message": "Call to a member function getUID() on null in file '/srv/nextcloud/apps/maps/lib/Service/PhotofilesService.php' line 92",
    "Code": 0,
    "Trace": [
      {
        "file": "/srv/nextcloud/lib/private/AppFramework/App.php",
        "line": 161,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/srv/nextcloud/lib/private/Route/Router.php",
        "line": 303,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/srv/nextcloud/ocs/v1.php",
        "line": 44,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/srv/nextcloud/ocs/v2.php",
        "line": 8,
        "args": [
          "/srv/nextcloud/ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/srv/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
    "Line": 146,
    "Previous": {
      "Exception": "Error",
      "Message": "Call to a member function getUID() on null",
      "Code": 0,
      "Trace": [
        {
          "file": "/srv/nextcloud/apps/maps/lib/Hooks/FileHooks.php",
          "line": 123,
          "function": "addByFile",
          "class": "OCA\\Maps\\Service\\PhotofilesService",
          "type": "->"
        },
        {
          "file": "/srv/nextcloud/lib/private/legacy/OC_Hook.php",
          "line": 82,
          "function": "postShare",
          "class": "OCA\\Maps\\Hooks\\FileHooks",
          "type": "->"
        },
        {
          "file": "/srv/nextcloud/lib/private/Share20/LegacyHooks.php",
          "line": 142,
          "function": "emit",
          "class": "OC_Hook",
          "type": "::"
        },
        {
          "file": "/srv/nextcloud/lib/private/Share20/LegacyHooks.php",
          "line": 39,
          "function": "postShare",
          "class": "OC\\Share20\\LegacyHooks",
          "type": "->"
        },
        {
          "file": "/srv/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
          "line": 220,
          "function": "OC\\Share20\\{closure}",
          "class": "OC\\Share20\\LegacyHooks",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/srv/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
          "line": 56,
          "function": "callListeners",
          "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
          "type": "->"
        },
        {
          "file": "/srv/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",
          "line": 67,
          "function": "dispatch",
          "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
          "type": "->"
        },
        {
          "file": "/srv/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",
          "line": 79,
          "function": "dispatch",
          "class": "OC\\EventDispatcher\\EventDispatcher",
          "type": "->"
        },
        {
          "file": "/srv/nextcloud/lib/private/Share20/Manager.php",
          "line": 761,
          "function": "dispatchTyped",
          "class": "OC\\EventDispatcher\\EventDispatcher",
          "type": "->"
        },
        {
          "file": "/srv/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php",
          "line": 795,
          "function": "createShare",
          "class": "OC\\Share20\\Manager",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/srv/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 208,
          "function": "createShare",
          "class": "OCA\\Files_Sharing\\Controller\\ShareAPIController",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/srv/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 114,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/srv/nextcloud/lib/private/AppFramework/App.php",
          "line": 161,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/srv/nextcloud/lib/private/Route/Router.php",
          "line": 303,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::"
        },
        {
          "file": "/srv/nextcloud/ocs/v1.php",
          "line": 44,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->"
        },
        {
          "file": "/srv/nextcloud/ocs/v2.php",
          "line": 8,
          "args": [
            "/srv/nextcloud/ocs/v1.php"
          ],
          "function": "require_once"
        }
      ],
      "File": "/srv/nextcloud/apps/maps/lib/Service/PhotofilesService.php",
      "Line": 92
    },
    "message": "Call to a member function getUID() on null in file '/srv/nextcloud/apps/maps/lib/Service/PhotofilesService.php' line 92",
    "exception": [],
    "CustomMessage": "Call to a member function getUID() on null in file '/srv/nextcloud/apps/maps/lib/Service/PhotofilesService.php' line 92"
  },
  "id": "68532595a47dc"
}
Browser Console
Error while creating share 
code: "ERR_BAD_RESPONSE"
​
config: Object { timeout: 0, xsrfCookieName: "XSRF-TOKEN", xsrfHeaderName: "X-XSRF-TOKEN", … }
​
message: "Request failed with status code 500"

data: '<?xml version="1.0"?>\n<ocs>\n <meta>\n  <status>failure</status>\n  <statuscode>500</statuscode>\n  <message>Internal Server Error\n</message>\n </meta>\n <data/>\n</ocs>\n'
Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at apps/maps/lib/Service/PhotofilesService.php line 92 and follow the call from apps/maps/lib/Hooks/FileHooks.php line 123 during the POST /ocs/v2.php/apps/files_sharing/api/v1/shares request. Reproduce the remote shared-folder reshare described in the issue and verify that sharing succeeds without a 500 error or Maps-related exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.