Forum

Thread tagged as: Question, Problem, Error

URGENT: Image uploading problem

When I came in to work this morning, all of the images from one of my dev sites had disappeared. I went about re-uploading them and got about 4 pics done then started getting this message every time I clicked 'saved'

Warning: filesize(): stat failed for /home/designbyconet_com/smiles.designbyconet.com/ucontrol/resources/banner5-w2000h565.jpg in /home/designbyconet_com/smiles.designbyconet.com/ucontrol/core/lib/PerchFieldTypes.class.php on line 1001

Warning: Cannot modify header information - headers already sent by (output started at /home/designbyconet_com/smiles.designbyconet.com/ucontrol/core/lib/PerchFieldTypes.class.php:1001) in /home/designbyconet_com/smiles.designbyconet.com/ucontrol/core/inc/top.php on line 13

Warning: Cannot modify header information - headers already sent by (output started at /home/designbyconet_com/smiles.designbyconet.com/ucontrol/core/lib/PerchFieldTypes.class.php:1001) in /home/designbyconet_com/smiles.designbyconet.com/ucontrol/core/inc/top.php on line 14
Diagnostics:

Perch: 2.7.3
Production mode: Production (100)
Installed apps: content (2.7.3), assets (2.7.3), categories (2.7.3), perch_blog (4.5.2), perch_forms (1.8.2)
DB driver: PDO
DB tables: perch2_blog_authors, perch2_blog_comments, perch2_blog_index, perch2_blog_posts, perch2_blog_posts_to_tags, perch2_blog_sections, perch2_blog_tags, perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_forms, perch2_forms_responses, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users
Users: 2
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_blog',
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: markitup, ckeditor
H1: 92bc5af6ec8026300deb4de57d4feab5
L1: 331a22b9fcc6288601c66e62fdb0d2bb
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.7.1: done
latest_version: 2.5.3
on_sale_version: 2.7.3
headerScheme: light
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
logoPath: /ucontrol/resources/ucontrol.png
perch_blog_update: 5.0
perch_blog_post_url: /news/post.php?s={postSlug}
perch_blog_slug_format: %Y-%m-%d-{postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
perch_blog_comment_notify: 0
update_2.7.3: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: usrsmilesdental
PERCH_DB_SERVER: smilessql.designbyconet.com
PERCH_DB_DATABASE: dbsmilesdental
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/London
PERCH_EMAIL_FROM: steven@designbyconet.com
PERCH_EMAIL_FROM_NAME: Steven Legge
PERCH_LOGINPATH: /ucontrol
PERCH_PATH: /home/designbyconet_com/smiles.designbyconet.com/ucontrol
PERCH_CORE: /home/designbyconet_com/smiles.designbyconet.com/ucontrol/core
PERCH_RESFILEPATH: /home/designbyconet_com/smiles.designbyconet.com/ucontrol/resources
PERCH_RESPATH: /ucontrol/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_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /home/designbyconet_com/smiles.designbyconet.com/ucontrol/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
HOSTING SETTINGS

PHP: 5.4.11
Zend: 2.4.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: mysqlnd 5.0.10 - 20111026 - $Id: b0b3b15c693b7f6aeb3aa66b646fee339f175e39 $
MySQL server: 5.1.56-log
Extensions: Core, date, ereg, libxml, pcre, sqlite3, filter, mbstring, SPL, PDO, Reflection, pdo_sqlite, hash, session, cgi-fcgi, bcmath, bz2, calendar, ctype, curl, dom, standard, ftp, gd, gettext, exif, iconv, imap, json, mcrypt, mysqlnd, mysqli, openssl, pcntl, pdo_mysql, posix, pspell, mysql, SimpleXML, soap, sockets, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib, mhash
GD: Yes
ImageMagick: No
PHP max upload size: 7M
PHP max form post size: 7M
PHP memory limit: 90M
Total max uploadable file size: 7M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
PATH: /bin:/usr/bin:/sbin:/usr/sbin
RAILS_ENV: production
SCRIPT_NAME: /ucontrol/core/settings/diagnostics/index.php
REQUEST_URI: /ucontrol/core/settings/diagnostics/?extended
QUERY_STRING: extended
REQUEST_METHOD: GET
SERVER_PROTOCOL: HTTP/1.1
GATEWAY_INTERFACE: CGI/1.1
REMOTE_PORT: 51806
SCRIPT_FILENAME: /home/designbyconet_com/smiles.designbyconet.com/ucontrol/core/settings/diagnostics/index.php
SERVER_ADMIN: webmaster@smiles.designbyconet.com
DOCUMENT_ROOT: /home/designbyconet_com/smiles.designbyconet.com
REMOTE_ADDR: 81.140.37.211
SERVER_PORT: 80
SERVER_ADDR: 64.90.58.75
SERVER_NAME: www.smiles.designbyconet.com
SERVER_SOFTWARE: Apache
HTTP_COOKIE: km_lv=x; km_uq=; km_ai=3-78195; km_ni=3-78195; __utma=106686364.1959835747.1395996165.1412760886.1414155474.24; __utmz=106686364.1395996165.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmv=106686364.Designer|1=user-type=prospect=1^2=user-category=designer=1^3=touchpoint=templateBuilder=1^4=multiple-clients=true=1; cmsa=1; PHPSESSID=le-7rigtpu-EIhxTED8Ds2; _gat=1; _ga=GA1.2.1959835747.1395996165
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8,fr;q=0.6
HTTP_ACCEPT_ENCODING: gzip,deflate,sdch
HTTP_REFERER: https://www.smiles.designbyconet.com/ucontrol/core/settings/diagnostics/
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_CONNECTION: close
HTTP_HOST: www.smiles.designbyconet.com
DH_USER: designbyconet_com
dsid: 28012583
SCRIPT_URI: https://www.smiles.designbyconet.com/ucontrol/core/settings/diagnostics/
SCRIPT_URL: /ucontrol/core/settings/diagnostics/
UNIQUE_ID: VGnCs0BaOksAAH7SvEoAAAAM
FCGI_ROLE: RESPONDER
PHP_SELF: /ucontrol/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1416217267.0278
REQUEST_TIME: 1416217267
Chris McGuicken

Chris McGuicken 1 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What changed between when it was working and now?

Absolutely nothing - it was working at 5pm on Friday and not working at 9am on Monday (and we close weekends).

The only thing anyone done was change the wording of one of the treatments and clicked save.

The resources folder in the FTP is empty too (except for one image!).

Hmmm - developments...

I am able to upload images in a different region (using a different template) - must be a template issue.

Will report back.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, let us know.

Seemed to work for 3 or 4 images again and then cock up.

Same errors?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you turn on debug and let me know what it outputs at the bottom when saving an item after inserting a new image?

Debug Message
SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled='1' AND u.userID=1 AND u.userHash='5b5daf25348e7c4fd0546f7cdc13049c' LIMIT 1
UPDATE perch2_users SET userHash='2fb688ec96b500c1b1b889104db38309' WHERE userID=1
SELECT p.privKey FROM perch2_user_privileges p
SELECT * FROM (SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID
SELECT * FROM perch2_content_regions WHERE regionID=9 LIMIT 1
SELECT * FROM perch2_pages WHERE pageID='6' LIMIT 1
SELECT * FROM perch2_content_items WHERE regionID='9' AND itemRev='18' AND itemID=34 ORDER BY itemOrder ASC
Using template: /templates/content/testimonials.html
INSERT INTO perch2_content_items (itemID, regionID, pageID, itemRev, itemOrder, itemJSON, itemSearch, itemUpdatedBy) SELECT itemID, regionID, pageID, 19 AS itemRev, itemOrder, itemJSON, itemSearch, 1 AS itemUpdatedBy FROM perch2_content_items WHERE regionID='9' AND itemRev=18 ORDER BY itemOrder ASC
REPLACE INTO perch2_resource_log (appID, itemFK, itemRowID, resourceID) SELECT cr.appID, cr.itemFK, c2.itemRowID, cr.resourceID FROM perch2_resource_log cr, perch2_content_items c1, perch2_content_items c2 WHERE cr.appID='content' AND cr.itemFK='itemRowID' AND cr.itemRowID=c1.itemRowID AND c1.itemID = c2.itemID AND c1.regionID='9' AND c2.regionID='9' AND c1.itemRev = 18 AND c2.itemRev = 19
SELECT itemRowID FROM perch2_content_items WHERE regionID='9' AND itemRev=19 ORDER BY itemOrder ASC
UPDATE perch2_content_items SET itemOrder=1000 WHERE itemRowID='1446'
UPDATE perch2_content_items SET itemOrder=1001 WHERE itemRowID='1447'
UPDATE perch2_content_items SET itemOrder=1002 WHERE itemRowID='1448'
UPDATE perch2_content_items SET itemOrder=1003 WHERE itemRowID='1449'
UPDATE perch2_content_items SET itemOrder=1004 WHERE itemRowID='1450'
UPDATE perch2_content_regions SET regionLatestRev=19 WHERE regionID=9
SELECT regionRev FROM perch2_content_regions WHERE regionID='9'
DELETE FROM perch2_content_items WHERE regionID='9' AND itemRev!=18 AND itemRev IN (SELECT itemRev FROM (SELECT DISTINCT itemRev FROM perch2_content_items WHERE regionID='9' ORDER BY itemRev DESC LIMIT 8, 99999) AS t2)
DELETE FROM perch2_resource_log WHERE appID='content' AND itemFK='itemRowID' AND itemRowID NOT IN (SELECT itemRowID FROM perch2_content_items)
SELECT * FROM perch2_content_items WHERE regionID='9' AND itemRev=19 AND itemID=34 ORDER BY itemOrder ASC
DELETE FROM perch2_resource_log WHERE appID='content' AND itemFK='itemRowID' AND itemRowID='1450'
SELECT * FROM perch2_resources WHERE resourceID='200' LIMIT 1
SELECT * FROM perch2_resources WHERE resourceAWOL=0 AND resourceParentID='200' AND resourceKey='thumb'
SELECT * FROM perch2_resources WHERE resourceAWOL=0 AND resourceParentID='200' AND resourceTargetWidth=320 AND resourceTargetHeight=205 AND resourceCrop=1 AND resourceDensity=1
INSERT IGNORE INTO perch2_resources(resourceApp,resourceBucket,resourceFile,resourceKey,resourceParentID,resourceType,resourceCreated,resourceInLibrary,resourceTitle,resourceFileSize,resourceWidth,resourceHeight,resourceMimeType) VALUES('content','default','maria.jpg','orig',0,'jpg','2014-11-17 10:58:54','0','Maria',11348,320,205,'image/jpeg')
SELECT resourceID FROM perch2_resources WHERE resourceBucket='default' AND resourceFile='maria.jpg' LIMIT 1
INSERT IGNORE INTO perch2_resources(resourceApp,resourceBucket,resourceFile,resourceKey,resourceParentID,resourceType,resourceCreated,resourceInLibrary,resourceWidth,resourceHeight,resourceTargetWidth,resourceTargetHeight,resourceDensity,resourceFileSize,resourceMimeType,resourceTitle) VALUES('content','default','maria-thumb@2x.jpg','thumb','200','jpg','2014-11-17 10:58:54','0','150','96',150,150,2,9347,'','Maria thumb@2x')
SELECT resourceID FROM perch2_resources WHERE resourceBucket='default' AND resourceFile='maria-thumb@2x.jpg' LIMIT 1
INSERT IGNORE INTO perch2_resources(resourceApp,resourceBucket,resourceFile,resourceKey,resourceParentID,resourceType,resourceCreated,resourceInLibrary,resourceWidth,resourceHeight,resourceTargetWidth,resourceTargetHeight,resourceCrop,resourceDensity,resourceFileSize,resourceMimeType,resourceTitle) VALUES('content','default','maria-w320h205.jpg','w320h205c1','200','jpg','2014-11-17 10:58:54','0','320','205','320','205','1','1','','','Maria w320h205')
SELECT resourceID FROM perch2_resources WHERE resourceBucket='default' AND resourceFile='maria-w320h205.jpg' LIMIT 1
INSERT INTO perch2_resource_log(`appID`, `itemFK`, `itemRowID`, `resourceID`) VALUES('content','itemRowID',1450,200),('content','itemRowID',1450,201),('content','itemRowID',1450,208)
UPDATE perch2_content_items SET itemJSON='{\"_id\":\"34\",\"text\":\"q3yOM5NFGZo\",\"image\":{\"assetID\":\"200\",\"title\":\"Maria\",\"_default\":\"\\/ucontrol\\/resources\\/maria.jpg\",\"bucket\":\"default\",\"path\":\"maria.jpg\",\"size\":11348,\"w\":320,\"h\":205,\"mime\":\"image\\/jpeg\",\"sizes\":{\"thumb\":{\"w\":\"150\",\"h\":\"96\",\"target_w\":150,\"target_h\":150,\"density\":2,\"path\":\"maria-thumb@2x.jpg\",\"size\":9347,\"mime\":\"\"},\"w320h205c1\":{\"w\":\"320\",\"h\":\"205\",\"target_w\":\"320\",\"target_h\":\"205\",\"crop\":\"true\",\"density\":\"1\",\"path\":\"maria-w320h205.jpg\",\"size\":false,\"mime\":\"\"}}},\"name\":\"Maria\",\"_title\":\"Maria\"}', itemSearch=' q3yOM5NFGZo Maria ' WHERE itemRowID=1450
SELECT * FROM perch2_content_items WHERE regionID='9' AND itemRev=19 ORDER BY itemOrder ASC
Using template: /templates/content/testimonials.html
UPDATE perch2_content_regions SET regionHTML='
\"QvxGKAyA2oU\"
\n\n
\"iA3vSM5ysw8\"
\n\n
\"WSHrFyb4Nmk\"
\n\n
\"eQl_LlSQ6QU\"
\n\n
\"q3yOM5NFGZo\"
\n\n', regionRev=19, regionLatestRev=19 WHERE regionID=9
Setting alert: Content successfully updated (success)
SELECT * FROM perch2_resources WHERE resourceApp='content' AND resourceInLibrary=0 AND resourceCreated<'2014-11-16 10:58:54' AND resourceID NOT IN (SELECT resourceID FROM perch2_resource_log)
SELECT MIN(itemRev) FROM perch2_content_items WHERE regionID='9'
DELETE FROM perch2_content_index WHERE regionID='9' AND itemRev<'12'
SELECT * FROM perch2_content_items WHERE regionID='9' AND itemRev=19 ORDER BY itemOrder ASC
DELETE FROM perch2_content_index WHERE regionID='9' AND itemRev=19
Using template: /templates/content/testimonials.html
INSERT INTO perch2_content_index (itemID, regionID, pageID, itemRev, indexKey, indexValue) VALUES (21,9,6,19,'text','QvxGKAyA2oU'),(21,9,6,19,'image','/ucontrol/resources/barbara.jpg'),(21,9,6,19,'name','Barbara'),(21,9,6,19,'_id',21),(21,9,6,19,'_order','1000')
INSERT INTO perch2_content_index (itemID, regionID, pageID, itemRev, indexKey, indexValue) VALUES (31,9,6,19,'text','iA3vSM5ysw8'),(31,9,6,19,'image','/ucontrol/resources/mary.jpg'),(31,9,6,19,'name','Mary'),(31,9,6,19,'_id',31),(31,9,6,19,'_order','1001')
INSERT INTO perch2_content_index (itemID, regionID, pageID, itemRev, indexKey, indexValue) VALUES (32,9,6,19,'text','WSHrFyb4Nmk'),(32,9,6,19,'image','/ucontrol/resources/judith.jpg'),(32,9,6,19,'name','Judith'),(32,9,6,19,'_id',32),(32,9,6,19,'_order','1002')
INSERT INTO perch2_content_index (itemID, regionID, pageID, itemRev, indexKey, indexValue) VALUES (33,9,6,19,'text','eQl_LlSQ6QU'),(33,9,6,19,'image','/ucontrol/resources/anna.jpg'),(33,9,6,19,'name','Anna'),(33,9,6,19,'_id',33),(33,9,6,19,'_order','1003')
INSERT INTO perch2_content_index (itemID, regionID, pageID, itemRev, indexKey, indexValue) VALUES (34,9,6,19,'text','q3yOM5NFGZo'),(34,9,6,19,'image','/ucontrol/resources/maria.jpg'),(34,9,6,19,'name','Maria'),(34,9,6,19,'_id',34),(34,9,6,19,'_order','1004')
OPTIMIZE TABLE perch2_content_index
UPDATE perch2_pages SET pageModified='2014-11-17 10:58:54' WHERE pageID=6
SELECT * FROM perch2_content_items WHERE regionID='9' AND itemRev=19 AND itemID=34 ORDER BY itemOrder ASC
Queries: 65
Array
(
    [type] => 2
    [message] => Cannot modify header information - headers already sent by (output started at /home/designbyconet_com/smiles.designbyconet.com/ucontrol/core/lib/PerchFieldTypes.class.php:1001)
    [file] => /home/designbyconet_com/smiles.designbyconet.com/ucontrol/core/inc/top.php
    [line] => 14
Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, nothing looks too bad there.

Is this just on your server? Does it work locally?

I got another colleague (in a different location) to try uploading the pics and they were able to do it.

So, all the pics are working now which is great but doesn't really solve the problem unfortunately. I'm assuming you've never came across this before?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I can't say, as I don't have a clear enough picture of what happened.