Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    S3 configuraton is giving strange behavior and not working Storage::disk('s3')->files(); InvalidArgumentException with message 'Missing required client configuration options: region: (string)

    Bug Report
    2
    4
    946
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mikeyapina last edited by

      So I am trying to get upload to S3 to work so I can upload files to S3 instead of locally for some large files. But, there appears to be a funny issue going on with the configuration. Notice the error and the .env are correct it just isn't reading properly. From the tinker it is there
      as well. I am trying to test uploading to the s3 bucket for files instead of local.

      error--------------------------------
      Storage::disk('s3')->files();
      InvalidArgumentException with message 'Missing required client configuration options:

      region: (string)

      ubuntu@ip-172-31-19-230:/var/www/html/bagisto$ php artisan tinker
      Psy Shell v0.9.12 (PHP 7.2.24-0ubuntu0.18.04.3 — cli) by Justin Hileman

      Storage::disk('s3')->files();
      InvalidArgumentException with message 'Missing required client configuration options:

      region: (string)

      A "region" configuration value is required for the "s3" service
      (e.g., "us-west-2"). A list of available public regions and endpoints can be
      found at http://docs.aws.amazon.com/general/latest/gr/rande.html.'

      quit
      Exit: Goodbye
      ubuntu@ip-172-31-19-230:/var/www/html/bagisto$ sudo vi .env
      ubuntu@ip-172-31-19-230:/var/www/html/bagisto$ php artisan config:clear
      Configuration cache cleared!
      ubuntu@ip-172-31-19-230:/var/www/html/bagisto$ php artisan config:cache
      Configuration cache cleared!
      Configuration cached successfully!
      ubuntu@ip-172-31-19-230:/var/www/html/bagisto$ php artisan tinker
      Psy Shell v0.9.12 (PHP 7.2.24-0ubuntu0.18.04.3 — cli) by Justin Hileman
      dd(env('AWS_DEFAULT_REGION'));
      ^ null
      dd(config('filesystems.disks.s3'))
      ^ array:6 [
      "driver" => "s3"
      "AWS_ACCESS_KEY_ID" => "xA333333333333"
      "AWS_SECRET_ACCESS_KEY" => "/x33333333"
      "AWS_DEFAULT_REGION" => "us-west-2"
      "AWS_BUCKET" => "xxxxxx"
      "AWS_URL" => "https://ov3rt.s3-us-west-2.amazonaws.com/"
      ]

      Plus this is the env file setting

      FILESYSTEM_DRIVER=local
      FILESYSTEM_CLOUD=s3

      AWS_ACCESS_KEY_ID=A333333333333
      AWS_SECRET_ACCESS_KEY=/x33333333
      AWS_DEFAULT_REGION=us-west-2
      AWS_BUCKET=xxxx
      AWS_URL=https://xxxx.s3-us-west-2.amazonaws.com/

      1 Reply Last reply Reply Quote 0
      • M
        mikeyapina last edited by

        This is the article I am working off of to test

        https://techncareer.com/post/upload-files-aws-s3-bucket-using-laravel

        M 1 Reply Last reply Reply Quote 0
        • M
          mikeyapina @mikeyapina last edited by

          @mikeyapina I fixed it I had to change the parameters for s3 in this file and also make sure that their counterparts where in side the .env file without the AWS.. header in the env file

          https://github.com/laravel/laravel/blob/master/config/filesystems.php#L58-L64

          1 Reply Last reply Reply Quote 0
          • V
            Vaishali Agarwal last edited by

            @mikeyapina
            Thanks for mentioning the S3 configuration issues with all the possible solution.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post