Auto upload to external storage from ios nextcloud fails with internal server error (500)

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 25.0.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 18.04.6 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.54
PHP version (eg, 7.4): PHP 7.4.32
nextcloud Liquid for iOS 4.5.6.4

The issue you are facing:
When auto uploading to a remote storage from Nexcloud ios, I get the err 500 Internal server error.
Still, one copy of the file is uploaded to the auto upload destination.
Also “manual” upload to remote storage fails in the same manner.
If I do a manual upload to a folder on local disk (on nexcloud server) I have no problem.
I have done no changes exept auto upgrade on my Ios-phone (13) and manual upgrade of nextcloud.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Set auto upload folder to one on a remote storage
  2. auto or manually upload a file to that folder.

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '<instance ID>',
  'passwordsalt' => '<salt password>',
  'secret' => '<some hash secret>',
  'trusted_domains' => 
  array (
    0 => '<server 1>',
    1 => '<server 2>',
  ),
  'datadirectory' => '/data/files/data',
  'dbtype' => 'mysql',
  'version' => '25.0.1.1',
  'overwrite.cli.url' => 'https://<nexcloud server domain name FQDN>',
  'dbname' => 'database name',
  'dbhost' => '<database host name FQDN>',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_nextcloud',
  'default_phone_region' => 'ISO 3166-2:NO',
  'dbpassword' => '<database password>',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => '<domain FQDN>',
  'mail_smtphost' => '<mailserver FQDN>',
  'mail_smtpport' => '<port>',
  'maintenance' => false,
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
    0 => 'ekstern familie',
  ),
  'theme' => '',
  'loglevel' => 1,
  'trusted_proxies' => 
  array (
    0 => '',
  ),
  'forwarded_for_headers' => 
  array (
    0 => 'HTTP_X_FORWARDED_FOR',
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'app_install_overwrite' => 
  array (
    0 => 'githubmergetracker',
    1 => 'impersonate',
  ),
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '<userid>',
  'mail_smtppassword' => '<password>',
);

The output of your Apache/nginx/system log in /var/log/____:

The Apache access log contains the following:
`x.x.x.x - georg [24/Nov/2022:19:29:21 +0100] "PUT /remote.php/dav/files/georg/georg/telefon/2022/11/22-11-24%2019-29-04%209855.jpg HTTP/1.1" 500 6059 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/4.5.6"`

The path here is wrong, the subfolder 'georg' appears twice for some reason

PASTE HERE

Admin logging from GUI:

[PHP] Feil: Error: fopen(sftpread://cygdrive/e/shares/home/georg//bilder/22-11-24 20-25-13 9857.jpg): failed to open stream: &quot;OCA\Files_External\Lib\Storage\SFTPReadStream::stream_open&quot; call failed at /var/www/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php#381 at <<closure>>

 0. <<closure>>
    OC\Log\ErrorHandler::onError()
 1. /var/www/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php line 381
    fopen()
 2. /var/www/nextcloud/lib/private/Files/Storage/Common.php line 199
    OCA\Files_External\Lib\Storage\SFTP->fopen()
 3. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 247
    OC\Files\Storage\Common->file_get_contents()
 4. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 247
    OC\Files\Storage\Wrapper\Wrapper->file_get_contents()
 5. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php line 264
    OC\Files\Storage\Wrapper\Wrapper->file_get_contents()
 6. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 247
    OC\Files\Storage\Wrapper\Availability->file_get_contents()
 7. /var/www/nextcloud/lib/private/Files/View.php line 1181
    OC\Files\Storage\Wrapper\Wrapper->file_get_contents()
 8. /var/www/nextcloud/lib/private/Files/View.php line 600
    OC\Files\View->basicOperation()
 9. /var/www/nextcloud/lib/private/Files/Node/File.php line 56
    OC\Files\View->file_get_contents()
10. /var/www/nextcloud/lib/private/Metadata/Provider/ExifProvider.php line 71
    OC\Files\Node\File->getContent()
11. /var/www/nextcloud/lib/private/Metadata/MetadataManager.php line 68
    OC\Metadata\Provider\ExifProvider->execute()
12. /var/www/nextcloud/lib/private/Metadata/FileEventListener.php line 101
    OC\Metadata\MetadataManager->generateMetadata()
13. /var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php line 87
    OC\Metadata\FileEventListener->handle()
14. /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 251
    OC\EventDispatcher\ServiceEventListener->__invoke()
15. /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 73
    Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
16. /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php line 88
    Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
17. /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php line 100
    OC\EventDispatcher\EventDispatcher->dispatch()
18. /var/www/nextcloud/lib/private/Files/Node/HookConnector.php line 118
    OC\EventDispatcher\EventDispatcher->dispatchTyped()
19. /var/www/nextcloud/lib/private/legacy/OC_Hook.php line 106
    OC\Files\Node\HookConnector->postWrite()
20. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php line 471
    OC_Hook::emit()
21. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php line 398
    OCA\DAV\Connector\Sabre\File->emitPostHooks()
22. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1137
    OCA\DAV\Connector\Sabre\File->put()
23. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 492
    Sabre\DAV\Server->updateFile("*** sensitive parameters replaced ***")
24. /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    Sabre\DAV\CorePlugin->httpPut()
25. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 472
    Sabre\DAV\Server->emit()
26. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 253
    Sabre\DAV\Server->invokeMethod()
27. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 321
    Sabre\DAV\Server->start()
28. /var/www/nextcloud/apps/dav/lib/Server.php line 360
    Sabre\DAV\Server->exec()
29. /var/www/nextcloud/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
30. /var/www/nextcloud/remote.php line 171
    require_once("/var/www/nextcl ... p")

PUT /remote.php/dav/files/georg/georg/bilder/22-11-24%2020-25-13%209857.jpg
from <client IP> by georg at 2022-11-24T19:25:54+00:00

[webdav] Feil: TypeError: getimagesizefromstring() expects parameter 1 to be string, bool given at <>

  1. /var/www/nextcloud/lib/private/Metadata/Provider/ExifProvider.php line 71
    getimagesizefromstring()
  2. /var/www/nextcloud/lib/private/Metadata/MetadataManager.php line 68
    OC\Metadata\Provider\ExifProvider->execute()
  3. /var/www/nextcloud/lib/private/Metadata/FileEventListener.php line 101
    OC\Metadata\MetadataManager->generateMetadata()
  4. /var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php line 87
    OC\Metadata\FileEventListener->handle()
  5. /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 251
    OC\EventDispatcher\ServiceEventListener->__invoke()
  6. /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 73
    Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
  7. /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php line 88
    Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
  8. /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php line 100
    OC\EventDispatcher\EventDispatcher->dispatch()
  9. /var/www/nextcloud/lib/private/Files/Node/HookConnector.php line 118
    OC\EventDispatcher\EventDispatcher->dispatchTyped()
  10. /var/www/nextcloud/lib/private/legacy/OC_Hook.php line 106
    OC\Files\Node\HookConnector->postWrite()
  11. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php line 471
    OC_Hook::emit()
  12. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php line 398
    OCA\DAV\Connector\Sabre\File->emitPostHooks()
  13. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1137
    OCA\DAV\Connector\Sabre\File->put()
  14. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 492
    Sabre\DAV\Server->updateFile(“*** sensitive parameters replaced ***”)
  15. /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    Sabre\DAV\CorePlugin->httpPut()
  16. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 472
    Sabre\DAV\Server->emit()
  17. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 253
    Sabre\DAV\Server->invokeMethod()
  18. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 321
    Sabre\DAV\Server->start()
  19. /var/www/nextcloud/apps/dav/lib/Server.php line 360
    Sabre\DAV\Server->exec()
  20. /var/www/nextcloud/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
  21. /var/www/nextcloud/remote.php line 171
    require_once(“/var/www/nextcl … p”)

PUT /remote.php/dav/files/georg/georg/bilder/22-11-24%2020-25-13%209857.jpg
from by georg at 2022-11-24T19:25:54+00:00

PASTE HERE

It looks like this is an issue when uploading images to remote storage using the web interface too.

And it gives me the following error:

getimagesizefromstring(): Argument #1 ($string) must be of type string, bool given

Regards, Georg