Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-10-31 15:47:32

Murk
Member
Registered: 2006-07-22
Posts: 12

Images suddenly refuse to upload

I have been merrily uploading images to one of my TXP sites each day. Yesterday I clicked on the Images tab, found the local image, and clicked on upload and the browser window refreshed but no new image appeared. I tried it on my TXP test site on the same server with the same result. The Files upload tab doesn’t work either.

I can use other parts of TXP like Write so I’m stumped. What change on the server would only prevent images and files from being uploaded?

Perhaps the MySQL database got mangled? What table holds the photo and file info?

Thanks.

Here’s the diagnostic on my test site:

Textpattern version: 4.0.5 (r2466)
Last Update: 2007-10-09 01:50:06/2007-10-09 01:50:06
Document root: /home/[mydomain]/public_html
$path_to_site: /home/[mydomain]/public_html
Textpattern path: /home/[mydomain]/public_html/textpattern
Permanent link mode: section_id_title
Temporary directory path: /tmp
Site URL: www.[mydomain].com
PHP version: 4.4.7
GD Image Library: bundled (2.0.28 compatible); supported formats: GIF, JPG, PNG.
Server Local Time: 2007-10-31 10:42:25
MySQL: 4.1.22-standard
Locale: en_GB.UTF-8
Server: Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.7 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a
Apache version: Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.7 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a
PHP Server API: apache
RFC 2616 headers:
Server OS: Linux 2.6.9-55.0.2.ELsmp
Active plugins: rss_live_search-0.7, rss_admin_show_adv_opts-0.3, rss_unlimited_categories-0.7.4, bit_rss-0.4.1

.htaccess file contents:
————————————
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/
Options -Indexes

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]

RewriteRule ^(.*) index.php </IfModule>

#php_value register_globals 0

————————————

Charset (default/config): latin1/utf8
character_set_client: utf8
character_set_connection: utf8
character_set_database: latin1
character_set_results: utf8
character_set_server: latin1
character_set_system: utf8
character_sets_dir: /usr/share/mysql/charsets/
17 Tables: -

PHP extensions: xml, tokenizer/0.1, swf, standard/4.4.7, sockets, session, pspell, posix, pgsql, overload, mysql, mhash, mcrypt, mbstring, imap, gettext, gd, ftp, curl, ctype, calendar, bcmath, zlib/1.1, pcre, openssl, apache

pretext_data: array ( ‘id’ => ‘’, ‘s’ => ‘’, ‘c’ => ‘’, ‘q’ => ‘’, ‘pg’ => ‘’, ‘p’ => ‘’, ‘month’ => ‘’, ‘author’ => ‘’, ‘request_uri’ => ‘/4573a50f782a9fcc4b27e0044b1ccf65/?txpcleantest=1’, ‘qs’ => ‘txpcleantest=1’, ‘subpath’ => ‘\\/’, ‘req’ => ‘/4573a50f782a9fcc4b27e0044b1ccf65/?txpcleantest=1’,
)

/include/txp_category.php: r2243 (3706fea923cd77f7053f7803de169df4)
/include/txp_plugin.php: r1917 (c63f72f33986c08367672fc9fe7b42dd)
/include/txp_auth.php: r2356 (33255ec1ea1a825163c78272496d8783)
/include/txp_form.php: r1913 (ecea3fecf9d7d1f8088cda67f097eceb)
/include/txp_section.php: r1891 (1f0121b3e2969d94bc8a7fb98bfdfbd5)
/include/txp_tag.php: r2260 (1bd67bdb9dcfb72e34ea967e39406216)
/include/txp_list.php: r2450 (997a3b1bec7115bf49b76f62b28da146)
/include/txp_page.php: r2099 (56bde34b6c7bcb9123ac91e73065e894)
/include/txp_discuss.php: r2451 (91e0b29ef39a9471ae5c78d0b1bba086)
/include/txp_prefs.php: r2405 (a4b76476930b2376199f23fbfd5f1ac9)
/include/txp_log.php: r2439 (16730c34e2a437dd88b8f5cc7eff8218)
/include/txp_preview.php: r1238 (696728f35f3557b648c011bb4d6496c3)
/include/txp_image.php: r2439 (9fac6ed0d9d4c3d8196492051f38dc9a)
/include/txp_article.php: r2453 (bdac8fcac5df2f93f10afa7e50c3fb6f)
/include/txp_css.php: r2403 (4e8c52bb1cf5bfe2e2f0640892f9b92e)
/include/txp_admin.php: r2403 (f8700a3d453ece08e7f137b47c967eda)
/include/txp_link.php: r2463 (0a0171bf606296106332d3fdcb83a678)
/include/txp_diag.php: r2361 (dccf3269049dd25e59afdd7ad8d235cd)
/include/txp_file.php: r2403 (e62abd5fcadabe629322ed17135d89eb)
/include/txp_import.php: r1238 (70a6207c0f3604ecfc4b20369986c4d7)
/lib/admin_config.php: r1747 (a2eb09f94d7902a6e95750fc4abcea17)
/lib/txplib_misc.php: r2464 (615afd44a10311f1c0b7852d9bc15d24)
/lib/taglib.php: r1535 (9b519f9dc88791e5ee8eacc029dd6975)
/lib/txplib_head.php: r2404 (2e067b25997cf67cddbdd365570e69d5)
/lib/classTextile.php: r2462 (a031e2ea894e339711c601f230c5ee71)
/lib/txplib_html.php: r2403 (97e173da3058b438513df67fd7d1ceca)
/lib/txplib_db.php: r2406 (5ed67642f805639b54e381fb22efd208)
/lib/IXRClass.php: r765 (137b91497628f0058a2fca9eba5c3b7f)
/lib/txplib_forms.php: r2403 (438a734b52acef40b36d8a3ba23987e8)
/lib/class.thumb.php: r2329 (b2a2fda54371dbd6c40ba553941f090e)
/lib/constants.php: r2361 (ab6d51668fab1e3c98e7d520b1a59f0f)
/lib/txplib_update.php: r1239 (10f28a986d23187b436369dc29ab552f)
/lib/txplib_wrapper.php: r2286 (419125ec74a17a70bf1e86ebfcd45253)
/publish/taghandlers.php: r2444 (cc9de8f2018b01398a2ba542c5f5bdc6)
/publish/atom.php: r2402 (46c4402717f695fde0d49d806adfa4c4)
/publish/log.php: r1637 (5254d0f3942086bc55723923307a51db)
/publish/comment.php: r2460 (2d1ae1dec0784f044e7005fa5ed50930)
/publish/search.php: r1748 (8c86ebcb5be08e214d81ca15a32164ca)
/publish/rss.php: r2393 (09aac29bf22ffa71c1e118e851cff3c3)
/publish.php: r2436 (7087864f1e7c6efe096d3b8e07c350b1)
/index.php: r2466 (30ecf35de5c1edc6ef68e780c8c79daa)
/css.php: r944 (8beba8f83a091068723435cdcdc02f2f)

Offline

#2 2007-10-31 17:59:27

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Images suddenly refuse to upload

Set your website status to Debug instead of Live, perhaps that shows more errors.
Check your webserver error logs as well.
Also check the files and images folder using your browser to see if anything new was uploaded at all.

Offline

#3 2007-10-31 20:26:28

Murk
Member
Registered: 2006-07-22
Posts: 12

Re: Images suddenly refuse to upload

Set TXP to Debug mode. The file on local machine to upload is called lodge-book.jpg

Attempted to upload as image.
Browser refreshed but nothing happened and debug message was empty.

Attempted to upload as file.
Message underneath upload field: No file recorded
Debug message: Failed to upload file lodge-book.jpg -

I checked the error logs for that account but don’t see anything odd. I also checked the files and images folders but there were no new images. I was able to upload a file directly via ftp to the images folder so I don’t think it’s a permissions issue.

How does Textpattern handle images? Is there a separate image table in the database with the numbers cross-referenced to the images folder? If so, then maybe, as I mentioned in my first post, the mysql table is damaged?

Offline

#4 2007-10-31 20:48:59

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Images suddenly refuse to upload

That table is called txp_image

Try this

Offline

#5 2007-11-01 00:17:51

Murk
Member
Registered: 2006-07-22
Posts: 12

Re: Images suddenly refuse to upload

Here’s the output from upload.php:

array(1) {

[“myfile”]=> array(5) { [“name”]=> string(14) “lodge-book.jpg” [“type”]=> string(0) “” [“tmp_name”]=> string(0) “” [“error”]=> int(7) [“size”]=> int(0) }

}

I assume this means that PHP is the culprit. It’s odd that phpmyadmin and info.php show no errors.

Last edited by Murk (2007-11-01 00:20:03)

Offline

#6 2007-11-01 07:53:01

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Images suddenly refuse to upload

UPLOAD_ERR_CANT_WRITE
Value: 7; Failed to write file to disk. Introduced in PHP 5.1.0.

Offline

#7 2007-11-02 21:03:24

Murk
Member
Registered: 2006-07-22
Posts: 12

Re: Images suddenly refuse to upload

@Ruud: My server is using PHP 4.7.7

In any case, I have discovered the culprit. When the server crashed several large .wrk files were created in the tmp directories, filling them up to capacity. Scripts that used the tmp directories had problems, those that created their own tmp directories, or didnt use any at all, were fine. So TXP worked for most things but uploading files via TXP didnt.

Clearing the tmp directories eliminated the problem and we have changed the behavior of the tmp directories so they are virtually unlimited.

Offline

#8 2007-11-03 01:19:43

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Images suddenly refuse to upload

Why not use the “tmp” directory inside the “textpattern” directory?

Offline

#9 2007-11-05 15:43:52

Murk
Member
Registered: 2006-07-22
Posts: 12

Re: Images suddenly refuse to upload

I never set Textpattern or any other application or script to specifically use any tmp directory in the first place. I simply installed a default Textpattern install and began to use it. I assume that Textpattern and other scripts defaulted to using the tmp directories created by Apache, otherwise why would they fail when the server’s tmp directory was full and immediately work again after it was emptied?

As stated before, only the upload functions of Textpattern failed when the server’s tmp directory was full.

Offline

#10 2007-11-05 17:39:18

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Images suddenly refuse to upload

Exactly. Hence my question.

Offline

#11 2007-11-05 18:02:17

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Images suddenly refuse to upload

If “server /tmp” can fill up, so can “textpattern /tmp”.
But in this case, I don’t think it matters as the freshly uploaded images are always first stored in the default PHP /tmp directory (before they are processed by PHP scripts like textpattern), not the textpattern /tmp directory.

Offline

#12 2007-11-05 19:18:22

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,349
Website GitHub Mastodon Twitter

Re: Images suddenly refuse to upload

would the problem have anything to do with this?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB