ps2pdf Unrecoverable error - unix

I have an unrecoverable error, exit code 1 showing up when I try to convert my .ps files to pdf. It worked just about a half hour ago and now it wont. The file is there!
Error: /undefinedfilename in (10132012a.ps)
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push
Dictionary stack:
--dict:1161/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 9.04: Unrecoverable error, exit code 1
Here is my command:
ps2pdf 10132012a.ps 10132012b.pdf
The ps file was created using latex.
I am running Ubuntu 11.10.

You might try running Ghostscript directly, rather than using the script:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -o 10132012b.pdf 10132012a.ps
or even:
gs -sDEVICE=pdfwrite -o 10132012b.pdf - < 10132012a.ps
The "convenience" scripts (ps2pdf, pdf2ps, etc) use options which might get in the way (although they really shouldn't).

I just found a brilliant way to get this /undefinedfilename error. It took me about 15 minutes to figure it out.
First I did this.
user#host> dvips test1
This is dvips(k) 5.98 Copyright 2009 Radical Eye Software (www.radicaleye.com)
' TeX output 2015.08.04:2315' -> test1.ps
</usr/lib/texmf/dvips/base/tex.pro></usr/lib/texmf/dvips/base/texps.pro>.
</usr/share/texmf/fonts/type1/public/amsfonts/cm/cmr10.pfb>[-1] [-2] [1] [2]
And then I did this.
user#host> ps2pdf text1.ps
Error: /undefinedfilename in (text1.ps)
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push
Dictionary stack:
--dict:1172/3371(ro)(G)-- --dict:0/20(G)-- --dict:70/200(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 8.70: Unrecoverable error, exit code 1
Then it finally hit me. It was a spelling error in the file name. So the command line argument for ps2pdf was a non-existent file.
In my opinion, a better error message would be Cannot find file test1.ps, instead of Error: /undefinedfilename in (text1.ps).

The error means that ps2pdf could not find the file 10132012a.ps.
latex does not create ps files: it creates dvi files which can be converted to ps with dvips.
Perhaps you forgot to run dvips?

Related

How to fix: Jupyter PDF export PNG (in markdown) inclusion failed

Updates at end
After an extremely painful update process largely because PDF export uses XeLaTeX and I have always preferred LaTeX, so different packages needed)...
(Important aside: I think pandoc expects to find everyshi.sty in package MS, but as reported on CTAN it's no longer in that package)
PDF creation fails with this info from the server:
notebook.tex:1678: Unable to load picture or PDF file '
dvipdfmx:fatal: Image inclusion failed for "attachment:9e002d53-d7a5-42e1-8b51-0fdec8f4dad5.png".
No output PDF file written.
Sorry, but xelatex did not succeed.
The log file hopefully contains the information to get MiKTeX going again:
C:\Users\usernamehere\AppData\Local\MiKTeX\2.9\miktex\log\xelatex.log
The xelatax.log shows:
2021-06-10 08:02:26,620+0100 INFO xelatex.core - start process: miktex-dvipdfmx.exe --miktex-enable-installer -q -E -o notebook.pdf
2021-06-10 08:02:28,594+0100 FATAL xelatex.core - Invalid argument
2021-06-10 08:02:28,594+0100 FATAL xelatex.core - Function: fwrite
2021-06-10 08:02:28,594+0100 FATAL xelatex.core - Result: 22
2021-06-10 08:02:28,594+0100 FATAL xelatex.core - Data: <no data>
2021-06-10 08:02:28,594+0100 FATAL xelatex.core - Source: Libraries\MiKTeX\TeXAndFriends\include\miktex/C4P/C4P.h:646
2021-06-10 08:02:28,594+0100 FATAL xelatex - Invalid argument
2021-06-10 08:02:28,594+0100 FATAL xelatex - Info:
2021-06-10 08:02:28,594+0100 FATAL xelatex - Source: Libraries\MiKTeX\TeXAndFriends\include\miktex/C4P/C4P.h
2021-06-10 08:02:28,594+0100 FATAL xelatex - Line: 646
2021-06-10 08:02:28,596+0100 INFO xelatex - this process (37528) finishes with exit code 1
And if we then look in miktex-dvipdfmx.log we find the other end of the call...
2021-06-10 08:02:26,808+0100 INFO miktex-dvipdfmx - this process (4364) started by 'xelatex' with command line: miktex-dvipdfmx.exe --miktex-enable-installer -q -E -o notebook.pdf
2021-06-10 08:02:28,558+0100 ERROR miktex-dvipdfmx - Image inclusion failed for "attachment:9e002d53-d7a5-42e1-8b51-0fdec8f4dad5.png".
2021-06-10 08:02:28,559+0100 INFO miktex-dvipdfmx - this process (4364) finishes with exit code 1
So. Image inclusion failed for the png, which is is an attachment in a markdown cell (a screen grab of previous output so that long-running code doesn't always have to be re-run).
Can anyone confirm this should work (I have seen something, somewhere that there was an issue with images in markdown cells a long time ago) and if so, explain how to resolve this issue?
Update I 29/06/2021
From the xelatex log: there's an "invalid argument message" and the arguments "-q -E -o" just above are for miktex-dvipdfmx.exe, but referring to the dvipdfmx manual I can't find the -q, -o arguments...
Then checking the BASIC manual for dvipddf () and options there -o is the output filename (not a great surprise) but still no sign of a -q option.
That is at least consistent, but... what? How? etc. etc. etc.
Update II of 29/06/2021
Updated miktex; found a new item, miktex-dvipdfmx-bin-x64-2, has been installed! Re-ran notebook export. Different error:
nbconvert failed: PDF creating failed, captured latex output:
Failed to run "xelatex notebook.tex -quiet" command:
notebook.tex:561: Undefined control sequence
checking the miktex-dvipdfmx.log I find
2021-06-10 08:02:26,808+0100 INFO miktex-dvipdfmx - this process (4364) started by 'xelatex' with command line: miktex-dvipdfmx.exe --miktex-enable-installer -q -E -o notebook.pdf
2021-06-10 08:02:28,558+0100 ERROR miktex-dvipdfmx - Image inclusion failed for "attachment:9e002d53-d7a5-42e1-8b51-0fdec8f4dad5.png".
2021-06-10 08:02:28,559+0100 INFO miktex-dvipdfmx - this process (4364) finishes with exit code 1
So the argument error was (presumably) resolved by the use of miktex-dvipdfmx-bin-x64-2, and now there's some other issue in the tex itself
Unfortunately, a full search of C:\ and the separate documents drive fails to find notebook.tex so investigation dead-ends here.
However, note that PDF export works OK for a notebook without embedded "attachments" - I wonder whether it simply can't find the attachment "files"
Final error report from jupyter as 500 server error:
nbconvert failed: PDF creating failed, captured latex output:
Failed to run "xelatex notebook.tex -quiet" command:
notebook.tex:496: Undefined control sequence [17 times]
...
notebook.tex:2119: Unable to load picture or PDF file '
dvipdfmx:fatal: Image inclusion failed for "attachment:9e002d53-d7a5-42e1-8b51-0fdec8f4dad5.png".
No output PDF file written.
Sorry, but xelatex did not succeed.
The log file hopefully contains the information to get MiKTeX going again:
C:\Users\Julian\AppData\Local\MiKTeX\2.9\miktex\log\xelatex.log
And the xelatex log says there was no data
2021-06-29 08:30:42,590+0100 INFO xelatex.core - start process: miktex-dvipdfmx.exe --miktex-enable-installer -q -E -o notebook.pdf
2021-06-29 08:30:43,984+0100 FATAL xelatex.core - Invalid argument
2021-06-29 08:30:43,984+0100 FATAL xelatex.core - Function: fwrite
2021-06-29 08:30:43,984+0100 FATAL xelatex.core - Result: 22
2021-06-29 08:30:43,984+0100 FATAL xelatex.core - Data: <no data>
2021-06-29 08:30:43,984+0100 FATAL xelatex.core - Source: Libraries\MiKTeX\TeXAndFriends\include\miktex/C4P/C4P.h:646
2021-06-29 08:30:43,984+0100 FATAL xelatex - Invalid argument
2021-06-29 08:30:43,984+0100 FATAL xelatex - Info:
2021-06-29 08:30:43,984+0100 FATAL xelatex - Source: Libraries\MiKTeX\TeXAndFriends\include\miktex/C4P/C4P.h
2021-06-29 08:30:43,984+0100 FATAL xelatex - Line: 646
2021-06-29 08:30:43,986+0100 INFO xelatex - this process (38968) finishes with exit code 1
Possibly related: github nbconvert issues
I am having the freaking same problem here too. Now my temporary solution is just to use the Chrome browser feature of print (save as pdf), but then the header part and the footnote just looks so tasteless and annoying.
I was running into this issue as well.
My solution ... use the full path in your attachment definition to the image instead of the relative path. Although, it doesn't render in VS Code when I do that, it does allow nbconvert to now successfully find the file and create the PDF.
Problematic code: (test image)[test_image.jpg]
Working code: (test image)[C:\test_image.jpg]
I cannot say for sure, but I noticed in my error log that it was writing temp files into AppData. I suspected that it was not pulling the images in at that time, then failing to find them relative to that temp file.

pyOptSparse Error: There was an error importing the compiled snopt module during testing of OpenMDAO

I need to use open framework openMDAO for my project in Ubuntu. I have successfully installed mpi4py, petsc, petsc4py by creating new environment in anaconda. I have also installed pyoptsparse and other libraries.
After installation when I run test command $ testflo openmdao -n 1
It gives error as:
(omd) mujahed#Lenovo-G50-80:~$ testflo openmdao -n 1
.............................................................................
+------------------------------------------------------------------------------+
| pyOptSparse Error: There was an error importing the compiled snopt module |
+------------------------------------------------------------------------------+
SSS......../home/mujahed/anaconda3/envs/omd/lib/python3.8/site-packages/openmdao/core/group.py:1113: UserWarning:Group (sub): Attempted to connect from &apos;tgt.x&apos; to &apos;cmp.x&apos;, but &apos;tgt.x&apos; is an input. All connections must be from an output to an input.
.......................................................................................................................................................................................................................................................................................................................................................S...............................................................................................................................S........................................................................S.SS........................................................................................................................................................................................................................................................................SSS.SSSSSS..S.................................................................................................................................................................................................................................................................................................................S.......
+------------------------------------------------------------------------------+
| pyOptSparse Error: There was an error importing the compiled snopt module |
+------------------------------------------------------------------------------+
.....................................................................(mpi) /home/mujahed/anaconda3/envs/omd/lib/python3.8/site-packages/openmdao/core/tests/test_prob_remote2.py:ProbRemoteTestCase.test_get_remote ... FAIL (00:00:0.02, 203 MB)
Traceback (most recent call last):
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/site-packages/testflo/test.py", line 425, in _try_call
func()
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/site-packages/openmdao/core/tests/test_prob_remote2.py", line 200, in test_get_remote
prob.get_val(&apos;par.c2.x&apos;, get_remote=False)
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/unittest/case.py", line 227, in __exit__
self._raiseFailure("{} not raised".format(exc_name))
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/unittest/case.py", line 164, in _raiseFailure
raise self.test_case.failureException(msg)
AssertionError: RuntimeError not raised
...
+------------------------------------------------------------------------------+
| pyOptSparse Error: There was an error importing the compiled snopt module |
+------------------------------------------------------------------------------+
SSS...............................................S.....X......................................................................................................................................................................................
+------------------------------------------------------------------------------+
| pyOptSparse Error: There was an error importing the compiled snopt module |
+------------------------------------------------------------------------------+
..SS............S...capi_return is NULL
Call-back cb_slfunc_in_slsqp__user__routines failed.
.capi_return is NULL
Call-back cb_slfunc_in_slsqp__user__routines failed.
....S..........................SSSSSSS.......
Normal return from subroutine COBYLA
NFVALS = 56 F =-1.080000E+02 MAXCV = 0.000000E+00
X = 3.500001E+00 -3.500001E+00
.................................................
Normal return from subroutine COBYLA
NFVALS = 124 F =-2.733333E+01 MAXCV = 0.000000E+00
X = 6.666667E+00 -7.333332E+00
.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................SSSSSSSSSSSSSSSSSSSSSSSS..............
Normal return from subroutine COBYLA
NFVALS = 54 F =-2.700000E+01 MAXCV = 0.000000E+00
X = 6.999999E+00 -6.999999E+00
.............................................SSS..............................................................................................................S...........................................................................................................................................................................................................................................................................................................................................................
The following tests failed:
test_prob_remote2.py:ProbRemoteTestCase.test_get_remote
Passed: 2619
Failed: 1
Skipped: 62
Ran 2682 tests using 1 processes
Wall clock time: 00:22:33.07
Passed: 2619
Failed: 1
Skipped: 62
I don’t have computer science background and this is the first time I am dealing with something like this.
I am using:
openMDAO 3.2.1
mpich 3.3.2
mpi4py 3.0.3
petsc 3.13.4
petsc4py 3.13.0
pyoptsparse 2.1.5
python 3.8.5
I have build pyoptsparse from https://github.com/OpenMDAO/build_pyoptsparse by command ./build_pyoptsparse.sh.
I have Ubuntu 20.04.1 LTS and I am using Anaconda3. How can I pass all the tests (Without skipping)?
Can please anyone help me with this?
Apologies for this.. it looks like an extraneous file (test_prob_remote2.py) made it into the distribution.. This is not a legitimate test and you can ignore it.
The "pyOptSparse Error" messages are just telling you that you don't have the SNOPT optimizer installed, which is fine.
Your installation should be good.
Some of that test output can be a bit confusing. The error you're getting isn't actually with SNOPT. Thats a warning spit out by pyoptsparse, but it is not a problem.
The actual failed test is identified by this line:
The following tests failed:
test_prob_remote2.py:ProbRemoteTestCase.test_get_remote
And the error that causes the failure is here:
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/site-packages/testflo/test.py", line 425, in _try_call
func()
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/site-packages/openmdao/core/tests/test_prob_remote2.py", line 200, in test_get_remote
prob.get_val('par.c2.x', get_remote=False)
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/unittest/case.py", line 227, in __exit__
self._raiseFailure("{} not raised".format(exc_name))
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/unittest/case.py", line 164, in _raiseFailure
raise self.test_case.failureException(msg)
AssertionError: RuntimeError not raised
For some reason your install isn't raising an error when one is expected. Im not sure why thats going on, but if you're not planning to run with MPI then its not a problem.
You have bothered to install MPI, so you are probably be planning to run things in parallel... this one failed test is certainly odd. If you had a serious problem with your MPI install you would get more failed tests I think.
You could try running testflo like this:
testflo openmdao -n 1 --show_skipped to see if more MPI tests are being skipped... that might help you narrow it down.

Error in invoking target 'client_sharedlib' of makefile oracle 11g centos 7

Hi please help me to solve this problem , thank you
I got stuck during installation of oracle 11g on CENTOS 7 and faced this error
"Error in invoking target 'client_sharedlib' of makefile
'/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/ins_rdbms.mk'. See
'/u01/app/oraInventory/logs/installActions2017-10-17_03-27-55PM.log'
for details."
and this is my log file :
INFO: /u01/app/oracle/product/11.2.0/db_1/bin/genclntsh
INFO: /bin/ld: cannot find -lstdc++_nonshared
INFO: collect2: error: ld returned 1 exit status
INFO: genclntsh: Failed to link libclntsh.so.11.1
INFO: make: *** [client_sharedlib] Error 1
INFO: End output from spawned process.
INFO: ----------------------------------
INFO: Exception thrown from action: make
Exception Name: MakefileException
Exception String: Error in invoking target 'client_sharedlib' of makefile '/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oraInventory/logs/installActions2017-10-17_03-27-55PM.log' for details.
Exception Severity: 1
Please try
# yum install make
# yum install gcc

scala native running demo

After successful building scala native trying to run the demo using following command
cd scala-native
sbt demoNative/run
which returns following error
/home/rimashm/.scalanative/rtlib-0.1-SNAPSHOT/rt.cpp:1:10: fatal error: 'exception' file not found \#include <exception> 1 error generated.
java.io.IOException: Cannot run program "/home/rimashm/MITScriptTest/scala-native/demo/native/target/scala-2.11/demonative-out": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
[trace] Stack trace suppressed: run last demoNative/*:run for the full output. [error] (demoNative/*:run) java.io.IOException: Cannot run program "/home/rimashm/MITScriptTest/scala-native/demo/native/target/scala-2.11/demonative-out": error=2, No such file or directory [error] Total time: 16 s, completed Jun 7, 2016 4:58:18 PM
Scala Native contains a few lines of C++ code in https://github.com/scala-native/scala-native/blob/master/rtlib/src/main/resources/rt.cpp. Given your error message it seems that this part fails to compile. This might have been caused by missing headers for libc++.

PhpUnit 3.6.10 + NetBeans 7.1: Good test throws exception

In cmdline everything is OK:
d:\xampp\htdocs\PhpProject1\Tests>phpunit TestStub.php
PHPUnit 3.6.10 by Sebastian Bergmann.
.
Time: 0 seconds, Memory: 2.75Mb
OK (1 test, 1 assertion)
Called in NetBeans7.1:
Fatal error: Uncaught exception 'PHPUnit_Framework_Exception' with message 'Could not find class "" in "D:\Program Files (x86)\NetBeans 7.1\php\phpunit\NetBeansSuite.php".' in D:\xampp\php\PEAR\PHPUnit\Util\Skeleton\Test.php:123
Stack trace:
0 D:\xampp\php\PEAR\PHPUnit\TextUI\Command.php(157): PHPUnit_Util_Skeleton_Test->__construct('', 'D:\Program File...')
1 D:\xampp\php\PEAR\PHPUnit\TextUI\Command.php(130): PHPUnit_TextUI_Command->run(Array, true)
2 D:\xampp\php\phpunit(46): PHPUnit_TextUI_Command::main()
3 {main}
thrown in D:\xampp\php\PEAR\PHPUnit\Util\Skeleton\Test.php on line 123
I think this is a NetBeans issue.
If I run:
d:\Program Files (x86)\NetBeans 7.1\php\phpunit>phpunit NetBeansSuite.php run=d:\xampp\htdocs\PhpProject1\Tests\TestStub.php
PHPUnit 3.6.10 by Sebastian Bergmann.
.
Time: 0 seconds, Memory: 2.75Mb
OK (1 test, 1 assertion)
It's OK. But if I give the test directory, it fails.
d:\Program Files (x86)\NetBeans 7.1\php\phpunit>phpunit NetBeansSuite.php run=d:\xampp\htdocs\PhpProject1\Tests\
Fatal error: Uncaught exception 'PHPUnit_Framework_Exception' with message 'Could not find class "" in "D:\Program Files (x86)\NetBeans 7.1\php\phpunit\NetBea
nsSuite.php".' in D:\xampp\php\PEAR\PHPUnit\Util\Skeleton\Test.php:123
Stack trace:
0 D:\xampp\php\PEAR\PHPUnit\TextUI\Command.php(157): PHPUnit_Util_Skeleton_Test->__construct('', 'D:\Program File...')
1 D:\xampp\php\PEAR\PHPUnit\TextUI\Command.php(130): PHPUnit_TextUI_Command->run(Array, true)
2 D:\xampp\php\phpunit(46): PHPUnit_TextUI_Command::main()
3 {main}
thrown in D:\xampp\php\PEAR\PHPUnit\Util\Skeleton\Test.php on line 123
Any temporary solution?
When running PHPUnit against a single file it will always open the file and look for a test case inside of it.
When running it against a directory (what netbeans does) it will only look into files that end in *Test.php (unless something else is specified in the phpunit.xml).
If it can't find any Tests it will try to look into the $TestSuiteName folder and {$TestSuiteName}.php files hence the error message:
Fatal error: Uncaught exception 'PHPUnit_Framework_Exception' with message 'Could not find class ""
as it is looking for a "not named" test suite in the netbeans phpunit harness. The error message is really not helping you out there :)
The general suggestion would be to create a phpunit.xml and point Netbeans to it.
On a more personal note: From the phpunit support in the major IDEs Netbeans does quite a lot of things right and works well for a lot of people so don't let this bump discourage you from using it from the IDE if thats what you want.

Resources