Forum Bugs

HTML build succeeds; Prince XML build fails with "error: failed to load all input documents"

shefulloflight
Hi, folks!

I'm running the desktop version of Prince 14.4 (this is what we currently have the license for) and I publish HTML docs that get built through Jekyll and PDF docs that get built through Prince XML.

Today, when I did a release, the staging branch passed all tests, so I published it. However, when it came to rebuilding the PDFs, one of the guides stalled and remained stalled.

Eventually, I ran `prince` with `--verbose --log=prince.log` and saw this:

    Wed Nov 19 13:01:25 2025: loading document: http://0.0.0.0:4001/qumulo-doc/azure-native-administrator-guide/getting-started/performance-characteristics-default-limits-azure-native-qumulo.html
    Wed Nov 19 13:01:25 2025: loading HTML5 input: http://0.0.0.0:4001/qumulo-doc/azure-native-administrator-guide/getting-started/performance-characteristics-default-limits-azure-native-qumulo.html
    Wed Nov 19 13:01:25 2025: loading document: http://0.0.0.0:4001/qumulo-doc/azure-native-administrator-guide/getting-started/performance-characteristics-default-limits-azure-native-qumulo.html
    Wed Nov 19 13:01:25 2025: http://0.0.0.0:4001/qumulo-doc/azure-native-administrator-guide/getting-started/performance-characteristics-default-limits-azure-native-qumulo.html: error: The requested URL returned error: 404
    Wed Nov 19 13:01:25 2025: http://0.0.0.0:4001/qumulo-doc/azure-native-administrator-guide/getting-started/performance-characteristics-default-limits-azure-native-qumulo.html: error: could not load input file
    Wed Nov 19 13:01:25 2025: error: failed to load all input documents
    Wed Nov 19 13:01:25 2025: finished: failure
    Wed Nov 19 13:01:25 2025: ---- end


I might be missing something really basic here, but this file exists when the docs are built (heck, the page exists when published!). The `*.md` page seems to define a correct `permalink:` field, The sidebar `*.yml` file seems to define the correct `url:` field (it's not even the longest URL there—we were wondering whether the length was the issue) and, again, the docs build and publish perfectly but the Jekyll build for this one particular guide just hangs forever.

Here's a snippet from the bash script that runs my PDF builds.

  echo "Building PDF-friendly HTML site..."
  echo -e "\033[1;33mNote: You can ignore any warnings about setting the locale.\033[0m"
  CONTAINER_ID=$(docker run \
    --rm \
    --user $(id -u):$(id -g) \
    --name docs-container \
    -v "$(pwd)":/src:rw \
    -P \
    --detach \
    --env NOLIVERELOAD=1 \
    --network host \
    docs-builder \
    serve \
    --config "_config.yml,pdfconfigs/${JEKYLL_CONFIG}")

  # Check if the container started successfully
  if [ -z "$CONTAINER_ID" ]; then
    echo "[ERROR] Couldn't start container."
    exit 1
  fi

  # Start streaming logs in the background
  docker logs -f "$CONTAINER_ID" &
  LOG_PID=$!  # Capture process ID of log streaming

  # Wait for Jekyll server to be ready by checking the port
  port=$(grep '^port:' "pdfconfigs/${JEKYLL_CONFIG}" | awk -F: '{print $2;}')

  echo "Waiting for port $port to become available..."
  while ! nc -z localhost "$port"; do
    sleep 0.2
  done

  # Kill the log streaming process after server is ready
  kill "$LOG_PID" 2>/dev/null || true

  echo "Building the PDF..."
  prince --verbose --log=prince.log --javascript --input-list=_site/pdfconfigs/prince-list.txt -o "pdf/${PRINCE_OUTPUT}"


What am I missing?
mikeday
You can check if the URL is valid by running curl or wget on it, but if Prince is getting 404 from that URL then there is not much it can do.
shefulloflight
As I explained, the file is right there, in the build. It's not missing.
mikeday
Can you try downloading it from the specified URL with curl or wget?
shefulloflight
Mike—I've checked. The file is definitely there.

Edited by shefulloflight

wangp
What does the web server log say for the 404 request?

Passing the --debug or --curl-verbose options to prince may provide a hint as to what is happening.

Passing --no-parallel-downloads might help if there is an issue in that version of Prince.

I also suggest checking if the issue is reproducible with a more recent version of Prince.
shefulloflight
Mike . . . I don't have a license for a more recent version of Prince. I'm on 14.4 (`prince --version` reports 14.4, but, IIRC, it's 14.4.1).

Anyway, through trial and error, I found the issue (and the Jekyll HTML build passes in either case, BTW).

Prince builds fine like this:

1. Lorem ipsum dolor sit amet.

1. Consectetur adipiscing elit.

   1. Nullam a augue at nisl pretium volutpat.

      ```bash
      $ ut --laoreet augue
      ```


However, it chokes on this:

1. Lorem ipsum dolor sit amet.

1. Consectetur adipiscing elit.

   1. Nullam a augue at nisl pretium volutpat.

      ```
      $ ut --laoreet augue
      ```


I believe adding the following to `css/printstyles.css` fixes the issue—but more testing is required.

pre {
  page-break-inside: auto !important;
}


IMO, Prince XML should be a lot more helpfully descriptive when it fails on something like this. Was this fixed in the latest version?

Edited by shefulloflight