Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-132488 / 25.04 / Fix websocket connection crash #17

Merged
merged 2 commits into from
Dec 11, 2024
Merged

Conversation

themylogin
Copy link
Contributor

Now it works like this:

root@truenas[~]# cat freenas/freenas/2.py 
from truenas_api_client import Client
with Client() as c:
    c.call('auth.login', 'root', 'testing')
    c.call('api_key.create', {"username": "root", "expires_at": {"$date": None}, "name": "test"})

root@truenas[~]# python3 freenas/freenas/2.py
Received a global connection error: ClientException("Error parsing $date: unsupported operand type(s) for /: 'NoneType' and 'int'")
Traceback (most recent call last):
  File "/root/freenas/freenas/2.py", line 4, in <module>
    c.call('api_key.create', {"username": "root", "expires_at": {"$date": None}, "name": "test"})
  File "/usr/lib/python3/dist-packages/truenas_api_client/__init__.py", line 752, in call
    return self.wait(c, callback=callback, job=job, timeout=timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/truenas_api_client/__init__.py", line 790, in wait
    raise c.error
truenas_api_client.exc.ClientException: Error parsing $date: unsupported operand type(s) for /: 'NoneType' and 'int'

@themylogin themylogin requested a review from yocalebo December 9, 2024 11:53
@themylogin
Copy link
Contributor Author

time 4:00

@bugclerk bugclerk changed the title Fix websocket connection crash NAS-132488 / 25.04 / Fix websocket connection crash Dec 9, 2024
@bugclerk
Copy link

bugclerk commented Dec 9, 2024

@themylogin
Copy link
Contributor Author

themylogin commented Dec 9, 2024

@themylogin themylogin merged commit fcacaa2 into master Dec 11, 2024
1 check passed
@themylogin themylogin deleted the NAS-132488 branch December 11, 2024 13:46
@bugclerk
Copy link

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Dec 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants