First, when trying to access page - http://localhost/drupal/drupal-cvs/files/%C2%ED%F3%F2%F0%E8%20%EA%EE%EC%...

Warning: pg_query(): Query failed: ERROR: invalid UTF-8 byte sequence detected near byte 0xe2 in d:\highspeed\htdocs\drupal\drupal-cvs\includes\database.pgsql.inc on line 125

Warning: ERROR: invalid UTF-8 byte sequence detected near byte 0xe2 query: watchdog INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (1, 'page not found', 'files/������ ���������� - ���_0.jpg', 1, '', 'http://localhost/drupal/drupal-cvs/files/%C2%ED%F3%F2%F0%E8%20%EA%EE%EC%EF%FC%FE%F2%E5%F0%E0%20-%20%F4%EE%ED_0.jpg', '', '127.0.0.1', 1163969314) in d:\highspeed\htdocs\drupal\drupal-cvs\includes\database.pgsql.inc on line 144

--------------------

Second, when trying to add new file with page larger then 128 or with cyryllics in filename.

--------------------

Third, can't add several files.

============
Tests are under Drupal 5.0 cvs, Postgre 8.1

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

doq’s picture

Second, when trying to add new file with path larger then 128 or with cyryllics in filename.

chx’s picture

Status: Active » Closed (won't fix)

You likely are using KOI8-R or some other non UTF-8 charset.

sammys’s picture

@chx is correct about the character set. Check which character set you're using on the computer you're uploading from and ensure it's UTF-8.

Aside from that you've reported a bug with watchdog not being able to report URLs containing a large number of URL escaped chars in the filename. The filename essentially expands to 3 times longer. This is the concern.

There are only two ways around this:

  1. Increase the size of the location field in the watchdog table undesirable
  2. Change upload module to give watchdog a URL that uses the file id desirable

@chx: what do you think?

--
Sammy Spets
Synerger
http://synerger.com

chx’s picture

Title: several problems » too long file urls causes watchdog errors
Priority: Critical » Normal
Status: Closed (won't fix) » Active
FileSize
819 bytes

I am not 100% but that error is triggered in somewhere deep in PHP, Drupal just traps it. I am not sure how could we change the URL... please advice. Writing a function which downloads a file given a fid should not be that hard, I attached the patch for that. The patch DOES NOT fix anything and SHOULD NOT be committed -- it's dead code at this moment.

chx’s picture

FileSize
995 bytes

*grumble* clicked the wrong patch. too many upload issues one night :)

sammys’s picture

Component: upload.module » watchdog.module
Assigned: Unassigned » sammys
FileSize
1.83 KB

Looks like it'll be too difficult to do suggestion 2 due to direct file access 404s invoking a watchdog() call. So the only solution is to convert the watchdog.location field to text. Attached is a patch and it's RTBC for PostgreSQL. Waiting for someone to confirm the update works for MySQL.

sammys’s picture

Status: Active » Needs review
drumm’s picture

Status: Needs review » Fixed

Committed to HEAD.

Heine’s picture

Status: Fixed » Active
FileSize
1.23 KB

MySQL does not support DEFAULT values on TEXT fields (see also http://drupal.org/node/54702).

Heine’s picture

Title: too long file urls causes watchdog errors » regression (default TEXT) by too long file urls causes watchdog errors

This patch introduces a DEFAULT value for a TEXT field, while we just took them all out.

Heine’s picture

Status: Active » Needs review
Dries’s picture

Status: Needs review » Fixed

Committed. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)