Download & Extend

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

Project:Drupal core
Version:5.0-beta1
Component:watchdog.module
Category:bug report
Priority:normal
Assigned:sammys
Status:closed (fixed)

Issue Summary

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

Comments

#1

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

#2

Status:active» closed (won't fix)

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

#3

@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

Title:several problems» too long file urls causes watchdog errors
Priority:critical» normal
Status:closed (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.

AttachmentSizeStatusTest resultOperations
upload_error_0819 bytesIgnored: Check issue status.NoneNone

#5

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

AttachmentSizeStatusTest resultOperations
upload_download995 bytesIgnored: Check issue status.NoneNone

#6

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.

AttachmentSizeStatusTest resultOperations
system.install_watchdog_location_20061120_1453_patch.txt1.83 KBIgnored: Check issue status.NoneNone

#7

Status:active» needs review

#8

Status:needs review» fixed

Committed to HEAD.

#9

Status:fixed» active

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

AttachmentSizeStatusTest resultOperations
watchdog_no_default.patch.txt1.23 KBIgnored: Check issue status.NoneNone

#10

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

Status:active» needs review

#12

Status:needs review» fixed

Committed. Thanks.

#13

Status:fixed» closed (fixed)