Overview
Commerce provides two ways to test a server connection. Both ultimately call the module's testConnection() method, which sends a lightweight authenticated request to the Panel API and checks for a valid response.
Always test after adding a server or rotating credentials.
Method 1 — Test on the Server Form
Available on both Add Server and Edit Server pages.
- Fill in all credential fields.
- Click Test Connection.
- An inline result appears immediately — no page reload.
Success: Green banner with server info (e.g. server name, version from the stats endpoint). Failure: Red banner with the error returned by the module.
Fix any errors before clicking Save. Saving a server with bad credentials does not block you, but all provisioning jobs will fail until the credentials are corrected.
Method 2 — Test from the Servers List
- Go to Admin → Infrastructure → Servers.
- Click the test icon (plug icon) in the row for the server you want to test.
- A status badge updates inline: Online or Offline.
This is the fastest way to check all servers at a glance. Run a sweep after network changes or firewall updates.
What testConnection() Does for Opterius Panel
The OpteriusPanelModule::testConnection() method:
- Generates a current Unix timestamp.
- Computes
X-Signature = HMAC-SHA256(timestamp + "", api_token)(empty body for GET). - Sends
GET /api/server/statswithX-TimestampandX-Signatureheaders. - Expects HTTP
200with a valid JSON stats payload. - Returns
ProvisioningResult::success()with the stats data, orProvisioningResult::failure()with the error.
For other module types, testConnection() performs an equivalent lightweight auth check specific to that API.
Common Failures
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized |
api_token is wrong or expired |
Generate a new token in Panel → Settings → API |
Connection refused (cURL 7) |
Wrong port in api_url, or Panel server firewall blocking Commerce IP |
Check the api_url port; open the port on the Panel server firewall |
Could not resolve host |
Typo in the hostname, or DNS not resolving | Check the hostname in api_url |
SSL certificate verify failed |
Panel using a self-signed certificate | Install a valid certificate on Panel, or add SSL_VERIFY=false to Commerce .env |
504 Gateway Timeout |
Panel is overloaded or Nginx/Apache not running | Check Panel server health |
403 Forbidden |
Commerce IP not in Panel's allowlist (if Panel has IP restriction) | Add Commerce server IP to Panel allowlist |
After Changing Credentials
If you rotate an api_token in Panel settings:
- Go to Admin → Infrastructure → Servers → edit the server.
- Paste the new token into the
api_tokenfield. - Click Test Connection — confirm success.
- Save.
If you save without testing and the new token is wrong, all in-flight provisioning jobs will fail. Check the Provisioning Log immediately if services stop provisioning.