Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-51681

Jenkins job hangs while running pdflatex inside .bat

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Incomplete
    • Component/s: core
    • Labels:
      None
    • Environment:
      Node running OS: Windows10 64 bit node,
      pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6630 64-bit)
    • Similar Issues:

      Description

      While running a .bat inside a jenkins job, on a windows 10 slave node, at the point where a pdf is to be generated, using pdflatex of miktex, the job hangs indefinitely. No error is generated or whatsoever. I have been running the same .bat script, at the same node, with the exact same tools and configuration, by hand, all this time, and it works like a charm. Problem occurs when loading ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-cfg\graphics.cfg") Here's the output

      This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6630 64-bit)
      entering extended mode
      ("manual.tex"
      LaTeX2e <2017-04-15>
      Babel <3.18> and hyphenation patterns for 75 language(s) loaded.
      ("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
      Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
      ("C:\Program Files\MiKTeX 2.9\tex\latex\base\size12.clo"))
      ("C:\Program Files\MiKTeX 2.9\tex\latex\geometry\geometry.sty"
      ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty")
      ("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty")
      ("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifvtex.sty")
      ("C:\Program Files\MiKTeX 2.9\tex\generic\ifxetex\ifxetex.sty")
      ("C:\Program Files\MiKTeX 2.9\tex\latex\geometry\geometry.cfg"))
      ("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\helvet.sty")
      ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
      ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
      ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\trig.sty")
      ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-cfg\graphics.cfg")

        Attachments

          Activity

          Hide
          arisdg Aris DG added a comment - - edited

          For anyone interested I managed to resolve this issue by removing the old MiKTeX install, and instaling TeX Live from scratch. I had installed MiKTeX from chocolatey so maybe that's what caused the issue at the first place. Still it's interesting enough why no error was prompted and why I was able to compile my pdf by hand.

          Show
          arisdg Aris DG added a comment - - edited For anyone interested I managed to resolve this issue by removing the old MiKTeX install, and instaling TeX Live from scratch. I had installed MiKTeX from chocolatey so maybe that's what caused the issue at the first place. Still it's interesting enough why no error was prompted and why I was able to compile my pdf by hand.
          Hide
          danielbeck Daniel Beck added a comment -

          Probably just another case of the agent process being headless. When started as a service, there's no desktop session by default, so anything involving UI, even invisibly, doesn't work. Given where it hangs, seems most likely.

          Show
          danielbeck Daniel Beck added a comment - Probably just another case of the agent process being headless. When started as a service, there's no desktop session by default, so anything involving UI, even invisibly, doesn't work. Given where it hangs, seems most likely.
          Hide
          cwerth Caleb Werth added a comment -

          I ran face first into this exact issue this week at work. It was not feasible to switch to TeX Live like Aris DG suggested, so we needed to figure out what was actually going wrong. Here's a picture of the real problem, which is exactly what Daniel Beck thought:

           

           

          By default, Jenkins runs as SYSTEM on Windows. SYSTEM will not be looking in your user path for packages. So when MiKTeX runs into a package that SYSTEM can't find, it will attempt to download them. However, you need admin to install them into Program Files, so... A GUI will pop up and ask you for admin permission. This GUI is essentially invisible from a Jenkins point of view and it will look like it's just hanging there.

          To find this out, we had to open a shell as SYSTEM by using PsExec and running the command ".\psexec -i -s cmd.exe" in PowerShell. From the newly opened cmd window, we could run the same command with the same user running in Jenkins manually. Once we installed the packages for SYSTEM using the GUI, we were able to build the document through Jenkins.

          Hope this explanation will save someone some time!

          Show
          cwerth Caleb Werth added a comment - I ran face first into this exact issue this week at work. It was not feasible to switch to TeX Live like Aris DG suggested, so we needed to figure out what was actually going wrong. Here's a picture of the real problem, which is exactly what Daniel Beck thought:     By default, Jenkins runs as SYSTEM on Windows. SYSTEM will not be looking in your user path for packages. So when MiKTeX runs into a package that SYSTEM can't find, it will attempt to download them. However, you need admin to install them into Program Files, so... A GUI will pop up and ask you for admin permission. This GUI is essentially invisible from a Jenkins point of view and it will look like it's just hanging there. To find this out, we had to open a shell as SYSTEM by using PsExec and running the command ".\psexec -i -s cmd.exe" in PowerShell. From the newly opened cmd window, we could run the same command with the same user running in Jenkins manually. Once we installed the packages for SYSTEM using the GUI, we were able to build the document through Jenkins. Hope this explanation will save someone some time!

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            arisdg Aris DG
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: