gagebenne/pydexcom

Passord not valid : AccountError

Closed this issue · 12 comments

While trying to use the API with a username and password that exists and sensor is working, I am constantly getting the following error. Any help
Screenshot 2022-02-04 at 8 11 40 PM

Hi there, what country is the Dexcom user from? Non-US account should use the ous=True flag. After that, try changing to password, the REAME indicates some of the odd password requirements that could be causing issues. Let me know if issues persist!

Some people have had problems with connecting when their Dexcom passwords are entirely numeric. If you have connection issues in that case, try changing your password to something with a mix of numbers and letters. Specifically, the module will use the Dexcom user’s credentials, not the follower’s credentials -- so that'd be the password to change!

Also be sure there the Dexcom Share feature in your Dexcom G6 App is setup to use this module. Enabling the Dexcom Share service requires setup of at least one follower.

Let me know if you are still having troubles, otherwise I'll go ahead and close the issue.

Hey, got he same issue.. I´m from germany, ous is set on true and also changed the password but i still get the error Password not valid...

Just to confirm, the credentials you are using are the Dexcom user's (credentials used to login to Dexcom G6 app), rather than the Share credentials, correct?

Yep i use the users not the follow credentials..

This is the complete error-message i got:

json: {'Code': 'AccountPasswordInvalid', 'Message': 'Publisher account password failed', 'SubCode': '<OnlineException DateThrownLocal="2022-02-21T18:11:20.393" DateThrown="2022-02-21T18:11:20.393Z" ErrorCode="AccountPasswordInvalid" Type="13" Category="4" Severity="1" TypeString="InvalidPassword" CategoryString="Validation" SeverityString="Minor" HostName="" HostIP="" Id="{c9a65d96-4dd9-4493-ad01-0b2f0c245456}" Message="Publisher account password failed" FullText="com.dexcom.udp.common.data.exception.OnlineException: Publisher account password failed" />', 'TypeName': 'FaultException'}
AccountPasswordInvalid: Publisher account password failed
Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.7/site-packages/pydexcom/__init__.py", line 91, in _request
    r.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/Desktop/dex.py", line 3, in <module>
    dexcom = Dexcom("", "")
  File "/home/pi/.local/lib/python3.7/site-packages/pydexcom/__init__.py", line 69, in __init__
    self.create_session()
  File "/home/pi/.local/lib/python3.7/site-packages/pydexcom/__init__.py", line 168, in create_session
    self.account_id = self._request("post", endpoint1, json=json)
  File "/home/pi/.local/lib/python3.7/site-packages/pydexcom/__init__.py", line 104, in _request
    raise AccountError(ACCOUNT_ERROR_PASSWORD_INVALID)
pydexcom.errors.AccountError: Password not valid

Thanks for the error output. Would you mind sharing the same error output with the ous flag set to true? It looks like your error output that flag wasn't set (the url is the US endpoint -- share2 rather than shareous1).

The ous flag was set on true..?
Or is the flag in the wrong place?

from pydexcom import Dexcom
dexcom = Dexcom("", "")
ous=True
bg = dexcom.get_current_glucose_reading()
bg.value
85

It's a parameter to the function, that should get you going!

dexcom = Dexcom("", "", ous=True)

Yeah, that worked, thanks! :D
Now i got following error:

bg.value
AttributeError: 'NonType' object has no attribute 'value'

But i think this is cause my Sensor is warming up?

Yep, from the README:

dexcom.get_current_glucose_reading()

Gets latest available glucose reading, None if no glucose reading in the past 24 hours

Have fun with it!