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

"Reference by name" logic hides token expiration error #424

Closed
hame-c8y opened this issue Jan 21, 2025 · 2 comments · Fixed by #425
Closed

"Reference by name" logic hides token expiration error #424

hame-c8y opened this issue Jan 21, 2025 · 2 comments · Fixed by #425

Comments

@hame-c8y
Copy link

When using reference by name, for example for devices, like this:

c8y events create --device Engine --type MyEvent --text MyEvent

and the authentication token has expired, instead of receiving an error about the authentication failure, a client-side validation error is reported:

2025-01-21T14:16:11.409+0100 ERROR commandError: Body is missing required properties: [source.id](http://source.id/)

Without using reference by by name and using the id instead:

c8y events create --type MyEvent --text MyEvent --device 1577845606

and appropriate error is reported:

2025-01-21T14:16:30.478+0100 ERROR Authentication failed (statusCode=401). Try to run set-session again, or check the password

@reubenmiller
Copy link
Owner

The problem is well understood now, there was even a TODO placeholder in the code to implement error handling in the fetcher/resolver.

// TODO: Handle error

@reubenmiller
Copy link
Owner

The fix is included in v2.48.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants