Troubleshooting

Hopefully the services will start up perfectly and you can start using nextPYP right away. If not, there are a few useful places to look for debugging information.

Messages from the installer

./install stops with one of these when something is missing. Each message says what to do; the notes below add the why.

Apptainer is not installed.

A command-line install (any PYP_* setting on the command line) does not install Apptainer. Add PYP_INSTALL_DEPS=true, or install it by hand as shown on Install nextPYP.

The existing folder <path> is owned by root.

The installer found a folder it needs and it belongs to another account: on a regular-account install every folder must be yours, and on a system install local and shared belong to the service account. sudo chown <account>: <folder>, or choose another path, then run ./install again.

PYP_STORAGE: <path> does not exist; create it, or set PYP_CREATE=true to have it created.

The folder does not exist and PYP_CREATE was not true. Create the folder, or re-run with PYP_CREATE=true. The same message names PYP_LOCAL, PYP_SHARED_DATA or PYP_SHARED_EXEC when one of those is the folder that is missing.

Could not create /path/to/storage for <account>.

A system install could not create a folder, even as the account that should own it. The next line is the reason, and a network filesystem that squashes root is the usual one. Create that folder as an account that can, give it to the account the message names, then run ./install again.

PYP_BINDS: /opt/nextpyp/data is inside a system directory.

Data folders are extra microscopy directories opened inside the container. A system directory, and anything under /opt, /usr, /var or /etc, is refused before config.toml is written. Leave the question blank, or name the folder that holds the data. nextpyp config add pyp.binds applies the same rule later and words it <path> is not allowed as a data folder.

The account nextpyp cannot reach <path>: it may not pass through /home/you.

The folder is inside a directory the service account cannot enter. A home directory is often mode 750 or 700, so only you can enter it. The installer finds this when you answer the question, or in its first pass over the settings, before it has created anything.

The installer does not read permission bits to decide this. It asks the system, as the service account, whether each directory on the way lets that account through. A lab folder that is closed to other accounts (mode 770) is therefore fine when the service account is in its group, and so is a folder that grants access through an access-control list or through the file server’s own rules. Earlier versions required chmod o+x on the shared folder and every parent, and refused such folders.

Choose a folder the account can enter, or let the account through the directory the message names. Any of these does it: add the account to the directory’s group, add an entry for it to the directory’s access-control list (setfacl -m u:nextpyp:x <dir>), or open the directory to every account (chmod o+x <dir>).

Using the answers saved by an earlier run.

A previous run saved its answers in .np/answers in the install directory. ./install --interactive asks again with those answers as the defaults, and a PYP_* setting on the command line wins over a saved answer. Delete .np/answers to start from scratch.

An earlier ./install in this directory did not finish. Continuing it.

The install stopped partway: a download failed, a setting was wrong, or the website did not answer in time. Running ./install again is the fix. Each step looks at what is already there and does only what is missing, with the settings the install was started with.

nextPYP is installed and was started, but the website does not answer yet.

Everything is in place and the service was started; nothing answered on the website’s port within the wait. A first start on a slow disk can take longer. Watch local/logs/micromon, then run ./install again: it continues from the start step. If the service itself did not start, the message is nextPYP is installed, but the service did not start. and journalctl -u nextPYP -n 50 says why.

N settings have to be corrected before anything is installed.

A command-line install checks every PYP_* setting first and lists all the problems at once, each line starting with the setting’s name. Nothing was changed on the machine. Correct them and run the same command again.

The installer program does not match this installer.

./install carries the SHA-256 of the nextpyp program of its release, and the program it found has another. Files of two releases were mixed, or a download was cut short. Download ./install again and, for an offline install, copy the whole release folder again.

An upgrade to <version> did not finish (it stopped at <step>). Run: nextpyp recover

The machine or the command was stopped in the middle of an upgrade or rollback. nextpyp start refuses until this is settled, and nextpyp doctor reports it without touching anything. nextpyp recover reads the record of what was being done and puts the install on one release; see Upgrade.

Release <version> was republished since this copy of it was fetched.

A rolling channel (test, nightly) got a new build after this install fetched its release, so the server no longer has the compute container that belongs to it. Fetch the new build with nextpyp upgrade <version>; the container that jobs are running is left alone until then. Numbered versions are not republished.

nextPYP is already installed. Nothing to do.

installed.toml exists, so the install finished. Change settings with nextpyp config set and upgrade with nextpyp upgrade. ./install --replace replaces the program files but keeps config.toml. --force does the same.

This folder already has an older nextPYP installation.

The folder has program files such as nextPYP.sif and no installed.toml, so nextpyp upgrade cannot take over. ./install stops instead of leaving those files in place. Run ./install --replace. The existing config.toml is kept. --force does the same. The files that were there are kept as a release of their own under releases/, the database is snapshotted first, and nextpyp rollback goes back to them.

This install is running as root, and no everyday login was named.

You ran ./install as root directly rather than through sudo. Add PYP_ADMIN=<your login>, or PYP_ALLOW_ROOT_OWNER=true to keep root ownership.

Another install or upgrade is in progress (pid N on <host>).

A second ./install found the lock of the first. Wait for it, or remove the stale lock the message names if that process is gone.

This machine is aarch64.

The containers are built for x86_64 only.

Console output

Console output for systemd services is saved in the systemd journal. On an administrator install the unit is the system unit nextPYP; on a regular-account install it is the user unit nextpyp:

sudo journalctl -u nextPYP          # administrator install
journalctl --user -u nextpyp        # regular-account install

nextpyp logs (./nextpyp logs from the install folder on a regular-account install) prints the website log without needing to know which unit is in use.

Note

journalctl shows the oldest part of the logs by default, but if you want to see newest part where recent errors are most likely to appear, navigate to the end of the log using the page-down or end keys.

Log files

The various stages of service startup are written to log files in the local/logs sub-folder of your installation folder, eg /nfs/data/apps/nextPYP/local/logs.

  • init.log

    This log records the output of the application server apptainer container startup. It’s the first process to run inside of the application server container and this log file should appear before any others. Errors here indicate that the apptainer container could not start successfully.

  • superd

    This log records the output of supervisord, the init system inside of the application server container. It runs after init.log and starts up the database and HTTP server procceses inside of the container. Errors here indicate that the database and HTTP servers may have failed to start.

  • mongod.log

    This log records the output of the database, MongoDB. Errors here indicate that the database may be unable to operate successfully due to errors with the environment.

  • hostprocessor

    This log records the output of the hostprocessor process, a small shell script to help the application server launch processes outside of the apptainer container on the host OS. The hostprocessor is used by the application server to run compute jobs when no SLURM cluster is attached.

  • micromon

    This log records the output of the HTTP server and the application itself. Every time the application is started, it will print useful diagnostic information to the log. This information can help verify that configuration values are being applied correctly. Errors here can indicate that the HTTP server and application failed to start, and that certain requests to the application resulted in server-side errors.

    This log file is typically the last one to appear in the startup sequence. Its absence usually indicates that some earlier error (hopefully in one of the above logs) prevented the startup sequence from reaching this stage.

Frequently Asked Questions

How do I fix the “Could not write info to setgroups: Permission denied” error when trying to start nextPYP?

The full error reads:

ERROR : Could not write info to setgroups: Permission denied
ERROR : Error while waiting event for user namespace mappings: no event received

This error is usually caused by an incomplete installation of apptainer, the container runtime used by nextPYP. On some systems, apptainer needs to be granted additional permissions with kernel security modules, like AppArmor.

To check if AppArmor is running on your system, run:

sudo systemctl status apparmor

If the above command indicates no apparmor service is running (or even installed), then some security module other than AppArmor may be interfering with apptainer, but we don’t know how fix this issue in that case. If the above command does indicate an active AppArmor service, then you can grant the necessary permissions to apptainer by creating an AppArmor profile.

Create a file at /etc/apparmor.d/apptainer with the following content:

# Permit unprivileged user namespace creation for apptainer starter
abi <abi/4.0>,
include <tunables/global>
profile apptainer /usr/libexec/apptainer/bin/starter{,-suid}
flags=(unconfined) {
userns,
# Site-specific additions and overrides. See local/README for details.
include if exists <local/apptainer>
}

Double-check that the /usr/libexec/apptainer/bin/starter path above refers to your actual apptainer executable:

ls -al "/usr/libexec/apptainer/bin/starter"

If the executable file does exist at that location, then the above AppArmor profile should work on your system. If no executable file exists at that location, then you’ll have to try to find the correct location. Try a search command like:

find /usr -wholename "*/apptainer/bin/starter"

Once you’ve found the correct location of the apptainer executable file, edit the path above in the AppArmor profile.

Finally, to apply the new AppArmor profile, ask the AppArmor service to reload its configuration with:

sudo systemctl reload apparmor

You should now be able to start your nextPYP service without encountering the original error.

If you want to lean more, you can also read the original apptainer docs about how apptainer interacts with AppArmor.

Messages from the installer

These are the lines the installer and nextpyp doctor print. Search for the first line.

ERROR: alice cannot open /data/shared.

nextpyp user-add prints this when the person being linked cannot reach the shared data folder. The next lines name the directory that stops them (That account may not pass through <dir>.) and the ways to let them through: the directory’s group, an entry in its access-control list (setfacl -m u:alice:x <dir>), or chmod o+x <dir>.

The check walks every parent directory and asks the system, as that account, whether each one lets it through. Group membership and access-control lists count, so a lab folder of mode 770 passes for the members of its group. A parent of 700 still blocks everyone but its owner, even when the folder itself looks open. For the website’s own account, nextpyp doctor reports the same thing as PROBLEM: <account> cannot reach the shared folder <path>: it may not pass through <dir>., and ./install refuses such a folder when it is named, before anything is created.

nextpyp doctor run without root cannot ask as another account. Where the permission bits say no but an access-control list or a file server may say yes, it prints NOT CHECKED: whether <account> can reach ... instead of a problem. sudo nextpyp doctor gives the answer.

ERROR: This host already has nextPYP at /opt/nextpyp.

The installer found /opt/nextpyp pointing at a different directory from the one where ./install is running. A second run would rewrite the systemd unit for the install that is already there.

Change to that directory and run nextpyp upgrade. To keep a second copy on the same machine, set PYP_NEW_INSTALL=true.

ERROR: Port 8080 is already in use on this machine.

nextpyp start found another program answering on the website’s port (web.port, 8080 unless you changed it) or on MongoDB’s port (27017) before it started anything. It is not this account’s nextPYP: that case prints nextPYP is already running. Usually it is a nextPYP that another account started on the same machine, or an unrelated web or database server.

ss -ltnp | grep :8080 (as root, to see the program’s name) shows what it is. Stop it, or give this website another port with nextpyp config set web.port <port>. MongoDB’s port cannot be changed, so one machine runs one nextPYP at a time: when two people need their own, run one shared website and give each person a login in it (Enable remote access), or use two machines.

Earlier versions started anyway. The website then stopped inside the container with java.net.BindException: Address already in use in local/logs/micromon, and the start command reported success.

WARN: /path/local/db/mongod.lock belongs to daniel, and the website runs as yang.

nextpyp start prints this, and nextpyp doctor reports it as a problem, when a file of the database belongs to another account than the one that runs the website. It happens when two people start the same install in turn, or when the database was copied or restored by another account.

MongoDB opens its files in a way that only their owner may. It stops with Operation not permitted in local/logs/mongod.log (for example WiredTiger.wt: handle-open: open: Operation not permitted), even when the permission bits or an access-control list let the account write there. Opening up the permissions does not help. Give the whole database folder to the account that runs the website, with the command the message ends with: sudo chown -R <account> <local>/db.

One install is run by one account. nextpyp start as any other account is refused with This install is owned by <account>.; to let several people use the website, give each a login in it (Enable remote access).

/path/local is on a network filesystem (gpfs).

The local folder holds the database and the sockets of the website. ./install warns when it is on a network filesystem (NFS, GPFS, Lustre, BeeGFS, CephFS), nextpyp doctor --verbose notes it, and nextpyp start says it when the website did not come up. Some of these filesystems refuse the file locks and owner-only file flags MongoDB uses, and all of them are slower for a database than a disk of the machine.

If local/logs/mongod.log shows Operation not permitted or lock errors, put the local folder on a disk that is attached to the machine that runs the website: stop the website, copy the folder there as its owner, set web.localDir in config.toml to the new place, and run ./install --replace with PYP_LOCAL set to it. The shared folders stay where they are.

ERROR: Apptainer could not run the website container.

nextpyp start runs the website container once to read config.toml. Here Apptainer itself failed before anything read the file, so the configuration is not the cause. The second line quotes Apptainer, and the third says what to do for the failures seen so far:

  • Failed to create user namespace: user namespace disabled: unprivileged user namespaces are off (the default on EL7) and Apptainer has no setuid starter. As root, install the apptainer-suid package, or turn them on with sysctl -w user.max_user_namespaces=15000 and keep the setting in /etc/sysctl.d.

  • Could not write info to setgroups: Permission denied: AppArmor on Ubuntu 23.10 and later restricts user namespaces. See the question about that message above.

For anything else, nextpyp doctor --smoke runs each container once, as the account that runs it, and reports what stops it.

ERROR: Version 0.8.0 cannot read this install’s config.toml.

Before nextpyp upgrade stops the website, it has the new version read the config.toml this install uses. The new version refused it, and the second line says why: usually a setting that the new version requires and the file does not have yet, or one it no longer accepts. Nothing was changed, and the website is still running the version it had.

Read the release notes of the new version for the settings that changed, correct the file (nextpyp config edit), and run the upgrade again.

Removed stale socket /path/local/sock/host-processor-999999

nextpyp start deletes host-processor-* and user-processor-* sockets in local/sock whose process is no longer running, and prints this line for each one. A live process is left alone. The start then continues.

PROBLEM: The compute container did not see the GPU.

nextpyp doctor --smoke runs nvidia-smi inside the compute container when this machine has an NVIDIA GPU (nvidia-smi on PATH, /dev/nvidia0, or /proc/driver/nvidia). This line means that command failed. On an AMD machine the same smoke test runs the container with --rocm and checks /dev/kfd. When that device is missing it prints PROBLEM: The compute container did not see the AMD GPU The website container and the compute container are reported separately: The website container did not run. and The compute container did not run. The AppArmor section above is the usual cause when no container starts. The smoke test then names one cause: a missing AppArmor profile, SELinux Enforcing, or a missing setuid starter. A GPU warning with the other two succeeding means the container started and did not see the device. When nvidia-smi succeeds, the smoke test prints GPU driver: and CUDA:. When it fails, it says the driver inside the container must match the host driver. When the AMD check succeeds it prints AMD GPU: /dev/kfd is visible. PYP_NV=false skips the NVIDIA flag. PYP_NV=true forces it on. PYP_ROCM=false skips the AMD flag. PYP_ROCM=true forces it on. Put either line in install.env in the installation folder so the service picks it up; from your own shell, set it in the environment of the command.

PROBLEM: This machine has a GPU, but the website counted 0 GPUs

Standalone installs only. nextpyp doctor found a GPU on this machine, but the last available gpus: line the website wrote to local/logs/micromon says 0. Jobs that ask for a GPU will sit at The job is waiting for more resources to become available and never start; a new job that asks for one is now refused at submit time with This job asks for 1 GPU, but this standalone instance has 0. The usual cause is a website container started without Apptainer’s --nv flag, or without --rocm on an AMD machine. Add PYP_NV=true to install.env in the installation folder and run nextpyp restart. On an AMD machine the same line is PYP_ROCM=true. If the count stays at zero, set availableGpus under [standalone] in config.toml; doctor then reports standalone GPUs: 0 (set by [standalone] availableGpus) and does not warn. The installer writes PYP_NV=true or PYP_ROCM=true itself when it finds that GPU, so a fresh install is normally not affected. See the GPU entry in the computing reference.

PROBLEM: Reverse-proxy login has no web.trustedProxies, so every login is refused.

Reverse-proxy login trusts the user header only from 127.0.0.1 and ::1 until web.trustedProxies names the proxy. nextpyp doctor prints this when web.auth is reverse-proxy and the list is not set. Add the proxy’s address with nextpyp config add web.trustedProxies <address>, or bind the website to 127.0.0.1 and run the proxy on the same machine. nextpyp config set refuses the unsafe combination outright: Reverse-proxy login with the default trusted list must bind 127.0.0.1. See Enable remote access.

Not authenticated, access denied

A config written before web.trustedProxies existed has no such entry. With web.auth set to reverse-proxy, the website then trusts the user header only from 127.0.0.1 and ::1. A login from any other proxy is refused with Not authenticated, access denied. nextpyp doctor reports it as Reverse-proxy login has no web.trustedProxies. Add the proxy address to web.trustedProxies in config.toml and restart nextPYP. See Enable remote access.

/data/shared/user-processors is mounted nosuid

Only on a setuid install (web.userSwitch = "setuid", or no such line). A setuid helper on a filesystem mounted nosuid does not switch users. nextpyp user-add stops with ERROR: /data/shared/user-processors is mounted nosuid., and nextpyp doctor reports PROBLEM: ... is on a filesystem mounted nosuid, so per-user helpers there cannot switch users. Move to the sudo helper with sudo nextpyp migrate-user-switch (it shows the plan first; --apply does it), or mount the filesystem suid.

A sudo install does not use that bit. If sudo itself refuses, user-add says <user> could not be run as uid N through the helper. and prints what sudo said. sudo: a terminal is required means requiretty is set; the rule in /etc/sudoers.d/nextpyp must contain !requiretty. a password is required means the rule is missing or the person is not in the nextpyp-users group yet (a directory group can take minutes to show a new member).

SELinux is Enforcing. A container that does not start often needs its label restored.

nextpyp doctor --smoke adds this when a container did not run and getenforce reports Enforcing. Run the restorecon -v command it prints on the container file, then run the smoke test again. The nextpyp command in /usr/bin is a few lines of shell that the installer writes in place, so it gets the right label by itself.

start request repeated too quickly

The nextPYP unit allows 3 starts in 60 seconds (StartLimitIntervalSec=60, StartLimitBurst=3). After that, systemd stops trying and prints start request repeated too quickly. Run nextpyp logs as root: it prints the last 200 lines of the website log and the last 20 journal lines. An install whose service did not start says nextPYP is installed, but the service did not start. and points at journalctl -u nextPYP -n 50.

PROBLEM: web.webhost is http://127.0.0.1:8080, which compute nodes cannot reach.

nextpyp doctor prints this when [slurm] is set and web.webhost is a loopback URL. A compute node cannot open that address on the web server. Set web.webhost to the URL the compute nodes use. nextpyp doctor --path /data/project says which pyp.binds entry opens a folder to the containers (or that none does, with the nextpyp config add pyp.binds command to add it), and whether the website’s account can reach it.

example.lab does not resolve.

PYP_DOMAIN is the name Caddy uses for a public certificate. ./install and nextpyp doctor warn example.lab does not resolve. or example.lab resolves to <address>, a private address. when that name has no public address. Caddy cannot obtain a certificate in either case. Use PYP_REMOTE=true and port 8080 instead of PYP_DOMAIN.

The compute container is not installed, so jobs cannot run.

nextpyp doctor prints this when containers/pyp.sif is missing or points at a file that is gone, and no download is running. nextpyp fetch-containers downloads it again, verified against the release’s signed manifest; nextpyp fetch-status --watch follows it. Do not replace the container by hand with wget -O containers/pyp.sif: that follows the symlink and truncates the file while jobs still have it open.

Could not write in /data/local, so the database cannot be snapshotted.

Before it stops the website, the upgrade writes a small probe file where the database snapshot will go. df can still show free space when the account is over its quota, which is why the next line says a disk quota is a likely cause. Check with quota -s (or lfs quota on Lustre), raise the quota or delete files charged to this account, and run the same command again. A download that cannot write says could not write the file on this machine with the system’s reason, and one that would not fit says There is not enough disk space for the compute container. before it starts.

A command that just sits there

Every program nextpyp starts (apptainer, systemctl, the download tool) has a time limit, and a wait shows what it is waiting for and for how long. A filesystem that does not answer at all, such as a hung network mount, can still block a plain file read with nothing printed. If a command is silent for minutes, check the mounts it uses (df in another terminal hangs the same way), then run the same command again; nothing is left half-done.

A certificate error from the release server

The download tool’s own message is printed. certificate is not yet valid or has expired usually means this machine’s clock is wrong: set it and run the same command again. A certificate rejected for a missing authority means a corporate TLS inspection proxy: install its CA with update-ca-trust (RedHat-based) or update-ca-certificates (Debian-based).