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

doq - November 19, 2006 - 22:11
Project:Drupal
Version:5.0-beta1
Component:watchdog.module
Category:bug report
Priority:normal
Assigned:sammys
Status:closed
Description

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

#1

doq - November 19, 2006 - 22:13

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

#2

chx - November 19, 2006 - 23:32
Status:active» won't fix

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

#3

sammys - November 20, 2006 - 00:36

@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

#4

chx - November 20, 2006 - 01:38
Title:several problems» too long file urls causes watchdog errors
Priority:critical» normal
Status:won't fix» active

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.

AttachmentSize
upload_error_0 819 bytes

#5

chx - November 20, 2006 - 01:39

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

AttachmentSize
upload_download 995 bytes

#6

sammys - November 20, 2006 - 03:56
Component:upload.module» watchdog.module
Assigned to:Anonymous» sammys

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.

AttachmentSize
system.install_watchdog_location_20061120_1453_patch.txt 1.83 KB

#7

sammys - November 20, 2006 - 03:57
Status:active» needs review

#8

drumm - November 26, 2006 - 23:42
Status:needs review» fixed

Committed to HEAD.

#9

Heine - December 1, 2006 - 08:30
Status:fixed» active

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

AttachmentSize
watchdog_no_default.patch.txt 1.23 KB

#10

Heine - December 5, 2006 - 22:24
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.

#11

Heine - December 6, 2006 - 04:47
Status:active» needs review

#12

Dries - December 6, 2006 - 16:24
Status:needs review» fixed

Committed. Thanks.

#13

Anonymous - December 20, 2006 - 16:30
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.