Potential issue with pdf files and git repos

Matey Chopov matey.chopov at ca.abb.com
Wed Jun 13 18:39:36 UTC 2018


Hi,

It looks like it happens with a specific .pdf manual, I tested it with another .pdf file and the exception didn't occur, the file got pushed correctly.

Here's the line in the trace I think is the most interesting:

DatabaseError: (DatabaseError) file is encrypted or is not a database u'SELECT ui.ui_id AS ui_ui_id, ui.ui_section AS ui_ui_section, ui.ui_key AS ui_ui_key, ui.ui_value AS ui_ui_value, ui.ui_active AS ui_ui_active \nFROM ui \nWHERE ui.ui_key = ?' ('push_ssl',)
2018-06-13 11:07:04.946 ERROR [waitress] Exception when servicing <waitress.channel.HTTPChannel connected 0.0.0.0:12756 at 0x7f06c5923e90>

I have uploaded the surrounding log on pastebin: https://pastebin.com/n9fY4xae
 
So the problematic pdf that I though wasn't encrypted, was actually encrypted with RC4, the weird thing is that in Git Extensions you can still see the file contents in the "diff" section.

Apparently, pdf readers automatically decrypt such files if there is no password (which is the current case).

I used qpdf to decrypt the file (with no password) which gave another valid .pdf file with no encryption (at least that's what I get when I analyze the file with pdfinfo).

Tried pushing that file too, but it still failed.

I played with the pdf headers, changed the Creator and Producer values to the ones of a .pdf file I know could be uploaded. Same error.

I tried converting the file from pdf1.3 to pdf1.4, same issue. 

So, what finally worked for me was converting from pdf to ps, then to text, then from the text file, to ps, and then to pdf. The indexing table got screwed, but that doesn't really bother me. Finally, pushed the new pdf file to the git repo with success.

Commands: 

pdftops test.pdf test.ps
ps2txt test.ps test.txt

enscript -B --margins=10:10 -o test.ps -f Courier at 7.3/1 test.txt
ps2pdf test.ps test_last.pdf

Thanks,

Mat

-----Original Message-----
From: Thomas De Schampheleire [mailto:patrickdepinguin at gmail.com] 
Sent: Wednesday, June 13, 2018 10:33 AM
To: Matey Chopov <matey.chopov at ca.abb.com>
Cc: kallithea-general at sfconservancy.org
Subject: Re: Potential issue with pdf files and git repos


Hi,

2018-06-12 23:29 GMT+02:00 Matey Chopov <matey.chopov at ca.abb.com>:
> Hi guys,
>
>
>
> We couldn't find an existing issue in the bitbucket related to this so 
> here it goes.
>
> Pushing a .pdf file with Git Extensions 2.48.0.5 to a git folder seems 
> to crash kallithea 0.3.2.
>
> For 0.3.5, we get an exception trace in the kallithea log, kallithea 
> doesn't crash, but the push won't complete.
>
> Uploading the pdf file to the git repo via the kallithea web interface 
> works though and is what we use as an alternative.
>

Could you please share the exception trace you get on 0.3.5 and part of the surrounding log?

Do you have this with any pdf file or a specific one?

Thanks,
Thomas


More information about the kallithea-general mailing list