Agent Install Token Rejected (HTTP 401)
Symptom
After you trigger an agent install from the panel, the agent binary is deployed to the server and starts, but it immediately fails to register with the panel. The systemd journal shows repeated 401 failures, and the service enters a restart loop:
[agent] Starting OSCam agent version=20260510-102141[agent] Config loaded from /opt/oscam-agent/config.json[agent] Install token found, registering with panel at https://panel.example.com...[agent] Install-register attempt 1/3 failed: install token rejected by panel (HTTP 401)[agent] Retrying in 5s...[agent] Install-register attempt 2/3 failed: install token rejected by panel (HTTP 401)[agent] Retrying in 5s...[agent] Install-register attempt 3/3 failed: install token rejected by panel (HTTP 401)[agent] FATAL: install registration failed: registration: all 3 install-register attempts exhausted: install token rejected by paneloscam-agent.service: Failed with result 'exit-code'.Visible effects in the panel:
- The agent status column shows Unknown (the agent never reaches the heartbeat phase).
- The Scan OScam and Restart action buttons remain disabled for that server.
How to confirm this is the issue
On the OScam server, read the agent journal:
journalctl -u myosicam-agent -n 100 --no-pagerLook for the install token rejected by panel (HTTP 401) line. If it appears, you are hitting
this known issue.
Also check the service restart loop:
systemctl status myosicam-agentIf the Active: line cycles through activating → failed → activating every few seconds, the
agent is looping.
Known causes
Install tokens are short-lived and single-use. A 401 can happen for several reasons:
| Cause | Description |
|---|---|
| Token already consumed | A previous install attempt on the same VPS used the token. The agent config still carries the spent value. |
| Token expired | The token’s validity window passed before the agent first booted (can happen if there was a delay between triggering the install and the agent starting). |
| Token not persisted on the panel | In some cases the panel may fail to record the token before deploying the agent, so the panel has nothing to match against. |
| Wrong panel URL | The agent’s config.json contains a panel URL that does not match the panel that issued the token (e.g., a leftover config from a previous install). |
Recommended action
Step 1 — Stop the restart loop
sudo systemctl stop myosicam-agentsudo systemctl disable myosicam-agentThis prevents the service from consuming resources while you resolve the token issue.
Step 2 — Re-issue a fresh install token from the panel
The most reliable fix is to trigger a new agent install from the panel UI, which generates a fresh, unexpired, unconsumed token:
- Log into your panel.
- Navigate to Servers (or Agents) in the sidebar.
- Find the affected server entry.
- Click Re-install (or Install Agent if the server entry was removed).
- Re-enter the SSH credentials and click Install.
The panel generates a new token, re-deploys the agent binary, and passes the new token to the fresh agent instance.
Step 3 — Verify the server clock is in sync
Token expiry checks are time-sensitive. If the OScam server’s clock is skewed by more than a few minutes relative to the panel server, even a freshly-issued token may be rejected immediately.
Check the clock on the OScam server:
timedatectl statusIf System clock synchronized: no or the time is visibly off, sync it:
sudo timedatectl set-ntp trueIf the problem persists
If a fresh install with a newly-issued token still fails with 401:
- Note the agent version shown in the journal (
version=line in the log above). - Capture the full journal from the new install attempt:
Terminal window journalctl -u myosicam-agent --since "10 minutes ago" --no-pager - Contact support at contact us via myosicam.us with the journal output. Include your panel URL and the agent version string.
The engineering team will use the journal and panel-side logs to diagnose whether this is a token-shape mismatch between the agent binary version and the panel’s expected format — a deeper investigation is required for that class of failure.
Related pages
- Install the Agent — full agent install walkthrough, including troubleshooting table.
- Troubleshooting & FAQ — other common issues.