generate webwork user error

15 views
Skip to first unread message

Aaron Greicius

unread,
Jan 20, 2026, 3:55:38 PM (6 days ago) Jan 20
to PreTeXt support
I am stumped by an error I receive when running "pretext generate webwork" for the project with repository below:


Below you find a passage from the process log with the error at the bottom, followed by the output of pretext support. 

I was able to recreate the error by cloning the repo above. I can say with some assurance that this is a specific issue with this particular project: if I include the files with WW exercises in another project and issue this command, the WW exercises are correctly generated. As a possible clue, the last thing that happens before the error message is that a file is created in the generated-assets/webwork/images director that appears to be the the html for the aim website https://webwork-ptx.aimath.org

As promised, the error message, and then the pretext support output:

building representations of webwork2-hosted WeBWorK problem
sending webwork-1 to server to save in /Users/aarongreicius/218_test/218/generated-assets/webwork/webwork-representations.xml: origin is 'webwork2'
saving image file webwork-1-image-1  in /Users/aarongreicius/218_test/218/generated-assets/webwork/images
error: Unable to generate webwork.  If you already have a webwork-representations.xml file, this might result in unpredictable behavior.
warning: Start tag expected, '<' not found, line 1, column 1 (<string>, line 1)

PreTeXt-CLI version: 2.36.0
    PyPI link: https://pypi.org/project/pretextbook/2.36.0/
PreTeXt core resources commit: 3b7177a830a26fbb7595a2edeaf09478ca71ac93
OS: macOS-14.5-arm64-arm-64bit
Python version: 3.11.4, running from /opt/homebrew/opt/pyt...@3.11/bin/python3.11
Current working directory: /Users/aarongreicius/218_test/218
PreTeXt project path: /Users/aarongreicius/218_test/218
Contents of project.ptx:
------------------------
<!-- This file was automatically generated by PreTeXt 2.19.3. --><!-- If you modify this file, PreTeXt will no longer automatically update it.--><!-- This file, the project manifest, provides the overall configuration for your PreTeXt project. To edit the content of your document, open `source/main.ptx`. See https://pretextbook.org/doc/guide/html/processing-CLI.html#cli-project-manifest. --><project ptx-version="2">
  <targets>
    <target name="web" format="html"/>
    <target name="print" format="pdf"/>
    <target name="latex" format="latex"/>
  </targets>
</project><!-- SAMPLE MANIFEST illustrating all options. Defaults are given (mostly).              --><!-- <project
        ptx-version="2"
        source="source"
        publication="publication"
        output-dir="output"
        site="site"
        stage="output/stage"
        xsl="xsl"
        asy-method="server"
        generated-cache=".cache"
     >
       <targets>
          <target
            name="web"
            format="html"
            source="main.ptx"
            publication="publication.ptx"
            output-dir="web"
            deploy-dir="interactive"
            xsl="custom-html.xsl"
            asy-method="server"
          />
          <target
            name="web-zipped"
            format="html"
            source="main.ptx"
            publication="publication.ptx"
            output-dir="web"
            compression="zip"
            asy-method="server"
          />
          <target
            name="runestone"
            format="html"
            platform="runestone"
          />
          <target
            name="print"
            format="pdf"
            source="main.ptx"
            publication="publication.ptx"
            output-dir="print"
            output-filename="mybook.pdf"
            latex-engine="pdflatex"
            deploy-dir="pdf"
          />
          <target
            name="latex"
            format="latex"
          />
          <target
            name="braille"
            format="braille"
            braille-mode="emboss"
          />
        </targets>
</project>
-->
warning: Unable to locate the command for `mermaid` on your system.
warning: Unable to locate the command for `pdfpng` on your system.
warning: Unable to locate the command for `liblouis` on your system.
aarongreicius@dhcp-129-105-81-191 218 % 

Alex Jordan

unread,
Jan 20, 2026, 4:33:35 PM (6 days ago) Jan 20
to pretext...@googlegroups.com
Heads up there is something here for Sean.

Here is a version of the request that pretext tries to make to get that WeBWorK output:

If you click that, you should see some XML. What matters is this part:
<image source="" width="60%"/>

and that empty source attribute. Now there are two problems.
  1. pretext is not coded to foresee this would be empty. There is a line of regex that goes crazy because of that empty attribute. This is something for me to fix in pretext (I mean in the core pretext repo, not the CLI).
  2. But why is this attribute coming up empty? If I look at the HTML for the problem:
    https://webwork-ptx.aimath.org/webwork2/render_rpc?problemSeed&courseID=anonymous&user=anonymous&passwd=anonymous&sourceFilePath=Library/LoyolaChicago/Precalc/Chap1Sec1/Q01.pg&displayMode=PTX
    There is an error message:
    The macro alias cannot create a link from "/opt/webwork/webwork2/htdocs/tmp/anonymous/images/6ca22944-01d2-379d-9cee-56ff1545b544___134b1583-01c4-319d-85d8-843e013b2126.png" to "/opt/webwork/courses/anonymous/templates/Library/LoyolaChicago/Precalc/Chap1Sec1/Q01_fig.png"
    This suggests there is some permissions issue on webwork-ptx.aimath.org, for the place where webwork2 creates image links.
Sean, are you able to check on permissions up and down this folder:
/opt/webwork/webwork2/htdocs/tmp/anonymous/images/

I will eventually submit a PR to handle the empty attribute case, even though that should not be encountered when the webwork2 server is humming. It will take me some time to get to it, and more time for it to get to the CLI.


--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/d6583c1e-d093-4f66-a2da-49afd3435ec9n%40googlegroups.com.

Rob Beezer

unread,
Jan 20, 2026, 7:13:06 PM (5 days ago) Jan 20
to pretext...@googlegroups.com
I drafted a long message only to realize that maybe your (1) below will be in the Python? (Which I think is the right place for it!). -Rob

On January 20, 2026 11:33:19 AM HST, Alex Jordan <jordanc...@gmail.com> wrote:
>Heads up there is something here for Sean.
>
>Here is a version of the request that pretext tries to make to get that
>WeBWorK output:
>https://webwork-ptx.aimath.org/webwork2/render_rpc?problemSeed&courseID=anonymous&user=anonymous&passwd=anonymous&sourceFilePath=Library/LoyolaChicago/Precalc/Chap1Sec1/Q01.pg&outputformat=ptx&displayMode=PTX
>
>If you click that, you should see some XML. What matters is this part:
><image source="" width="60%"/>
>
>and that empty source attribute. Now there are two problems.
>
> 1. pretext is not coded to foresee this would be empty. There is a line
> of regex that goes crazy because of that empty attribute. This is something
> for me to fix in pretext (I mean in the core pretext repo, not the CLI).
> 2. But why is this attribute coming up empty? If I look at the HTML for
>> <https://groups.google.com/d/msgid/pretext-support/d6583c1e-d093-4f66-a2da-49afd3435ec9n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

Alex Jordan

unread,
Jan 20, 2026, 8:04:09 PM (5 days ago) Jan 20
to pretext...@googlegroups.com
Yes, 1 is for me to address at line 1787 or thereabout, in pretext.py.


Sean Fitzpatrick

unread,
Jan 20, 2026, 8:14:03 PM (5 days ago) Jan 20
to pretext...@googlegroups.com
My Tuesday and Thursday this term are teaching marathons so I'm just seeing this now. I'll check first thing tomorrow, since I'm home, and the info I need to log on is in my office at work. 

It's possible I set the permissions or ownership incorrectly on a folder: I needed to change ownership all over the place from Alex to me.

On Tue, Jan 20, 2026, 6:04 p.m. Alex Jordan <jordanc...@gmail.com> wrote:
Yes, 1 is for me to address at line 1787 or thereabout, in pretext.py.


--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.

Sean Fitzpatrick

unread,
Jan 21, 2026, 11:22:26 AM (5 days ago) Jan 21
to PreTeXt support
OK, Aaron, can you try rebuilding and let me know if you still get the errors?
I compared permissions on the AIM server to my own server.

Everything in /opt/webwork/webwork2/htdocs was owned by wwadmin:wwadmin (replacing wwadmin with the actual user name for the webwork admin...)
This is almost correct, *but* htdocs/tmp should be owned by wwadmin:apache, and everything inside tmp should be owned by apache:apache.

Of course, this is assuming all the ownership is set correctly on my server. (Probably I would have heard about it by now if not!)

Alex Jordan

unread,
Jan 21, 2026, 11:51:59 AM (5 days ago) Jan 21
to pretext...@googlegroups.com
What Sean changed seems to have worked. I can run `pretext generate webwork` on that project and it gets past where it was choking before.

Also I just opened:
so that empty attributes won't be matched.




Aaron Greicius

unread,
Jan 21, 2026, 3:06:03 PM (5 days ago) Jan 21
to pretext...@googlegroups.com
Success! Thanks, Sean. 

Aaron Greicius
Professor of Instruction
2033 Sheridan Road
Evanston, Il 60208


You received this message because you are subscribed to a topic in the Google Groups "PreTeXt support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-support/Lfedyd0qsxA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/7ab4d2b1-b105-41ba-be4e-6ac8715d110bn%40googlegroups.com.

Aaron Greicius

unread,
Jan 21, 2026, 3:07:16 PM (5 days ago) Jan 21
to pretext...@googlegroups.com
Forgot to thank Alex too. Thanks! 

Aaron Greicius
Professor of Instruction
2033 Sheridan Road
Evanston, Il 60208

Reply all
Reply to author
Forward
0 new messages