Overview
When attempting to reset Tyk Dashboard API access credentials for a user, the operation may fail with an HTTP 500 internal server error. The Dashboard logs report the following error:
level=error msg="Problem removing old user session!" error="key not found"Root Cause
When resetting a user API key via the endpoint PUT /api/users/:userId/actions/key/reset or through the Dashboard UI, the Dashboard attempts to delete the user's existing API session from Redis before generating a new key. If the user was recently created and the session was never written to Redis, or if the session key expired or was flushed, the Redis deletion check returns key not found. The reset handler treats this absence as a fatal failure and aborts before creating the new session key.
Steps to Resolve
To resolve this error, reinstate the user session record in Redis before performing the key reset:
- Log in to the Tyk Dashboard with administrator privileges.
- Navigate to System Management and open Users.
- Select the affected user and click Edit.
- Make a minor update to the user permissions, such as enabling Read access to a section like Analytics.
- Save the updated user profile. Updating permissions forces the Dashboard to initialize and write the user API session into Redis.
- Return to the user profile, navigate to the API Access Credentials section, and select Reset key. The key reset will now complete successfully.
Verification
Confirm that the key reset returns an HTTP 200 response and displays the newly generated API key. Make an authenticated API request to the Tyk Dashboard API using the new access key in the Authorization header to confirm that access is granted without receiving a Not authorised response.
Applies To
- Tyk Dashboard 5.8 LTS
Comments
0 comments
Please sign in to leave a comment.