Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get S3 media bucket to work #77

Open
RichardMills opened this issue Jul 28, 2020 · 5 comments
Open

Unable to get S3 media bucket to work #77

RichardMills opened this issue Jul 28, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@RichardMills
Copy link

What happened:

I'm setting up a Wordpress site using the wordpress-operator. For media backing store, I was hoping to use S3.

I read through the CRD spec and found that it supports s3: media library as well as gcs: media library. So I created a definition block that should have made use of a bucket and stored media there. I tested it by visiting my Media library and upload/view some images. Instead of pushing/pulling the images from S3, it created a wp-content/uploads directory and stored the sample images in there.

spec:
  media: # where to find the media files
    # For S3, see: https://github.com/presslabs/wordpress-operator/blob/ce3af26178f206075ba7bde57985beb4181f59cb/config/crds/wordpress.presslabs.org_wordpresses.yaml#L1868
    s3:
      bucket: my-bucket
      prefix: mysite
      env:
        - name: AWS_ACCESS_KEY_ID
          valueFrom:
            secretKeyRef:
              name: wordpress-aws-secret
              key: aws_access_key_id
        - name: AWS_SECRET_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              name: wordpress-aws-secret
              key: aws_secret_access_key

I also created the wordpress-aws-secret with proper credentials.

What you expected to happen:

I expected that after starting up mysite with the wordpress-operator, the Media library would either read/write images to S3 or at least start spewing errors due to misconfiguration. That is what happened when I put some dummy gcs: configuration settings in. (I don't actually have a GCS account.)

How to reproduce it (as minimally and precisely as possible):

  • define a mysite wordpress CR spec
  • use the spec configuration for the media setup above
  • create a aws secret with two values to match the configuration above

Anything else?:

Is there anything else that needs to be done to configure Wordpress to use S3?

@RichardMills RichardMills added the bug Something isn't working label Jul 28, 2020
@AMecea
Copy link
Contributor

AMecea commented Aug 4, 2020

Hi, @RichardMills did you installed stack-mu-plugin? In order to work, you have to install this plugin which creates a stream wrapper, more details can be found here

@RichardMills
Copy link
Author

I will attempt to get this plugin installed. Let me know if there's any docs associated with making this work within the operator or if there's any slick way to tell the operator about mu plugins. I think my plan is:

  • install the stack-my-plugin into my wp-content/my-plugins git repository per the instructions you pointed to
  • launch the WP instance with the S3 spec listed above
  • watch the WP instance logs for evidence that the S3 parameters are being handled by the plugin to connect with the S3 bucket as specified

@AMecea
Copy link
Contributor

AMecea commented Aug 11, 2020

Here are two examples:

@everythings-gonna-be-alright

As i understand this plugin support only gcp

@amansquareops-ops
Copy link

amansquareops-ops commented May 31, 2024

hi, @AMecea I followed all the instructions when I tried to use stack-mu-plugin with S3, but I still can't get it to function.
I am receiving an error message saying "Invalid protocol S3 for media storage."
can you please suggest me.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants