Troubleshooting Instruqt CLI Authentication Issues

During the usage of Instruqt CLI, you might encounter an error message like this:

[ERROR] token is malformed: token contains an invalid number of segments

This error typically occurs when you run a command like:

instruqt track pull instruqt-demos/test

The error is usually a result of expired authentication.

Solution

To solve this issue, you need to re-authenticate by using the following command:

instruqt auth login

After running the command, log in with your Single Sign-On (SSO) credentials.

Preventive Measures

To prevent similar issues in the future, you can regularly update Instruqt and delete the existing credentials folder. Use the following commands:

  • To update Instruqt:

    instruqt update
  • To delete the existing credentials folder:

    rm -rf .config/instruqt/credentials

By following these steps, you should be able to resolve and prevent most Instruqt CLI authentication issues.