permission error with "pretext view"

14 views
Skip to first unread message

Peter Staab

unread,
Nov 15, 2025, 9:31:44 AMNov 15
to PreTeXt support
This is probably not a pretext issue, but a MacOS issue, but I only see this in pretext.  Here's some background.   I'm running on MacOS 26.1--Tahoe

I have been working on a book and have a GitHub repository.  I just got a new computer this week and instead of copying the directory over from the old computer to the new one, I did a "git clone" from the GitHub repository.  Also installed all of the needed programs. 

pretext build web works fine. 

pretext web fails.  after running with the --verbosity=DEBUG flag, I finally figured out this is a permission problem.  Here's the output from the log file:

DEBUG : CLI version 2.30.2 matches requirements.txt 2.30.2.
ERROR : (pid=900)
DEBUG : Exception info:
------------------------
Traceback (most recent call last):
File "/Users/XXXXXX/.local/pipx/venvs/pretext/lib/python3.14/site-packages/psutil/_psosx.py", line 363, in wrapper
return fun(self, *args, **kwargs)
File "/Users/XXXXXX/.local/pipx/venvs/pretext/lib/python3.14/site-packages/psutil/_psosx.py", line 524, in net_connections
rawlist = cext.proc_net_connections(self.pid, families, types)
PermissionError: [Errno 1] Operation not permitted (originated from proc_pidinfo(PROC_PIDLISTFDS) 1/2)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/XXXXXX/.local/pipx/venvs/pretext/lib/python3.14/site-packages/pretext/cli.py", line 44, in try_except
return ctx.invoke(f, *args, **kwargs)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/Users/XXXXXX/.local/pipx/venvs/pretext/lib/python3.14/site-packages/click/core.py", line 814, in invoke
return callback(*args, **kwargs)
File "/Users/XXXXXX/.local/pipx/venvs/pretext/lib/python3.14/site-packages/pretext/cli.py", line 953, in view
if current_server is not None and current_server.is_active_server():
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/XXXXXX/.local/pipx/venvs/pretext/lib/python3.14/site-packages/pretext/server.py", line 64, in is_active_server
for _, _, _, laddr, _, _ in p.net_connections("all"):
~~~~~~~~~~~~~~~~~^^^^^^^
File "/Users/XXXXXX/.local/pipx/venvs/pretext/lib/python3.14/site-packages/psutil/__init__.py", line 1250, in net_connections
return self._proc.net_connections(kind)
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/Users/XXXXXX/.local/pipx/venvs/pretext/lib/python3.14/site-packages/psutil/_psosx.py", line 369, in wrapper
raise AccessDenied(pid, name) from err
psutil.AccessDenied: (pid=900)

I have made sure that the directory and all subdirectories and files have the right permissions.  I also checked that the TMPDIR has the right permissions, and that does--the "build" seems to use this directory successfully.  

For another wrinkle, I did more troubleshooting.  I copied the directory that contains the entire project with "cp -r lo-book book".  If I do this and move into the "book" directory, then everything runs as expected.   

If I change the name back to "lo-book", then I get the above failed error. 

What directory/files is being used for the "pretext view" command and any idea why the directory name is important.   Clearly, this all used to work correctly on my old computer. 

Peter

Oscar Levin

unread,
Nov 15, 2025, 9:43:32 AMNov 15
to pretext...@googlegroups.com
Thanks for the report.  The log is very helpful there.  I think this is a pretext CLI issue with the tricky hoops we jump through to try to let you view multiple projects at the same time.  I'll try to sort this out asap.

--
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/f92d3ae5-a8c6-4fa1-8ce9-109dfa8097f8n%40googlegroups.com.

Peter Staab

unread,
Nov 15, 2025, 9:53:27 AMNov 15
to PreTeXt support
Another piece of troubleshooting data:'

I have other older books that are also on GitHub and just did a git clone on one of those and everything worked out fine with two of them.  It seems to be this one book--however I'm working on that currently.  

Charilaos Skiadas

unread,
Nov 15, 2025, 10:21:34 AMNov 15
to pretext...@googlegroups.com
I think I can answer the part about the directory making a difference. In order to allow multiple books to be viewable at the same time we cache the process that views the project in a particular location, by using a hash of the path as the key. If you look in the file ~/.ptx/running_servers with `cat ~/.ptx/running_servers` you will see these entries, here’s how mine looks like:

de176d7105 2927 8128 localhost
850137737e 73198 8130 localhost
e6dcbb1eac 97179 8129 localhost
73637ec7bd 6923 8128 localhost
dd24d350be 43774 8128 localhost
eac0c20fa8 29605 8128 localhost

Those first entries correspond to directory paths in your system. When you renamed the path it could no longer find an entry so it created a new one. And sounds like the new one works fine.

If you don’t have too many entries on that file, you can check for the processes (the numbers in the 2nd column, like 2927) with something like `ps | grep 2927` and see if any of them are still active, and shut them down with kill. You can also just delete that file and it will simply start a new process. Though it sounds like there might be some dangling processes that it would be helpful for us to find out why they cause that permissions error.

On a quick glance it seems that the CLI found an active “server” i.e. a process serving the files, and tried to basically verify that the process is still active by asking the OS for some connection and process info, and it is that request that was prevented due to permission errors. So it’s not a question of any directories having permissions, but about the current user running the CLI for some reason not having the permissions to ask those questions.

Can you tell us more about your system? what OS version, if you have multiple user accounts, anything else that you can think of?
If you run `ps | grep pretext` it should give you a list of the active pretext processes, which would basically correspond to active viewing servers. For instance I have entries like:

33334 ttys030    0:00.60 /Users/haris/.pyenv/versions/3.12.4/bin/python /Users/haris/.pyenv/versions/3.12.4/bin/pretext view

That first number would have likely also showed up in the running_servers file.

Charilaos Skiadas
Department of Mathematics
Hanover College


Peter Staab

unread,
Nov 17, 2025, 6:05:01 AMNov 17
to PreTeXt support
I wonder if the running servers was an issue--it has fixed itself, although at the time I thought I only had one server running.  

I'm running MacOS 26.1.   I'm still navigating running iCloud documents on this new computer--it seems like the way the OS handles documents in iCloud has changed recently and I'm wondering if that was a problem that worked itself out as documents synched.   

Peter

Reply all
Reply to author
Forward
0 new messages