MAAS API disconnecting every 30 minutes or less

Recently started having issues with our MAAS API. Users are having to re-run maas refresh or re-add API key every 30 minutes or less when it used to be a permanent connection. This is causing huge issues with our testing and deployment teams. Seeing the following every 30 minutes or less
`http://maas.io/

Unable to find the server at maas.sif
usage: maas [-h] COMMAND ...

optional arguments:
  -h, --help  show this help message and exit

drill down:
  COMMAND
    login     Log in to a remote API, and remember its description and
              credentials.
    logout    Log out of a remote API, purging any stored credentials.
    list      List remote APIs that have been logged-in to.
    refresh   Refresh the API descriptions of all profiles.
    sif       Interact with http://maas.sif/MAAS/api/2.0/

Hi @hossmoody!

This error message usually means that MAAS CLI was unable to resolve the domain name maas.sif when it was called. That being said, you might want to check the DNS configuration.

Thanks for the reply Igor! I could totally see where you think it would be a DNS Issue, I will look into this but its an API issue for sure. We have 10+ users this is constantly happening to. The only fix is to run the following:
maas login sif http://172...*:5240/MAAS/api/2.0/ API KEY HERE

We are hopping from a shell box to maas, the API drops connection between the two and we have to keep authenticating the API and it only stays connected for 30 minutes or less.

Do you have the same error message when you login using the IP address instead of DNS name? I’ve looked at the code and the error message should be different when you use IP address.

What version and installation of MAAS do you use?

After a bit of testing, I believe you may have nailed it on the head! While my local machine was able to resolve our maas machine, our jumpbox had old incorrect DNS entries. I just started at this job recently so we are trying to fix all these broken issues the previous tech left us with. Will send another update in the next 24 hours. Thank you very much for such a quick reply.

Do you have the same error message when you login using the IP address instead of DNS name? I’ve looked at the code and the error message should be different when you use IP address.

Typically we just use the IP which ive redacted in the original post and would still get the same issues. every 20 to 30 minutes. I will do further testing today after resolving the DNS issue and will provide an update. Thank you again for all the help so far Igor :slight_smile:

Hi @hossmoody

Do you have any update on this one? I am wondering if you got this one solved.

Troy,
I was able to get this issue resolved. Part of the problem was old DNS entires on our jump box, once we had that resolved the connection issue got better, but did not resolve the issue.

The fix was to generate a new API key for each affected user, delete their old connection in MAAS, then re-connect using their new API key.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.