AWS IAM Roles for S3

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via 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:


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


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, 18.0.2): 20.0.1 from Docker
Operating system and version (eg, Ubuntu 20.04): RHEL8

The issue you are facing: Unable to use IAM roles for S3 authentication in external storage.

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

Steps to replicate it:

  1. Create an S3 folder in External Storages
  2. There’s no option to use an IAM role instead of access keys. If you leave the keys blank, you can’t click the checkmark to accept

The output of your Nextcloud log in Admin > Logging:

[PHP] Error: Error: Undefined offset: 3 at /var/www/html/lib/private/legacy/OC_Helper.php#548 at <<closure>>

 0. /var/www/html/lib/private/legacy/OC_Helper.php line 548
    OC\Log\ErrorHandler::onError(8, "Undefined offset: 3", "/var/www/html/l ... p", 548, {path: "/",rootI ... }})
 1. /var/www/html/apps/settings/lib/Settings/Personal/PersonalInfo.php line 108
 2. /var/www/html/apps/settings/lib/Controller/CommonSettingsTrait.php line 141
 3. /var/www/html/apps/settings/lib/Controller/PersonalSettingsController.php line 77
    OCA\Settings\Controller\PersonalSettingsController->formatSettings({10: [OCA\Settin ... ]})
 4. /var/www/html/apps/settings/lib/Controller/CommonSettingsTrait.php line 152
 5. /var/www/html/apps/settings/lib/Controller/PersonalSettingsController.php line 68
    OCA\Settings\Controller\PersonalSettingsController->getIndexResponse("personal", "personal-info")
 6. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 169
 7. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 100
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Settings\Con ... {}, "index")
 8. /var/www/html/lib/private/AppFramework/App.php line 152
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings\Con ... {}, "index")
 9. /var/www/html/lib/private/Route/Router.php line 308
    OC\AppFramework\App::main("OCA\\Settings\\ ... r", "index", OC\AppFramework\ ... {}, {section: "perso ... "})
10. /var/www/html/lib/base.php line 1009
11. /var/www/html/index.php line 37

Looks like this has been reported. Either wait for the 20.0.2 release later this month or apply changes to the file manually:

I don’t see how this is a solution. IAM Roles still don’t appear to be an option even after replacing OC_Helper.php with what was in the Github link.