• Resolved elsmore

    (@elsmore)


    Hello,

    If I add something(e.g. image) to the Media Browser, nothing seems to happen, and the file URL does not change.

    site_url(): https://imperiumairsoft.com
    home_url(): https://imperiumairsoft.com
    Database Name: wp_ezwkd
    Table Prefix: ZbgeqDTG_
    WordPress: 6.0.2
    Web Server: Apache
    PHP: 7.4.30
    MySQL: 5.5.68
    ext/mysqli: yes
    PHP Memory Limit: 256M
    WP Memory Limit: 40M
    Memory Usage: 52 MB
    Blocked External HTTP Requests: None
    WP Locale: en_GB
    Organize offloads by month/year: Enabled
    WP_DEBUG: No
    WP_DEBUG_LOG: No
    WP_DEBUG_DISPLAY: Yes
    SCRIPT_DEBUG: No
    WP Max Upload Size: 2 MB
    PHP Time Limit: 30
    PHP Error Log: 
    WP Cron: Enabled
    fsockopen: Enabled
    allow_url_fopen: Enabled
    OpenSSL: OpenSSL 1.0.2k  26 Jan 2017
    cURL: 7.29.0
    Zlib Compression: Enabled
    PHP GD: bundled (2.1.0 compatible)
    Imagick: Enabled
    Basic Auth: Disabled
    Proxy: Disabled
    
    Media Files: 101
    Offloaded Media Files: 0
    Not Offloaded Media Files: 101
    
    Number of Image Sizes: 18
    
    Names and Dimensions of Image Sizes: 
    thumbnail (80x80)
    medium (300x300)
    large (1030x1030)
    1536x1536 (1536x1536)
    2048x2048 (2048x2048)
    widget (36x36)
    square (180x180)
    featured (1500x430)
    featured_large (1500x630)
    extra_large (1500x1500)
    portfolio (495x400)
    portfolio_small (260x185)
    gallery (845x684)
    magazine (710x375)
    masonry (705x705)
    entry_with_sidebar (845x321)
    entry_without_sidebar (1210x423)
    
    WP_CONTENT_DIR: /var/www/vhosts/imperiumairsoft.com/httpdocs/wp-content
    WP_CONTENT_URL: https://imperiumairsoft.com/wp-content
    UPLOADS: Not defined
    WP_PLUGIN_DIR: /var/www/vhosts/imperiumairsoft.com/httpdocs/wp-content/plugins
    WP_PLUGIN_URL: https://imperiumairsoft.com/wp-content/plugins
    
    AS3CF_PROVIDER: Not defined
    AS3CF_BUCKET: Not defined
    AS3CF_REGION: Not defined
    AS3CF_SETTINGS: Defined
    AS3CF_SETTINGS Keys: access-key-id, provider, secret-access-key
    
    Local URL:
    https://imperiumairsoft.com/wp?content/uploads/2022/09/photo.jpg
    Offload URL:
    https://imperiumairsoft.s3.eu?west?2.amazonaws.com/wp?content/uploads/2022/09/15165040/photo.jpg
    
    OME Metadata Version: 12
    
    Custom tables:
    ZbgeqDTG_as3cf_items: Ok
    
    Storage Provider: Amazon S3
    Use Server Roles: Off
    Key File Path: N/A
    Access Keys Set: Yes
    Access Key ID Define: Not defined
    Secret Access Key Define: Not defined
    
    Bucket: imperiumairsoft
    Region: eu-west-2
    Block All Public Access: Disabled
    
    Copy Files to Bucket: On
    Enable Path: On
    Custom Path: wp-content/uploads/
    Use Year/Month: On
    Object Versioning: On
    
    Delivery Provider: Amazon S3
    Rewrite Media URLs: On
    
    Force HTTPS: Off
    
    Remove Files From Server: Off
    
    Active Theme Name: Enfold Imperium Airsoft
    Active Theme Version: 1.0
    Active Theme Folder: enfold-imperium-airsoft
    Parent Theme Name: Enfold
    Parent Theme Version: 5.0.1
    Parent Theme Folder: enfold
    
    Active Plugins:
    Autoptimize (v3.1.1.1) by Frank Goossens (futtta)
    Classic Editor (v1.6.2) by WordPress Contributors
    Contact Form 7 (v5.6.3) by Takayuki Miyoshi
    Prime Mover (v1.6.6) by Codexonics
    Really Simple SSL (v5.3.4) by Really Simple Plugins
    Ultimate Member (v2.5.0) by Ultimate Member
    UpdraftPlus - Backup/Restore (v2.22.21.25) by UpdraftPlus.Com, DavidAnderson
    WP Mail SMTP (v3.5.2) by WPForms
    WP Offload Media Lite (v2.6.2) by Delicious Brains
    WP Super Cache (v1.8) by Automattic
    Yoast SEO (v19.6.1) by Team Yoast
    
    Must-use Plugins:
    prime-mover-cli-plugin-manager.php
    
    Drop-ins:
    advanced-cache.php - advanced-cache.php
Viewing 10 replies - 1 through 10 (of 10 total)
  • I’m seeing the same thing. As far as I can tell the plugin is configured correctly but when I upload a new media file to the wordpress site, nothing is copied to s3. Nothing helpful shows up in the logs, nothing related to this plugin.

    Same thing here! No errors, all configured like asked from the manual.
    THe config it’s reading the S3 Bucket, got the permissions needed, but when uploading a file, just don’t send to bucket.

    Did you get a solution with another free plugin?

    Dears, look the IAM Permissions on AWS

    If you are not granting all permittions needed, so you will have not success with this plugin. If you are using a “IAM User” without the policy “AmazonS3FullAccess”, so the plugin will not upload the file to your bucket.

    If you are creating a IAM User restricted to a specific bucket (recommended, sure!), please continue reading…

    Let’s see below a example of the “Policy Rules” that you MUST grant to the IAM User (copy this JSON to your Policy).

    Replace YOURBUCKETNAME in the example.

    {
      "Version":"2012-10-17",
      "Statement":[
        {
          "Sid":"BucketLevel",
          "Effect":"Allow",
          "Action":[
            "s3:ListBucket",
            "s3:GetBucketLocation",
            "s3:GetBucketPublicAccessBlock",
            "s3:PutBucketPublicAccessBlock"
          ],
          "Resource":"arn:aws:s3:::YOURBUCKETNAME"
        },
        {
          "Sid":"AccountLevel",
          "Effect":"Allow",
          "Action":"s3:ListAllMyBuckets",
          "Resource":"*"
        },
        {
          "Sid":"ObjectLevel",
          "Effect":"Allow",
          "Action":[
            "s3:PutObject",
            "s3:GetObject",
            "s3:DeleteObject",
            "s3:PutObjectAcl"
          ],
          "Resource":"arn:aws:s3:::YOURBUCKETNAME/*"
        }
      ]
    }

    Other important detail is that in the Plugin settings, you should be able to see the Bucket Access Status, it must show Enable or Disable, but if shows “Unknown” so probably the Plugin will not work.

    You must see something like this: “Block All Public Access Disabled

    Don’t forget to read the manual of the plugin about the IAM Custom Policy at Custom IAM Policy for Amazon S3

    Regards,
    Good Luck!!

    • This reply was modified 2 years, 2 months ago by Isack Raid. Reason: Formatting Reply
    • This reply was modified 2 years, 2 months ago by Isack Raid. Reason: Formatting Reply
    Plugin Author Delicious Brains

    (@deliciousbrains)

    Hi @elsmore,

    According to your diagnostic info you haveWP_DEBUG logging disabled which means you will not get any error messages logged. If you have a permissions issue as @isackblue suggests, it should be logged in your PHP error log once you enable WP_DEBUG.

    Here’s a doc link for one of our other products that describes how to enable it:
    https://deliciousbrains.com/wp-migrate-db-pro/doc/troubleshooting-guide/#wpdebug

    Thread Starter elsmore

    (@elsmore)

    Hi,

    Thanks for your help so far. I have checked the all the permissions are correct according to the JSON posted, and images are still not being copied to S3. I have enabled WP DEBUG, and there is nothing showing in the log.

    Thread Starter elsmore

    (@elsmore)

    Here are the permissions:

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "VisualEditor0",
                "Effect": "Allow",
                "Action": [
                    "s3:PutAnalyticsConfiguration",
                    "s3:GetObjectVersionTagging",
                    "s3:CreateBucket",
                    "s3:ReplicateObject",
                    "s3:GetObjectAcl",
                    "s3:GetBucketObjectLockConfiguration",
                    "s3:DeleteBucketWebsite",
                    "s3:GetIntelligentTieringConfiguration",
                    "s3:PutLifecycleConfiguration",
                    "s3:GetObjectVersionAcl",
                    "s3:PutBucketAcl",
                    "s3:PutObjectTagging",
                    "s3:DeleteObject",
                    "s3:DeleteObjectTagging",
                    "s3:GetBucketPolicyStatus",
                    "s3:GetBucketWebsite",
                    "s3:PutReplicationConfiguration",
                    "s3:GetObjectAttributes",
                    "s3:DeleteObjectVersionTagging",
                    "s3:PutObjectLegalHold",
                    "s3:InitiateReplication",
                    "s3:GetObjectLegalHold",
                    "s3:GetBucketNotification",
                    "s3:PutBucketCORS",
                    "s3:DeleteBucketPolicy",
                    "s3:GetReplicationConfiguration",
                    "s3:ListMultipartUploadParts",
                    "s3:PutObject",
                    "s3:GetObject",
                    "s3:PutBucketNotification",
                    "s3:PutBucketLogging",
                    "s3:PutObjectVersionAcl",
                    "s3:GetAnalyticsConfiguration",
                    "s3:PutBucketObjectLockConfiguration",
                    "s3:GetObjectVersionForReplication",
                    "s3:GetLifecycleConfiguration",
                    "s3:GetInventoryConfiguration",
                    "s3:GetBucketTagging",
                    "s3:PutAccelerateConfiguration",
                    "s3:DeleteObjectVersion",
                    "s3:GetBucketLogging",
                    "s3:ListBucketVersions",
                    "s3:ReplicateTags",
                    "s3:RestoreObject",
                    "s3:ListBucket",
                    "s3:GetAccelerateConfiguration",
                    "s3:GetObjectVersionAttributes",
                    "s3:GetBucketPolicy",
                    "s3:PutEncryptionConfiguration",
                    "s3:GetEncryptionConfiguration",
                    "s3:GetObjectVersionTorrent",
                    "s3:AbortMultipartUpload",
                    "s3:PutBucketTagging",
                    "s3:GetBucketRequestPayment",
                    "s3:GetObjectTagging",
                    "s3:GetMetricsConfiguration",
                    "s3:GetBucketOwnershipControls",
                    "s3:DeleteBucket",
                    "s3:PutBucketVersioning",
                    "s3:PutObjectAcl",
                    "s3:GetBucketPublicAccessBlock",
                    "s3:ListBucketMultipartUploads",
                    "s3:PutBucketPublicAccessBlock",
                    "s3:PutIntelligentTieringConfiguration",
                    "s3:PutMetricsConfiguration",
                    "s3:PutBucketOwnershipControls",
                    "s3:PutObjectVersionTagging",
                    "s3:GetBucketVersioning",
                    "s3:GetBucketAcl",
                    "s3:BypassGovernanceRetention",
                    "s3:PutInventoryConfiguration",
                    "s3:GetObjectTorrent",
                    "s3:ObjectOwnerOverrideToBucketOwner",
                    "s3:PutBucketWebsite",
                    "s3:PutBucketRequestPayment",
                    "s3:GetBucketCORS",
                    "s3:PutBucketPolicy",
                    "s3:GetBucketLocation",
                    "s3:ReplicateDelete",
                    "s3:GetObjectVersion",
                    "s3:PutObject",
                    "s3:GetObject",
                    "s3:DeleteObject",
                    "s3:PutObjectAcl"
                ],
                "Resource": [
                    "arn:aws:s3:::MYBUCKETNAME",
                    "arn:aws:s3:::MYBUCKETNAME/*"
                ]
            },
            {
                "Sid": "AccountLevel",
                "Effect": "Allow",
                "Action": "s3:ListAllMyBuckets",
                "Resource": "*"
            },
            {
                "Sid": "VisualEditor1",
                "Effect": "Allow",
                "Action": [
                    "s3:PutAccountPublicAccessBlock",
                    "s3:GetAccountPublicAccessBlock",
                    "s3:ListAllMyBuckets",
                    "s3:ListJobs",
                    "s3:ListBucket",
                    "s3:GetBucketLocation",
                    "s3:GetBucketPublicAccessBlock",
                    "s3:PutBucketPublicAccessBlock"
                ],
                "Resource": "arn:aws:s3:::MYBUCKETNAME"
            }
        ]
    }
    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "ObjectLevel",
                "Effect": "Allow",
                "Action": [
                    "s3:PutObject",
                    "s3:GetObject",
                    "s3:DeleteObject",
                    "s3:PutObjectAcl"
                ],
                "Resource": "arn:aws:s3:::MYBUCKETNAME/*"
            },
            {
                "Sid": "BucketLevel",
                "Effect": "Allow",
                "Action": [
                    "s3:GetBucketPublicAccessBlock",
                    "s3:PutBucketPublicAccessBlock",
                    "s3:CreateBucket",
                    "s3:ListBucket",
                    "s3:GetBucketLocation"
                ],
                "Resource": "arn:aws:s3:::MYBUCKETNAME"
            },
            {
                "Sid": "AccountLevel",
                "Effect": "Allow",
                "Action": "s3:ListAllMyBuckets",
                "Resource": "*"
            }
        ]
    }
    • This reply was modified 2 years, 2 months ago by elsmore.
    Thread Starter elsmore

    (@elsmore)

    Ok, after recreating the S3 policies twice, I now see that it ONLY works if the plugin is set to:

    Block All Public Access Enabled

    It does NOT work if it is set to:

    Block All Public Access Disabled

    But after disabling public access during testing I cannot now re-enable it??? All I get is the more info link:

    Block All Public Access Disabled More info ?

    Also, if block public access is enabled, no thumbnail for an uploaded image appears in the WP media browser. I just see a grey square. Is this intentional? I need to be able to see images in order to place them on pages.

    Plugin Author Delicious Brains

    (@deliciousbrains)

    Check out WP Offload Media Lite v3.0.0 which now handles not only Block All Public Access to bucket, but also Object Ownership Enforcement, which can also cause issues with offloading.

    -IJ

    Thread Starter elsmore

    (@elsmore)

    The error log works in v3.0.0, so I was able to see some permissions that needed to be granted:
    GetBucketOwnershipControls
    PutBucketOwnershipControls

    It seems to be working fine, now.

    Thank you for the help.

    • This reply was modified 2 years, 1 month ago by elsmore.
    Plugin Author Delicious Brains

    (@deliciousbrains)

    Excellent, glad the new support for Object Ownership in v3.0.0 helped @elsmore.

    -IJ

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Files don’t upload to S3’ is closed to new replies.