SageMath output blocked by CORS policy

18 views
Skip to first unread message

Thomas Shemanske

unread,
Feb 4, 2026, 2:23:27 PM (11 days ago) Feb 4
to PreTeXt support
Hopefully I am not asking a silly question, but I​ was testing some old PreTeXt docs with sage cells and noticed they were not rendering output.  So as a check I went to the PTX guide https://pretextbook.org/doc/guide/html/basics-s-sage-cell.html​, and tried to evaluate that cell; it too produced no output.

The developer error logs for Chrome and Firefox are below in full, but the gist is:

basics-s-sage-cell.html:1 Access to XMLHttpRequest at 'https://sagecell.sagemath.org/kernel?CellSessionID=9377c8c…&timeout=inf&accepted_tos=true' from origin 'https://pretextbook.org' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

​Since I have viewed sage cells many times on these browsers, and my local copy of Sage works fine, I am not thinking it is a browser issue, but who knows.

Since I was not using one of my documents, pretext support may not be useful, but here is a short version:
pretext support
PreTeXt-CLI version: 2.36.0

warning: No project.ptx manifest found in current workspace.  Using global configuration specified in '~/.ptx/2.36.0/project.ptx'.

Please share the following information when posting to the
pretext-support Google Group.

PreTeXt-CLI version: 2.36.0
   PyPI link: https://pypi.org/project/pretextbook/2.36.0/
PreTeXt core resources commit: 3b7177a830a26fbb7595a2edeaf09478ca71ac93
OS: Linux-6.18.5+deb14-amd64-x86_64-with-glibc2.42
Python version: 3.13.11, running from /home/trs/.local/share/pipx/venvs/pretext/bin/python
Current working directory: /home/trs
No project.ptx found.



Any guidance appreciated.

Tom


Chrome error log:
tex-chtml.js:1 No version information available for component [tex]/newcommand
console.js:19 sagecell.makeSagecell called
console.js:19 sagecell.makeSagecell finished
basics-s-sage-cell.html:1331 A parser-blocking, cross site (i.e. different eTLD+1) script, https://secure.statcounter.com/counter/counter.js, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
basics-s-sage-cell.html:1331 A parser-blocking, cross site (i.e. different eTLD+1) script, https://secure.statcounter.com/counter/counter.js, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
tex-chtml.js:1 No version information available for component [pretext]/mathjaxknowl3.js
basics-s-sage-cell.html:90 in ready function
bookfuncs.js:504 This page served by undefined
bookfuncs.js:592 triggering runestone:pre-login-complete
webpack.index.js:208 Runestone pre-login complete
pretext_add_on.js?x=1:192 adding video popouts
pretext_add_on.js?x=1:305 scrollWidth 15
pretext.js:50 setting up pretext
/favicon.ico:1 Failed to load resource: the server responded with a status of 404 (Not Found)
runestonebase.js:146 Not logging event {"event":"sage","act":"run","div_id":"basics-s-sage-cell-8","course_name":"PTX_Course_Title_Here","clientLoginStatus":false,"timezoneoffset":5}
basics-s-sage-cell.html:1 Access to XMLHttpRequest at 'https://sagecell.sagemath.org/tos.html' from origin 'https://pretextbook.org' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
kernel.js:107 Kernel: kernel_starting (null)
sagecell.sagemath.org/tos.html:1 Failed to load resource: net::ERR_FAILED
basics-s-sage-cell.html:1 Access to XMLHttpRequest at 'https://sagecell.sagemath.org/kernel?CellSessionID=9377c8c…&timeout=inf&accepted_tos=true' from origin 'https://pretextbook.org' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
utils.js:731

Object

utils.js:733 API request failed (0): error
sagecell.sagemath.or…accepted_tos=true:1 Failed to load resource: net::ERR_FAILED

Press ctrl i to turn on code suggestions. Press ctrl x to disable code suggestions.
ctrli to turn on code suggestions. Don't show again


Firefox​ error log:

Cookie warnings 3
No version information available for component [tex]/newcommand tex-chtml.js:1:16471
Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. jquery.min.js:2:50785
sagecell.makeSagecell called console.js:19:25
sagecell.makeSagecell finished console.js:19:25
No version information available for component [pretext]/mathjaxknowl3.js tex-chtml.js:1:16471
GEThttps://pretextbook.org/favicon.ico[HTTP/1.1 404 Not Found 42ms]
in ready function basics-s-sage-cell.html:90:15
This page served by undefined bookfuncs.js:504:13
triggering runestone:pre-login-complete bookfuncs.js:592:13
Runestone pre-login complete webpack.index.js:208:13
adding video popouts pretext_add_on.js:192:13
scrollWidth 0 pretext_add_on.js:305:14
setting up pretext pretext.js:50:13
Partitioned cookie or storage access was provided to “https://c.statcounter.com/t.php?sc_project=9664088&u1=F63635D6C5F94FC996E8CB33758FE19C&java=1&security=6e60c510&sc_snum=1&sess=ce99ee&p=0&rcat=d&rdomo=d&rdomg=207&jg=207&rr=3.3.2.1.1.1.1.1.1&sc_bot=0&resolution=2560&h=1440&camefrom=https%3A//pretextbook.org/doc/guide/html/part-author.html&u=https%3A//pretextbook.org/doc/guide/html/basics-s-sage-cell.html&t=SageMathCells&invisible=1&sc_rum_e_s=829&sc_rum_e_e=1640&sc_rum_f_s=0&sc_rum_f_e=813” because it is loaded in the third-party context and dynamic state partitioning is enabled.
Not logging event {"event":"sage","act":"run","div_id":"basics-s-sage-cell-8","course_name":"PTX_Course_Title_Here","clientLoginStatus":false,"timezoneoffset":5} runestonebase.js:146:21
XHRPOSThttps://sagecell.sagemath.org/tos.htmlCORS Missing Allow Origin
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://sagecell.sagemath.org/tos.html. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 503.
starting timer from 1770230949299 console.js:25:26
Kernel: kernel_starting (null) kernel.js:107:21
XHROPTIONShttps://sagecell.sagemath.org/kernel?CellSessionID=9e78482ca0fa45158468930e1099b7d4&timeout=inf&accepted_tos=trueCORS Missing Allow Origin
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://sagecell.sagemath.org/kernel?CellSessionID=9e78482ca0fa45158468930e1099b7d4&timeout=inf&accepted_tos=true. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 503.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://sagecell.sagemath.org/kernel?CellSessionID=9e78482ca0fa45158468930e1099b7d4&timeout=inf&accepted_tos=true. (Reason: CORS request did not succeed). Status code: (null).
Object { readyState: 0, getResponseHeader: getResponseHeader(e), getAllResponseHeaders: getAllResponseHeaders(), setRequestHeader: setRequestHeader(e, t), overrideMimeType: overrideMimeType(e), statusCode: statusCode(e), abort: abort(e), state: state(), always: always(), catch: catch(e), … }
utils.js:731:17
API request failed (0): error utils.js:733:17

Iterate on your code faster with the new multi-line editor mode. Use Enter to add new lines and Ctrl+Enter to run.

Mitch Keller

unread,
Feb 4, 2026, 2:31:25 PM (11 days ago) Feb 4
to pretext...@googlegroups.com
It appears that the SageCell server is down, as going to https://sagecell.sagemath.org/ gives me a 503 error. Thus, I’m not sure that the CORS policy message is actually an issue or if it’s a bigger issue with Sage things at the moment.

--
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/fa0c11b0-468a-42ae-af96-15e233886586n%40googlegroups.com.


Randall Pruim

unread,
Feb 4, 2026, 2:33:50 PM (11 days ago) Feb 4
to pretext...@googlegroups.com

kcri...@gmail.com

unread,
Feb 5, 2026, 12:27:05 PM (10 days ago) Feb 5
to PreTeXt support
For what it's worth, it seems that the server is back up!

Randall Pruim

unread,
Feb 5, 2026, 1:23:07 PM (10 days ago) Feb 5
to pretext...@googlegroups.com, PreTeXt support
Great. Thanks for alerting me. 

Sent from my iPhone

On Feb 5, 2026, at 12:27, kcri...@gmail.com <kcri...@gmail.com> wrote:

For what it's worth, it seems that the server is back up!

--
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.

Robert D. Poodiack

unread,
Feb 5, 2026, 1:33:48 PM (10 days ago) Feb 5
to pretext...@googlegroups.com
Yep! Was able to work with it this morning in class. Thanks!

 RP 


Robert D. Poodiack, Ph.D. (he/him/his)
Professor of Mathematics

Cabot Science 288 (U288)
Norwich University
158 Harmon Drive
Northfield, VT  05663
(802) 485-2339
rpoo...@norwich.edu

  

From: pretext...@googlegroups.com <pretext...@googlegroups.com> on behalf of kcri...@gmail.com <kcri...@gmail.com>
Date: Thursday, February 5, 2026 at 12:27 PM
To: PreTeXt support <pretext...@googlegroups.com>
Subject: Re: [pretext-support] SageMath output blocked by CORS policy

EXTERNAL SENDER: This email is from an account outside of Norwich University. Please use caution when clicking links or opening attachments, and do not provide your username or password. NOTE: If you are seeing this notice on a message that appears to come from a Norwich University employee, please report this message using the Report Email button and take no further action.

 

For what it's worth, it seems that the server is back up!
--
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.
Reply all
Reply to author
Forward
0 new messages