Forum

Thread tagged as: Problem, Addons, Runway

S3 configuration

Hello,

I'm trying to setup S3 for a new project and after following as much instructions as I could find the image attachment process still fails. When I try to add an image to a blog post, I select it from my local file system, the image appears for a moment in the perch UI and then just disappears. I understand that the upload to S3 fails. Could be permissions issue but can't be sure. And that's my question: Is there any place to look or any perch way to debug the problem?

Diagnostics

Perch Runway: 2.8.31
Production mode: Production (100)
Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31), perch_blog (5.0), perch_shop_orders (1.0.6), perch_shop_products (1.0.6), perch_shop (1.0.6), perch_members (1.5)
DB driver: PDO
DB tables: perch2_backup_plans (0), perch2_backup_resources (0), perch2_backup_runs (0), perch2_blog_authors (2), perch2_blog_comments (289), perch2_blog_index (2850), perch2_blog_posts (118), perch2_blog_posts_to_tags (0), perch2_blog_sections (1), perch2_blog_tags (0), perch2_blogs (1), perch2_categories (5), perch2_category_counts (5), perch2_category_sets (2), perch2_collection_index (0), perch2_collection_items (1), perch2_collection_revisions (1), perch2_collections (1), perch2_content_index (85), perch2_content_items (24), perch2_content_regions (8), perch2_members (0), perch2_members_forms (0), perch2_members_member_tags (0), perch2_members_sessions (0), perch2_members_tags (0), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_routes (0), perch2_page_templates (6), perch2_pages (7), perch2_resource_log (15), perch2_resource_tags (0), perch2_resources (47), perch2_resources_to_tags (0), perch2_settings (33), perch2_shop_addresses (0), perch2_shop_admin_index (38), perch2_shop_brands (1), perch2_shop_cart (6), perch2_shop_cart_data (0), perch2_shop_cart_items (0), perch2_shop_countries (250), perch2_shop_currencies (152), perch2_shop_customers (0), perch2_shop_emails (1), perch2_shop_index (75), perch2_shop_option_values (0), perch2_shop_options (0), perch2_shop_order_items (0), perch2_shop_order_promotions (0), perch2_shop_order_statuses (9), perch2_shop_orders (0), perch2_shop_orders_meta (1), perch2_shop_product_files (0), perch2_shop_product_option_values (0), perch2_shop_product_options (0), perch2_shop_product_tags (0), perch2_shop_products (1), perch2_shop_promotions (0), perch2_shop_search (1), perch2_shop_shipping_zone_countries (1), perch2_shop_shipping_zones (1), perch2_shop_shippings (1), perch2_shop_tax_exhibits (0), perch2_shop_tax_group_rates (1), perch2_shop_tax_groups (1), perch2_shop_tax_locations (1), perch2_shop_tax_rates (1), perch2_shop_variants (0), perch2_user_passwords (0), perch2_user_privileges (73), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (1)
Users: 1
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_blog',
        'perch_members',
        'perch_shop',
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: markitup, redactor
H1: 400fa49c33c92b190a23c28d6c113029
L1: fa2fa9e9c05930d2f996e763765aab27
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #000000
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.8.31: done
perch_blog_site_name: Anna&Co
headerScheme: dark
update_runway_2.8.31: done
latest_version: 2.8.15
on_sale_version: 2.8.31
perch_blog_update: 5.0.1
perch_blog_post_url: /blog/post.php?s={postSlug}
perch_blog_slug_format: /post/{postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
perch_blog_comment_notify: 0
perch_shop_update: 1.0.6
perch_members_login_page: /members/login.php?r={returnURL}
perch_shop_price_tax_mode: exc
perch_shop_trade_price_tax_mode: exc
perch_shop_site_url: https://
perch_shop_product_url: /shop/products/{slug}
perch_shop_default_currency: 44
perch_shop_reporting_currency: 44
perch_shop_invoice_number_format: Invoice%d
perch_members_update: 1.4
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_SITEPATH: /Users/proko/Sites/annaand.co/web
PERCH_SCHEDULE_SECRET: EBZnO7Q6uHa2xk8Y
PERCH_DB_USERNAME: root
PERCH_DB_SERVER: 127.0.0.1
PERCH_DB_DATABASE: annaandco_dev
PERCH_DB_PREFIX: perch2_
PERCH_EMAIL_FROM: promount81@gmail.com
PERCH_EMAIL_FROM_NAME: Proko Mountrichas
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/proko/Sites/annaand.co/web/perch
PERCH_CORE: /Users/proko/Sites/annaand.co/web/perch/core
PERCH_RESFILEPATH: /Users/proko/Sites/annaand.co/web/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_TZ: Europe/Madrid
PERCH_RUNWAY: 1
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /Users/proko/Sites/annaand.co/web/perch/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
PERCH_SHOP_VERSION: 1.0.6
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: textile
HOSTING SETTINGS

PHP: 5.6.18
Zend: 2.6.0
OS: Darwin
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $
MySQL server: 5.6.27
Free disk space: 67.12 GB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dba, dom, hash, fileinfo, filter, ftp, gd, gettext, SPL, iconv, json, ldap, mbstring, session, standard, mysqlnd, odbc, mysqli, PDO, pdo_mysql, PDO_ODBC, pdo_sqlite, Phar, posix, Reflection, mysql, shmop, SimpleXML, soap, sockets, exif, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, apache2handler, apcu, mhash, apc, Zend OPcache
GD: Yes
ImageMagick: No
PHP max upload size: 8M
PHP max form post size: 128M
PHP memory limit: 256M
Total max uploadable file size: 8M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
HTTP_HOST: annaandco.dev
HTTP_CONNECTION: keep-alive
HTTP_CACHE_CONTROL: max-age=0
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_REFERER: https://annaandco.dev/perch/?r=%2Fperch%2Fcore%2Fsettings%2Fdiagnostics%2F%3Fextended
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8,en-AU;q=0.6,es;q=0.4,el;q=0.2,fr;q=0.2
HTTP_COOKIE: SESS07f7f4ea80127e9a8563ea9451ea3a7f=uNsINC9PQxW46EItrA3wleRIu1NPqe3NmiwMHCZgBgY; cmssb=0; PHPSESSID=89e3r10l5llba288dobk2qbon6; cmsa=1
PATH: /usr/bin:/bin:/usr/sbin:/sbin
SERVER_SOFTWARE: Apache/2.4.18 (Unix) PHP/5.6.18
SERVER_NAME: annaandco.dev
SERVER_ADDR: 127.0.0.1
SERVER_PORT: 80
REMOTE_ADDR: 127.0.0.1
DOCUMENT_ROOT: /Users/proko/Sites/annaand.co/web
REQUEST_SCHEME: http
CONTEXT_DOCUMENT_ROOT: /Users/proko/Sites/annaand.co/web
SERVER_ADMIN: promount81@gmail.com
SCRIPT_FILENAME: /Users/proko/Sites/annaand.co/web/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 62561
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1470167513.442
REQUEST_TIME: 1470167513

buckets.php

<?php 
    return [
        'blogimages' => [
                 'type'      => 'amazon_s3',
                 'web_path'  => 'https://s3bucketname.s3.amazonaws.com',
                 'file_path' => 's3bucketname',
         ],
    ];
?>

I had a look at Amazon's troubleshooting guide and they suggest to check in dev tools. So I did and noticed no request to Amazon when I add images. I understand that the image is not even trying to leave Perch.

Any hint would be highly appreciated.

Proko Mountrichas

Proko Mountrichas 3 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you added your access key to the runway.php config file?

If so, do you have another method to verify that the access key is working as intended?

I do have added the key.

I had a quick look to testing authentication and could only find some tutorials on doing it with the SDK which is outside my possibilities.

I have created an IAM user and attached the S3 full access policy. Then I use this user's credentials into runway.

I will focus today on testing my user if you don't find anything wrong in the diagnostics. then.

I just tried with the credentials of my original administration account but still same behaviour. I also gave all permissions to everybody in my S3 bucket.

Drew McLellan

Drew McLellan 2638 points
Perch Support

A good test would be to use another S3 client (like a file transfer tool) with the same crews. Permissions on S3 aren't always the simplest thing to get right.

Took your advice and tested in Transmit. There I could access the server but not the bucket. Got error

AWS::S3::Errors::InvalidRequest The authorisation mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256

which happens to appear when a bucket is hosted in Frankfurt region. Apparently some extra configuration can solve the issue but in my case I preferred to move the bucket to Ireland and there it just works.

Looks like moving to Ireland is the solution to everything ;)

Thanks Drew!