Common errors
The Dashboard cannot connect to the Data API
Section titled “The Dashboard cannot connect to the Data API”Check, in this order:
- The Data API is running. Open
<your-endpoint>/adminmate/api/configin your browser: you should get a JSON response withnot_authorized. That means the Data API answers. If the page does not load, the Data API is not running or not reachable at this URL. - The URL is right. Enter the base URL of the Data API in the environment settings, without
/adminmate/apiand without a trailing slash. - HTTPS. Browsers block calls from
https://app.adminmate.ioto anhttp://URL, exceptlocalhost. Serve your Data API over HTTPS. See Deployment. - Reachability. The Data API is called from your browser, not from Adminmate servers. If it is on a private network, make sure your computer can reach it (VPN…).
“Invalid master password”
Section titled ““Invalid master password””The password you typed does not match the masterPassword of the Data API. Remember that each environment has its own master password, read from the AM_MASTER_PWD environment variable. Restart the Data API after changing it.
not_authorized_ip
Section titled “not_authorized_ip”Your IP address is not in the authorizedIps list of the Data API.
If you are sure your IP address is in the list, your Data API probably runs behind a proxy or a load balancer, so it sees the IP address of the proxy. Configure Express accordingly, for example with app.set('trust proxy', 1). See IP filtering.
not_authorized on every request
Section titled “not_authorized on every request”- Your session expired (after 7 days) or the
authKeychanged: reload the page and enter the master password again. - The
projectIddoes not match: the Data API is configured for another Adminmate project. CheckAM_PROJECT_ID. - The
secretKeyis wrong: the permissions signed by Adminmate cannot be verified. CheckAM_SECRET_KEY.
404 errors or responses from my own app
Section titled “404 errors or responses from my own app”When Adminmate is added to an existing Express app, it must be registered before:
- your authentication middlewares, which would reject the requests of the Dashboard;
- your 404 handler, which would catch them first.
const app = express();
app.use(Adminmate.init({ /* ... */ })); // first
app.use(myAuthMiddleware);app.use('/api', myRoutes);app.use((req, res) => res.status(404).json({ message: 'Not found' }));A model does not appear
Section titled “A model does not appear”- It must be listed in the
modelsarray of your configuration, with amodelproperty. - Restart the Data API after adding it.
- As a user, your team must have access to the model. See Access control.
An action does not appear
Section titled “An action does not appear”- Its
targetmust match where you look:'item'for the item page,'bulk'for a selection in the list. - Its
filterfunction must return something other thanfalsefor the selected records. On a selection, all the records must pass the filter. - As a user, your team must be allowed to use the action.
A segment shows outdated results
Section titled “A segment shows outdated results”A date computed directly in the query of a segment is computed once, when the Data API starts. Use a getter. See Segments based on the current date.
Still stuck?
Section titled “Still stuck?”Contact us from the chat on adminmate.io or at [email protected], with the error message and the version of the Adminmate package you use (npm ls | grep adminmate).