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

Expired token #182

Closed
Grigsuv opened this issue Apr 9, 2018 · 9 comments
Closed

Expired token #182

Grigsuv opened this issue Apr 9, 2018 · 9 comments

Comments

@Grigsuv
Copy link

Grigsuv commented Apr 9, 2018

Hi there,i am trying to create app witch will work for queue with sessionId,i've tried this one
Connection string looks like "Endpoint=:sb//ggqueue.servicebus.windows.net/:SharedAccessKeyName=;SharedAccessKey="
I've tried with Microsoft.Azure.ServiceBus v1 and v2,both times got error
"Unhandled Exception: System.UnauthorizedAccessException: Put token failed. status-code: 401, status-description: ExpiredToken: ."
How can i fix this error ?Is there any other way working with session enabled queues(python,python-proton,java,.net)?

@nemakam
Copy link
Contributor

nemakam commented Apr 9, 2018

@Grigsuv
The error is self explanatory. Its unauthorizedAccessException. Something is wrong with the connection string. Where did you obtain your connection string from?
You could log into your azure portal and get the connection string by navigating to your
Home > ggqueue > Shared access policies > RootManageSharedAccessKey > Primary Connection String.

@Grigsuv
Copy link
Author

Grigsuv commented Apr 9, 2018

@nemakam Erorr is fixed,someway,idk how.Can you tell me real deference between session-on queue and partitioning-on session-off queue?If sessionid is the same partition key then why session gives us fifo guaranteed queue but second type don't?Is there any way to get fifo guaranteed I/O queue using nodejs(REST api has no support of getting messages with sessionid)?

@nemakam
Copy link
Contributor

nemakam commented Apr 9, 2018

Can you tell me real deference between session-on queue and partitioning-on session-off queue?If sessionid is the same partition key then why session gives us fifo guaranteed queue but second type don't?

Sessions is the only way FIFO can be guaranteed. Even if you provide partitionKey in a partitioned queue, multiple partitionKeys can end up landing into the same partition. So the messages across different partitionKeys would be mixed with each other. In the case of Sessions, we also maintain the messages in another data structure which ensures the messages are delivered in the same order as received.
I hope that answers the question.

Is there any way to get fifo guaranteed I/O queue using nodejs(REST api has no support of getting messages with sessionid)?

Need to check if the nodejs client working with AMQP protocol is released on not. AFAIK, its not. But yes, with REST api there is no way to get messages with sessionID.

@nemakam nemakam closed this as completed Apr 9, 2018
@Grigsuv
Copy link
Author

Grigsuv commented Apr 12, 2018

the same error

@crgarcia12
Copy link

crgarcia12 commented Feb 2, 2020

I'm having the same error. The connection string i got it from the "Shared access policies" in the portal
[Edit] I had to restart the docker host and it started working (kedacore/sample-dotnet-worker-servicebus-queue#8)

@brunochaina
Copy link

Samer error. Restarting docker host wasn't enough, I had to restart my pc and it started working again.

@denysdenysenko
Copy link

Same issue. Getting ExpiredToken: The token is expired. Expiration time:... for the connection string that's just copied from the portal. The app is on the client's VM so can't be restarted easily.

@brunochaina
Copy link

@denysdenysenko , I managed to solve it without restarting. Look at my answer in stackoverflow:

https://stackoverflow.com/questions/43347605/event-hub-error-put-token-failed-status-code-401-status-description-expired/65534986#65534986

@izogi
Copy link

izogi commented Jan 23, 2023

Just for anyone else who continues to stumble on this thread, I saw this after un-pausing a client VM after a weekend.

It turned out the client VM hadn't updated its clock. It still believed it was Friday evening instead of Monday morning.

Once I'd addressed that, by setting it to the correct time, the ExpiredToken issue went away.

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

No branches or pull requests

6 participants