Forum

Thread tagged as: Problem, Error

Asset upload script error

Hi there,

I'm working on a new build and I have a template where a user uploads a banner image to a bucket named 'banners'. See below:

<div class="page-Banner" style="background-image: url(<perch:content id="banner" type="image" width="2000" height="1182" bucket="banners" crop="true" />);">
    <div class="page-Banner_Text">
        <div>
            <h1><perch:content id="banner_title" type="text" label="Banner title text" help="This is the heading for the banner" /></h1>
            <perch:content id="banner_text" type="textarea" size="m" label="Banner sub text" help="Keep this short." />
        </div>
    </div>
</div>

When I try and select any of my assets to upload nothing happens - I select the file, click 'open' and it never appears. If I look in the console I can see a javascript error of:

This file can't be queued because it has already been processed or was rejected.

I've never had this before, any ideas?

Update: I've carried on building around this and I am finding this issue with any image field I use.

Mathew Doidge

Mathew Doidge 2 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Has the role been given permission to upload to that bucket?

Hi Drew, sorry for seriously late reply to this...

Where would I go to ensure the user has permissions? It's the main primary user for this account so I didn't think it needed any additional configuration. Is this something new in recent versions?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, it's new. There are bucket permissions for each role under the role settings.

Oh really, i can't see anything. Does the bucket need creating manually beforehand?

Drew McLellan

Drew McLellan 2638 points
Perch Support

There's no Buckets tab on the smart bar when editing a role?

I'm not seeing anything appearing regarding buckets within the role section, anywhere.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you post your diagnostics report?

Sure:


Perch: 3.0.9 Production mode: (PERCH_DEVELOPMENT) Installed apps: content (3.0.9), assets (3.0.9), categories (3.0.9), perch_forms (1.9.1) DB driver: PDO DB tables: perch3_categories (0), perch3_category_counts (0), perch3_category_sets (0), perch3_content_index (453), perch3_content_items (99), perch3_content_regions (14), perch3_forms (3), perch3_forms_responses (14), perch3_menu_items (9), perch3_navigation (2), perch3_navigation_pages (14), perch3_page_templates (8), perch3_pages (9), perch3_resource_log (117), perch3_resource_tags (0), perch3_resources (18), perch3_resources_to_tags (0), perch3_settings (11), perch3_user_passwords (0), perch3_user_privileges (31), perch3_user_role_privileges (2), perch3_user_roles (2), perch3_users (1) Users: 1 App runtimes: <?php $apps_list = [ 'content', 'perch_forms', ]; Editor plug-ins: H1: 421aa90e079fa326b6494f812ad13e79 L1: ff24192efda8ccf93f01d48766271d9d F1: 3b606135b33e6a102526838f4152a807 headerColour: #ffffff content_singlePageEdit: 1 helpURL: siteURL: / hideBranding: 0 content_collapseList: 1 lang: en-gb installedAt: 3.0.9 update_3.0.9: done latest_version: on_sale_version: 3.0.9 PERCH_DEVELOPMENT: 10 PERCH_STAGING: 50 PERCH_PRODUCTION: 100 PERCH_SITEPATH: /var/www/html PERCH_DB_USERNAME: root PERCH_DB_SERVER: db PERCH_DB_DATABASE: db_educationltd PERCH_DB_PREFIX: perch3_ PERCH_PRODUCTION_MODE: PERCH_DEVELOPMENT PERCH_FEATHERS: 1 PERCH_DEBUG: 1 PERCH_TEMPLATE_FILTERS: 1 PERCH_TZ: UTC PERCH_EMAIL_FROM: hello@visualdecree.co.uk PERCH_EMAIL_FROM_NAME: Mathew Doidge PERCH_LOGINPATH: /perch PERCH_PATH: /var/www/html/perch PERCH_CORE: /var/www/html/perch/core PERCH_RESFILEPATH: /var/www/html/perch/resources PERCH_RESPATH: /perch/resources PERCH_HTML5: 1 PERCH_RUNWAY: 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_ASSET_VERSION: ab805d13c20751d6975a PERCH_PREVIEW_ARG: preview PERCH_TEMPLATE_PATH: /var/www/html/perch/templates PERCH_DEFAULT_DOC: index.php PERCH_DEFAULT_EXT: .php PERCH_XHTML_MARKUP: PERCH_RWD: 1 PERCH_HTML_ENTITIES: PERCH_SSL: PERCH_STRIPSLASHES: PERCH_PROGRESSIVE_FLUSH: 1 PERCH_PARANOID: PERCH_FORCE_SECURE_COOKIES: PERCH_DEFAULT_BUCKET: default PERCH_TRANSLATION_ASSIST: PERCH_PASSWORD_MIN_LENGTH: 6 PERCH_MAX_FAILED_LOGINS: 10 PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR PERCH_VERIFY_UPLOADS: PERCH_PRIV_ASSIST: PERCH_CUSTOM_EDITOR_CONFIGS: PERCH_ENABLE_EXIF: 1 PERCH_AUTH_PLUGIN: PERCH_DB_CHARSET: utf8 PERCH_DB_PORT: PERCH_DB_SOCKET: PERCH_APPS_EDITOR_PLUGIN: markitup PERCH_APPS_EDITOR_MARKUP_LANGUAGE: markdown Hosting settings PHP: 7.1.3 Zend: 3.1.0 OS: Linux SAPI: apache2handler Safe mode: not detected MySQL client: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $ MySQL server: 5.7.17 Free disk space: 304.84 GB Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, PDO, session, posix, Reflection, standard, SimpleXML, pdo_sqlite, Phar, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, apache2handler, gd, pdo_mysql GD: Yes ImageMagick: No PHP max upload size: 8M PHP max form post size: 24M PHP memory limit: 128M 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: localhost HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0 HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 HTTP_ACCEPT_LANGUAGE: en-GB,en;q=0.5 HTTP_ACCEPT_ENCODING: gzip, deflate HTTP_REFERER: https://localhost/perch/core/settings/diagnostics/ HTTP_COOKIE: PHPSESSID=6b253345fbcf887ce796ff7c4183a401; cmsa=1; SQLiteManager_currentLangue=2 HTTP_CONNECTION: keep-alive HTTP_UPGRADE_INSECURE_REQUESTS: 1 PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin SERVER_SIGNATURE: <address>Apache/2.4.10 (Debian) Server at localhost Port 80</address> SERVER_SOFTWARE: Apache/2.4.10 (Debian) SERVER_NAME: localhost SERVER_ADDR: 172.20.0.3 SERVER_PORT: 80 REMOTE_ADDR: 172.20.0.1 DOCUMENT_ROOT: /var/www/html REQUEST_SCHEME: http CONTEXT_DOCUMENT_ROOT: /var/www/html SERVER_ADMIN: webmaster@localhost SCRIPT_FILENAME: /var/www/html/perch/core/settings/diagnostics/index.php REMOTE_PORT: 56490 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: 1504863272.416 REQUEST_TIME: 1504863272 argc: 1
Drew McLellan

Drew McLellan 2638 points
Perch Support

Does banners exist as a bucket currently?

It does not. I've never had any assets successfully getting any asset to go to this bucket in order for it to be created. If I go into my assets now, I can see only the default bucket.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you able to upload to the default bucket?

Yes, I just gave it a go, and the default does work

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, great. Does defining your bucket in the buckets.php file also work?

Hi Drew,

Yep defining banners in the bucket config creates it correctly. Would that point to a bug somewhere preventing it automatically creating the bucket for me?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Of course. We'll look at it.

For anyone experiencing the same issue, it was a bug in Perch 3.0.9 and was fixes in 3.0.10