View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017097 | mantisbt | db postgresql | public | 2014-03-17 12:45 | 2014-10-16 07:53 |
Reporter | piffio | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | unable to reproduce | ||
Product Version | 1.2.17 | ||||
Summary | 0017097: Images get corrupted when attaching to a bug | ||||
Description | Running MantisBT 1.2.17 on CentOS 6.5 stock, using PostgreSQL 9.3.3 as backend. This is an import of an older installation, previously running on CentOS 6.3 / PostgreSQL 9.2 All the attachments from the old import are working properly. Any new file (images) that we're trying to attach to a bug report gets corrupted. | ||||
Steps To Reproduce | Attach an image (jpg,png) to a bug report. Download the attachment from the bug page. The attachment is corrupted | ||||
Additional Information | The bug appears regardless of the backend used for attachments. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Attached 2 files: the original one, and the same attachment downloaded from my local installation. |
|
When opening with ImageMagik the attachment, I get the following error: display: Corrupt JPEG data: 25 extraneous bytes before marker 0xd9 |
|
If I understand correctly, you can successfully attach and retrieve attachments with the old system, whereas they get corrupted on the new. Can you confirm that the old and new systems running the same version of Mantis ? I'm trying to assert whether this is caused by the version of Postgres or by Mantis itself. If not, what is the version on the old system ? Can you please try to upgrade Mantis on the old system and see if the issue can be reproduced ? PS: would have been nice to produce smaller attachments to reproduce the problem ;) |
|
Hi, Sorry for the size of the attachment :S Just a quick clarification: after a test, I can confirm that file attachment works fine when using the DISK backend, meaning that this should be an issue caused by the postgres version we're using. The old system is Mantis 1.2.12, and I'll try to upgrade it later on, to confirm or not that the bug seems related to PostgreSQL 9.3.X |
|
Some additional details. I was literally reading a diff between the same bytea stored in PostgreSQL 9.2.6 and in PostgreSQL 9.3.3 in the 2 different installations. E.g. In PG 9.2.6 In PG 9.3.3 ...\257''... It looks like something is going wrong with the magic quote handling |
|
OK, using the following workaround fixes the issue. Found it while reading around, especially here: http://mx1.php.net/manual/en/function.pg-escape-bytea.php What is unclear is the reason why this issue is showing up with Postgres 9.3 and not with the previous version. diff --git a/drivers/adodb-postgres64.inc.php b/drivers/adodb-postgres64.inc.php
|
|
Thanks for the updates. I tried without success to reproduce the problem locally using your file - by the way, nice pic ;) On my dev box (Ubuntu 13.10), with both pgsql 9.1 and 9.3, the file was uploaded successfully and can be downloaded and viewed without issues. I also quickly setup a CentOS 6.5 VM, and again, everything worked fine out of the box. For the record, output of pg_escape_bytea is as follows, and does not contain any quotes at all
EDIT: breaking long lines |
|
piffio, You did not provide any feedback; I am therefore resolving this issue as "no change required". Feel free to reopen the issue at a later time and provide the requested information. |
|
MantisBT currently supports Mysql and has support for other database engines. The support for other databases is known to be problematic. Having implemented the current database layer into Mantis 10 years ago, I'm currently working on replacing the current layer. If you are interested in using Mantis with non-mysql databases - for example, Oracle, PGSQL or MSSQL, and would be willing to help out testing the new database layer, please drop me an email at paul@mantisforge.org In the meantime, I'd advise running Mantis with Mysql Only to avoid issues. Thanks |
|