title: TypeError: League\Flysystem\AwsS3V3\AwsS3V3Adapter::__construct(): Argument #2 ($bucket) must be of type string
body: <p>I was trying to set up Bitbucket pipeline for mine Laravel repo, but on 'testing' step while trying to add image to AWS bucket I get</p>
  <pre><code>TypeError:League\Flysystem\AwsS3V3\AwsS3V3Adapter::__construct() Argument #2 ($bucket) must be of type string, null given
  </code></pre>
  <p>I already tried to run pipeline from different php images: php:8.1-fpm, php:8.1-apache, php:8.1-alpine, even from composer:2.3.5 image. Here is the alpine pipeline:</p>
  <pre><code>image: php:8.1.4-alpine
  
  
  pipelines:
    branches:
      development:
        - step:
            name: test
            script:
              - apk add --no-cache bash git zip curl libjpeg-turbo-dev freetype-dev libmcrypt-dev libjpeg libpng-dev libzip-dev unzip &amp;&amp; docker-php-ext-configure gd --with-jpeg --with-freetype &amp;&amp;  docker-php-ext-configure zip &amp;&amp; docker-php-ext-install gd &amp;&amp; docker-php-ext-install zip &amp;&amp; curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer &amp;&amp; composer install &amp;&amp; php artisan test
            caches:
              - composer
        - step:
            name: deploy-dev
            deployment: production
            caches:
              - composer
            script:
              - composer global require &quot;laravel/envoy&quot;
              - ~/.composer/vendor/bin/envoy run deploy-dev
  </code></pre>
  <p>Here is full error code:</p>
  <pre><code>TypeError: League\Flysystem\AwsS3V3\AwsS3V3Adapter::__construct(): Argument #2 ($bucket) must be of type string, null given, called in /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php on line 245 and defined in /opt/atlassian/pipelines/agent/build/vendor/league/flysystem-aws-s3-v3/AwsS3V3Adapter.php:120
    Stack trace:
    #0 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php(245): League\Flysystem\AwsS3V3\AwsS3V3Adapter-&gt;__construct(Object(Aws\S3\S3Client), NULL, 'conversations', Object(League\Flysystem\AwsS3V3\PortableVisibilityConverter), NULL, Array, false)
    #1 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php(149): Illuminate\Filesystem\FilesystemManager-&gt;createS3Driver(Array)
    #2 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php(117): Illuminate\Filesystem\FilesystemManager-&gt;resolve('s3')
    #3 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php(80): Illuminate\Filesystem\FilesystemManager-&gt;get('conversationsPu...')
    #4 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(337): Illuminate\Filesystem\FilesystemManager-&gt;disk('conversationsPu...')
    #5 /opt/atlassian/pipelines/agent/build/Modules/ClientAPI/Http/Controllers/Conversations/ConversationMessagesController.php(51): Illuminate\Support\Facades\Facade::__callStatic('disk', Array)
    #6 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Modules\ClientAPI\Http\Controllers\Conversations\ConversationMessagesController-&gt;createImage(Object(Illuminate\Http\Request), Object(Modules\ClientAPI\Entities\Conversation))
    #7 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller-&gt;callAction('createImage', Array)
    #8 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Routing/Route.php(261): Illuminate\Routing\ControllerDispatcher-&gt;dispatch(Object(Illuminate\Routing\Route), Object(Modules\ClientAPI\Http\Controllers\Conversations\ConversationMessagesController), 'createImage')
    #9 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Routing/Route.php(204): Illuminate\Routing\Route-&gt;runController()
    #10 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Routing/Router.php(725): Illuminate\Routing\Route-&gt;run()
    #11 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Routing\Router-&gt;Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
    #12 /opt/atlassian/pipelines/agent/build/Modules/ClientAPI/Http/Middleware/ValidateConversationMiddleware.php(29): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
    #13 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Modules\ClientAPI\Http\Middleware\ValidateConversationMiddleware-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
    #14 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
    #15 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Routing\Middleware\SubstituteBindings-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
    #16 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(126): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
    #17 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(102): Illuminate\Routing\Middleware\ThrottleRequests-&gt;handleRequest(Object(Illuminate\Http\Request), Object(Closure), Array)
    #18 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(54): Illuminate\Routing\Middleware\ThrottleRequests-&gt;handleRequestUsingNamedLimiter(Object(Illuminate\Http\Request), Object(Closure), 'api', Object(Closure))
    #19 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Routing\Middleware\ThrottleRequests-&gt;handle(Object(Illuminate\Http\Request), Object(Closure), 'api')
    #20 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
    #21 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Auth\Middleware\Authenticate-&gt;handle(Object(Illuminate\Http\Request), Object(Closure), 'sanctum')
    #22 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
    #23 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Routing/Router.php(726): Illuminate\Pipeline\Pipeline-&gt;then(Object(Closure))
    #24 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Routing/Router.php(703): Illuminate\Routing\Router-&gt;runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
    #25 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Routing/Router.php(667): Illuminate\Routing\Router-&gt;runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
    #26 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Routing/Router.php(656): Illuminate\Routing\Router-&gt;dispatchToRoute(Object(Illuminate\Http\Request))
    #27 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\Routing\Router-&gt;dispatch(Object(Illuminate\Http\Request))
    #28 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Foundation\Http\Kernel-&gt;Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
    #29 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
    #30 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
    #31 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
    #32 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
    #33 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
    #34 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\TrimStrings-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
    #35 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
    #36 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\ValidatePostSize-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
    #37 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
    #38 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
    #39 /opt/atlassian/pipelines/agent/build/vendor/fruitcake/laravel-cors/src/HandleCors.php(52): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
    #40 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Fruitcake\Cors\HandleCors-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
    #41 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
    #42 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Http\Middleware\TrustProxies-&gt;handle(Object(Illuminate\Http\Request), Object(Closure))
    #43 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline-&gt;Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
    #44 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\Pipeline\Pipeline-&gt;then(Object(Closure))
    #45 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel-&gt;sendRequestThroughRouter(Object(Illuminate\Http\Request))
    #46 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php(526): Illuminate\Foundation\Http\Kernel-&gt;handle(Object(Illuminate\Http\Request))
    #47 /opt/atlassian/pipelines/agent/build/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php(321): Illuminate\Foundation\Testing\TestCase-&gt;call('POST', '/api/v1/convers...', Array, Array, Array, Array)
    #48 /opt/atlassian/pipelines/agent/build/Modules/ClientAPI/Tests/Feature/Conversations/Messages/CreateTest.php(58): Illuminate\Foundation\Testing\TestCase-&gt;post('/api/v1/convers...', Array)
    #49 /opt/atlassian/pipelines/agent/build/vendor/phpunit/phpunit/src/Framework/TestCase.php(1545): Modules\ClientAPI\Tests\Feature\Conversations\Messages\CreateTest-&gt;testCreateImage200()
    #50 /opt/atlassian/pipelines/agent/build/vendor/phpunit/phpunit/src/Framework/TestCase.php(1151): PHPUnit\Framework\TestCase-&gt;runTest()
    #51 /opt/atlassian/pipelines/agent/build/vendor/phpunit/phpunit/src/Framework/TestResult.php(726): PHPUnit\Framework\TestCase-&gt;runBare()
    #52 /opt/atlassian/pipelines/agent/build/vendor/phpunit/phpunit/src/Framework/TestCase.php(903): PHPUnit\Framework\TestResult-&gt;run(Object(Modules\ClientAPI\Tests\Feature\Conversations\Messages\CreateTest))
    #53 /opt/atlassian/pipelines/agent/build/vendor/phpunit/phpunit/src/Framework/TestSuite.php(677): PHPUnit\Framework\TestCase-&gt;run(Object(PHPUnit\Framework\TestResult))
    #54 /opt/atlassian/pipelines/agent/build/vendor/phpunit/phpunit/src/Framework/TestSuite.php(677): PHPUnit\Framework\TestSuite-&gt;run(Object(PHPUnit\Framework\TestResult))
    #55 /opt/atlassian/pipelines/agent/build/vendor/phpunit/phpunit/src/Framework/TestSuite.php(677): PHPUnit\Framework\TestSuite-&gt;run(Object(PHPUnit\Framework\TestResult))
    #56 /opt/atlassian/pipelines/agent/build/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(673): PHPUnit\Framework\TestSuite-&gt;run(Object(PHPUnit\Framework\TestResult))
    #57 /opt/atlassian/pipelines/agent/build/vendor/phpunit/phpunit/src/TextUI/Command.php(143): PHPUnit\TextUI\TestRunner-&gt;run(Object(PHPUnit\Framework\TestSuite), Array, Array, true)
    #58 /opt/atlassian/pipelines/agent/build/vendor/phpunit/phpunit/src/TextUI/Command.php(96): PHPUnit\TextUI\Command-&gt;run(Array, true)
    #59 /opt/atlassian/pipelines/agent/build/vendor/phpunit/phpunit/phpunit(98): PHPUnit\TextUI\Command::main()
    #60 {main}
  </code></pre>
  <p>Here is my composer requirements that may cause error:</p>
  <pre><code> &quot;require&quot;: {
          &quot;php&quot;: &quot;^8.1&quot;,
          &quot;doctrine/dbal&quot;: &quot;^3.3&quot;,
          &quot;guzzlehttp/guzzle&quot;: &quot;^7.0.1&quot;,
          &quot;laravel/framework&quot;: &quot;^9.0&quot;,
          &quot;laravel/sanctum&quot;: &quot;^2.14&quot;,
          &quot;laravel/scout&quot;: &quot;^9.4&quot;,
          &quot;laravel/socialite&quot;: &quot;^5.5&quot;,
          &quot;league/flysystem-aws-s3-v3&quot;: &quot;^3.0&quot;,
          ....
      },
  </code></pre>