Giter VIP home page Giter VIP logo

Comments (5)

johnsks avatar johnsks commented on August 30, 2024 1

Installing latexmk fixed the issue.

apt install latexmk

curl -H 'Content-Type: application/json' -d '{
    "compile": {
        "options": {
            "compiler": "pdflatex",
            "timeout": 40 
        },
        "rootResourcePath": "main.tex", 
        "resources": [{
            "path": "main.tex",
            "content": "\\documentclass{article}\n\\begin{document}\nHello World\n\\end{document}"
        }]
    }
}' http://127.0.0.1:3013/project/5dcd0ccc7f44c800012d6ebf/compile

Response is:

{"compile":{"status":"success","error":null,"outputFiles":[{"url":"http://localhost:3013/project/5dcd0ccc7f44c800012d6ebf/build/16e801deaaf-2904a437b06f3b11/output/output.synctex.gz","path":"output.synctex.gz","type":"gz","build":"16e801deaaf-2904a437b06f3b11"},{"url":"http://localhost:3013/project/5dcd0ccc7f44c800012d6ebf/build/16e801deaaf-2904a437b06f3b11/output/output.fdb_latexmk","path":"output.fdb_latexmk","type":"fdb_latexmk","build":"16e801deaaf-2904a437b06f3b11"},{"url":"http://localhost:3013/project/5dcd0ccc7f44c800012d6ebf/build/16e801deaaf-2904a437b06f3b11/output/output.pdf","path":"output.pdf","type":"pdf","build":"16e801deaaf-2904a437b06f3b11"},{"url":"http://localhost:3013/project/5dcd0ccc7f44c800012d6ebf/build/16e801deaaf-2904a437b06f3b11/output/output.fls","path":"output.fls","type":"fls","build":"16e801deaaf-2904a437b06f3b11"},{"url":"http://localhost:3013/project/5dcd0ccc7f44c800012d6ebf/build/16e801deaaf-2904a437b06f3b11/output/output.log","path":"output.log","type":"log","build":"16e801deaaf-2904a437b06f3b11"},{"url":"http://localhost:3013/project/5dcd0ccc7f44c800012d6ebf/build/16e801deaaf-2904a437b06f3b11/output/output.aux","path":"output.aux","type":"aux","build":"16e801deaaf-2904a437b06f3b11"}]}}

Thank you for your help and response.

from clsi.

das7pad avatar das7pad commented on August 30, 2024

You forgot to specify the content type along with the json payload:

$ curl -H 'Content-Type: application/json' -d ...

from clsi.

johnsks avatar johnsks commented on August 30, 2024

Thanks for getting back. Added -H 'Content-Type: application/json' and now getting the following error.

{"name":"clsi","hostname":"vpsxxxxx","pid":16606,"level":30,"compileDir":"/root/clsi/compiles/5dcd0ccc7f44c800012d6ebf","mainFile":"main.tex","usesTikzExternalize":false,"usesPsTool":false,"msg":"checked for packages needing main file as output.tex","time":"2019-11-18T19:50:48.433Z","v":0}
{"name":"clsi","hostname":"vpsxxxxx","pid":16606,"level":30,"directory":"/root/clsi/compiles/5dcd0ccc7f44c800012d6ebf","compiler":"pdflatex","timeout":40000,"mainFile":"main.tex","environment":{},"flags":[],"msg":"starting compile","time":"2019-11-18T19:50:48.439Z","v":0}
{"name":"clsi","hostname":"vpsxxxxx","pid":16606,"level":30,"project_id":"5dcd0ccc7f44c800012d6ebf","command":["latexmk","-cd","-f","-jobname=output","-auxdir=/root/clsi/compiles/5dcd0ccc7f44c800012d6ebf","-outdir=/root/clsi/compiles/5dcd0ccc7f44c800012d6ebf","-synctex=1","-interaction=batchmode","-pdf","/root/clsi/compiles/5dcd0ccc7f44c800012d6ebf/main.tex"],"directory":"/root/clsi/compiles/5dcd0ccc7f44c800012d6ebf","msg":"running command","time":"2019-11-18T19:50:48.439Z","v":0}
{"name":"clsi","hostname":"vpsxxxxx","pid":16606,"level":40,"msg":"timeouts and sandboxing are not enabled with CommandRunner","time":"2019-11-18T19:50:48.440Z","v":0}
{"name":"clsi","hostname":"vpsxxxxx","pid":16606,"level":50,"err":{"message":"spawn latexmk ENOENT","name":"Error","stack":"Error: spawn latexmk ENOENT\n at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)\n at onErrorNT (internal/child_process.js:415:16)\n at process._tickCallback (internal/process/next_tick.js:63:19)","info":{},"code":"ENOENT"},"project_id":"5dcd0ccc7f44c800012d6ebf","command":["latexmk","-cd","-f","-jobname=output","-auxdir=/root/clsi/compiles/5dcd0ccc7f44c800012d6ebf","-outdir=/root/clsi/compiles/5dcd0ccc7f44c800012d6ebf","-synctex=1","-interaction=batchmode","-pdf","/root/clsi/compiles/5dcd0ccc7f44c800012d6ebf/main.tex"],"directory":"/root/clsi/compiles/5dcd0ccc7f44c800012d6ebf","msg":"error running command","time":"2019-11-18T19:50:48.450Z","v":0}
{"name":"clsi","hostname":"vpsxxxxx","pid":16606,"level":30,"code":-2,"signal":null,"project_id":"5dcd0ccc7f44c800012d6ebf","msg":"command exited","time":"2019-11-18T19:50:48.452Z","v":0}
{"name":"clsi","hostname":"vpsxxxxx","pid":16606,"level":30,"project_id":"5dcd0ccc7f44c800012d6ebf","time_taken":20,"stats":{"latexmk-errors":0,"latex-runs":0,"latex-runs-with-errors":0,"latex-runs-0":1,"latex-runs-with-errors-0":0},"timings":{"cpu-percent":0,"cpu-time":0,"sys-time":0},"loadavg":[0.001953125,0,0],"msg":"done compile","time":"2019-11-18T19:50:48.455Z","v":0}
{"name":"clsi","hostname":"vpsxxxxx","pid":16606,"level":30,"args":["/root/clsi/compiles/5dcd0ccc7f44c800012d6ebf","(","-name",".cache","-o","-name",".archive","-o","-name",".project-*",")","-prune","-o","-type","f","-print"],"msg":"running find command","time":"2019-11-18T19:50:48.455Z","v":0}
{"name":"clsi","hostname":"vpsxxxxx","pid":16606,"level":40,"err":{"message":"spawn latexmk ENOENT","name":"Error","stack":"Error: spawn latexmk ENOENT\n at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)\n at onErrorNT (internal/child_process.js:415:16)\n at process._tickCallback (internal/process/next_tick.js:63:19)","info":{},"code":"ENOENT"},"project_id":"5dcd0ccc7f44c800012d6ebf","msg":"error running compile","time":"2019-11-18T19:50:48.467Z","v":0}
{"name":"clsi","hostname":"vpsxxxxx","pid":16606,"level":50,"req":{"url":"/project/5dcd0ccc7f44c800012d6ebf/compile","method":"POST","remote-addr":"127.0.0.1","user-agent":"curl/7.58.0","content-length":"328"},"res":{"statusCode":500},"response-time":139476,"msg":"POST /project/5dcd0ccc7f44c800012d6ebf/compile","time":"2019-11-18T19:50:48.470Z","v":0}
{"name":"clsi","hostname":"vpsxxxxx","pid":16606,"level":40,"project_id":"5dcd0ccc7f44c800012d6ebf","outputFiles":[],"msg":"project failed to compile successfully, no output.pdf generated","time":"2019-11-18T19:50:48.474Z","v":0}
_http_outgoing.js:470
throw new ERR_HTTP_HEADERS_SENT('set');
^

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at ServerResponse.setHeader (_http_outgoing.js:470:11)
at ServerResponse.header (/root/clsi/node_modules/express/lib/response.js:767:10)
at ServerResponse.send (/root/clsi/node_modules/express/lib/response.js:170:12)
at ServerResponse.json (/root/clsi/node_modules/express/lib/response.js:267:15)
at ServerResponse.send (/root/clsi/node_modules/express/lib/response.js:158:21)
at /root/clsi/app/js/CompileController.js:96:44
at /root/clsi/app/js/LockManager.js:70:31
at /root/clsi/node_modules/lockfile/lockfile.js:62:47
at FSReqWrap.args [as oncomplete] (fs.js:140:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: npm run compile:app && node $NODE_APP_OPTIONS app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-11-18T19_50_48_513Z-debug.log

Attaching the debug log file.

Any help in resolving the issue is appreciated. Is latexmk needed for CLSI service?

from clsi.

das7pad avatar das7pad commented on August 30, 2024

spawn latexmk ENOENT

texlive is not installed on your system; or not in your PATH?


the traceback is from a duplicate call of a callback #132
cc @mserranom

from clsi.

das7pad avatar das7pad commented on August 30, 2024

Is latexmk needed for CLSI service?

yes.

from clsi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.