| <<<Back 1 day (to 2017/09/11) | 20170912 |
halabund | I wrote a small piece of software that partly relies on Ghostscript. Today I got a support request that itâs not working, and Ghostscript seems to be showing the following errors on that userâs computer: | 12:41.51 |
| stdout: | 12:42.00 |
| GPL Ghostscript 9.21 (2017-03-16) | 12:42.01 |
| Copyright (C) 2017 Artifex Software, Inc. All rights reserved. | 12:42.02 |
| This software comes with NO WARRANTY: see the file PUBLIC for \ | 12:42.03 |
| details. | 12:42.04 |
| **** Unable to open the initial device, quitting. | 12:42.05 |
| stderr: | 12:42.06 |
| GPL Ghostscript 9.21: **** Could not open temporary file '' | 12:42.19 |
kens | I'm guessing they are using pdfwrite ? | 12:42.31 |
halabund | Does this ring a bell for anyone? Do you have any idea what may be causing it? | 12:42.34 |
| This is the command line: | 12:42.41 |
| "D:\Program Files\gs\gs9.21\bin\gswin64c.exe" -o mt-gs.pdf -dNoOutputFonts -sDEVICE=pdfwrite mt.pdf | 12:42.50 |
kens | Yes, pdfwrite as I suspected | 12:42.58 |
halabund | This command is run within a subdirectory of the userâs temp directory. | 12:43.03 |
| I cannot reproduce it myself, and my package has plenty of users who donât have any problems. It must be a rare occurrence. | 12:43.27 |
kens | Well I'm guessing tehy are running it as a service or somethign similar, maybe from Python or Apache or whatever. I'd further guess that the 'user' they are runnign as does not have permission to write to the temp directory | 12:43.49 |
halabund | Thanks for the tips kens ! Iâll ask him to check for permission issues | 12:44.13 |
kens | Hence why the error says 'Could not open temporary file' | 12:44.14 |
| These come up a lot with people trying to run GS from web front ends | 12:44.30 |
halabund | It actually says âtemporary file âââ, i.e. an empty file name '' | 12:44.36 |
kens | You might like to remind him of the licence at the same time, AGPL covers software as a service | 12:44.54 |
| Hmm. | 12:44.58 |
| I suspect that's just a formatting error | 12:45.12 |
| But I'll have a look | 12:45.16 |
halabund | This time it is actually being run as a sub-process of Mathematica on a personal computer, not server. And Mathematica can write to the temp directory, according to the test scripts I asked him to run. | 12:45.23 |
kens | Yeah but maybe the sub process doesn't have those permissions. | 12:46.04 |
| I don't recall offhand how CreateProcess inherits | 12:46.32 |
| Assuming they are using that. THinking about it if htey are using Mathematica they are probably using fork() | 12:46.50 |
| You should rpobably confirm the OS, make sure its a real Windows port and not being called from Msys or something | 12:47.22 |
halabund | According to my debug log, he has it installed in D:\Program Files\gs\gs9.21\bin\gswin64c.exe That sounds like the official distribution | 12:48.15 |
kens | FWIW that error is returned from gp_open_scratch_file_generic() and hsould have a filename | 12:48.23 |
| Yes, but it doens't tell you what he's running it from | 12:48.41 |
| MSYS can launch Windows executables | 12:48.48 |
| He could be using Windows 10 bash | 12:49.04 |
| I don't knwo much about that | 12:49.09 |
| In any event the filename shold not be empty | 12:49.17 |
| There are really too many places where this could occur | 12:49.58 |
halabund | Itâs run directly from Mathematica. I donât know how Mathematica starts sub-processes, but it works fine on my own Windows machine wit the same Ghostscript and Mathematica versions. Something must be specific to his machine. | 12:50.02 |
| He said it started happening after installing this Inkscape extension: | 12:50.24 |
| https://pav.iki.fi/software/textext/ | 12:50.33 |
kens | And it weas working before ? Then he broke it, not our problem :-) | 12:50.44 |
halabund | It wasnât 100% clear to me that it was really related to that though | 12:50.47 |
kens | There's only one call to gp_open_scratch_file in pdfwrite fortunatley | 12:51.11 |
| Umm, but that is called form a number of places :-( | 12:51.52 |
halabund | Thanks for the help! | 12:52.50 |
| Donât spend more time on this | 12:52.53 |
kens | I cna't see any real way to get there with an empty filename, sorry | 12:53.07 |
halabund | I just asked in case itâs a common or obvious problem, but it seems it isnât. | 12:53.45 |
kens | Nope, the only times I'vwe seen that kind of problem its been permissions problems | 12:54.03 |
| This seems different | 12:54.13 |
| halabund I just checked and all cases where pdfwrite opend a temporary file, we prefix the filename with _temp_ so I can't see how the filename could be empty | 12:57.54 |
halabund | And that ââ really denotes and empty file name, right? | 12:58.15 |
| âCould not open temporary file âââ | 12:58.31 |
kens | The error message uses %s to pritn 'fname' which is the filename | 12:58.58 |
halabund | Maybe after the installation of some other software, Ghostscript picks up some bad DLLs and malfunctions. | 12:58.58 |
kens | I was going to suggest that meybe they have ended up with another version of Ghostscript installed | 12:59.18 |
| Its hard to see how, but installing an extension could conceivably do it | 12:59.35 |
acukan | hi guys i am having a problem with pdftk burst output some times it writes 0k pdf file | 14:14.48 |
| like this | 14:14.51 |
| -rw-r--r-- 1 www-data www-data 0 Sep 12 15:42 multipage_adv_belge_234328_page_10.pdf | 14:14.57 |
kens | And ts is related to Ghostscript how ? | 14:15.10 |
acukan | do you have any idea why it can do like this | 14:15.12 |
kens | pdftk is nothign to do with us, as far as I know | 14:15.23 |
acukan | i assumed pdftk uses ghostscript | 14:15.24 |
kens | Not to the best of my knowledge | 14:15.36 |
acukan | oh shit man | 14:15.37 |
| i remembered it that way sorry guys for your time :( | 14:15.53 |
kens | NP | 14:15.57 |
acukan | long work hours :( | 14:16.01 |
bencc | is it ok to use gs or mupdf in a commercial project on a server if all I do is execute the command line tool? | 14:50.04 |
| no modification | 14:50.08 |
| no linking | 14:50.11 |
kens | Depends | 14:50.20 |
bencc | on what? | 14:50.26 |
kens | If you are offering software as a service | 14:50.28 |
bencc | yes | 14:50.34 |
kens | Then you need to read te AGPL, I'm afraid there are on lwayers here, we cannot give you a legal opinion | 14:51.03 |
| Software as a service is a gray area for me, so I can't advise you | 14:51.27 |
bencc | not that gray :) | 14:52.15 |
| I would like to use mupdf to convert pdf to svg | 14:52.26 |
kens | It is to me, but I'm not a lawyer | 14:52.26 |
bencc | as a command line tool | 14:52.30 |
kens | Well this is the Ghostscript channel, for Mupdf you want the MuPDF channel #mupdf | 14:52.43 |
| Broadly though, if you are returning the SVG files to the submitter of the PDF, then I think that would be covered and you'd have to open source your whole chain of tools, or seek a commercial licence | 14:54.00 |
bencc | ok | 15:02.56 |
| thanks | 15:02.58 |
kens | YW | 15:03.05 |
| Forward 1 day (to 2017/09/13)>>> | |