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

[BUG] Mautic seemingly randomly lets the access token expire #6176

Closed
Clausinho opened this issue Apr 27, 2023 · 14 comments
Closed

[BUG] Mautic seemingly randomly lets the access token expire #6176

Clausinho opened this issue Apr 27, 2023 · 14 comments
Labels
bug Something isn't working tracked internally Issue is also tracked in our internal issue tracker triaged For maintainers: This issue has been triaged by a Pipedream employee

Comments

@Clausinho
Copy link

Describe the bug
Mautic seemingly randomly lets the access token expire
If I try to reconnect with the same details, I just have to sign in again and it works.
I suspect either Mautic messing something up or Pipedream failing to refresh the token and it then expiring.

To Reproduce
Steps to reproduce the behavior:

  1. Setup mautic account and some workflows
  2. wait 16 days
  3. find that all the workflows throw Message: {"errors":[{"message":"The access token provided has expired.","code":401,"type":"invalid_grant"}]}
  4. see that the account has turned red
  5. reconnect with the same credentials, login to mautic and it works

Expected behavior
Mautic does not lose connection, and does not need an oauth reauth

Additional context
Please feel free to ask me more details and show me ways to give more logs.
An example workflow would be https://pipedream.com/@fotodino/token-customer-creation-flow-for-cp-board-v2-5-p_WxCmAWY/inspect
(I think its private anyway, so unless you are the support or have rights, you can't do anything with the URL)

@Clausinho Clausinho added the bug Something isn't working label Apr 27, 2023
@dannyroosevelt dannyroosevelt added the tracked internally Issue is also tracked in our internal issue tracker label Apr 27, 2023
@dylburger dylburger added the triaged For maintainers: This issue has been triaged by a Pipedream employee label Apr 27, 2023
@malexanderlim
Copy link
Collaborator

Hi @Clausinho , what are the access token/refresh token lifetime configured to on your end?

@Clausinho
Copy link
Author

Clausinho commented Apr 27, 2023 via email

@malexanderlim
Copy link
Collaborator

Thanks for sharing, looking into this.

@Clausinho
Copy link
Author

Happened today again. It is impacting our business as this binds ressources refreshing the token manually.
I am paying for the developer plan, I'd like an insight on how this is going.

@malexanderlim
Copy link
Collaborator

Hi @Clausinho , can you enable sharing for the workflow that you shared above? Under Settings -->
Screenshot 2023-05-23 at 11 11 08 AM

@malexanderlim
Copy link
Collaborator

Hi @Clausinho , checking in here to see if you can enable sharing for the workflow so that we can troubleshoot further.

@Clausinho
Copy link
Author

Hi @Clausinho , checking in here to see if you can enable sharing for the workflow so that we can troubleshoot further.

@malexanderlim
https://pipedream.com/@fotodino/client-booking-email-hook-v2-0-1-p_vQCMDnN/settings
done

@Clausinho
Copy link
Author

Hi @Clausinho , checking in here to see if you can enable sharing for the workflow so that we can troubleshoot further.

hey @malexanderlim sorry for the late reply.

any info you could get?
it hasn't happened so far.

@malexanderlim
Copy link
Collaborator

Hi @Clausinho , I looked into your workflow as well as the app configuration and I was not able to see anything out of the ordinary, setup wise.

Looking into the behavior - seems that there is sometimes a 400 error when attempting to fetch the refresh token, and it looks like this is is likely the culprit here, but I'm not sure why we are receiving these 400s to begin with. If you'd like, I can open up an issue with the Mautic team.

@Clausinho
Copy link
Author

Hi @Clausinho , I looked into your workflow as well as the app configuration and I was not able to see anything out of the ordinary, setup wise.

Looking into the behavior - seems that there is sometimes a 400 error when attempting to fetch the refresh token, and it looks like this is is likely the culprit here, but I'm not sure why we are receiving these 400s to begin with. If you'd like, I can open up an issue with the Mautic team.

Yea I'd really like that.
They seemed a bit unresponsive towards me and maybe you guys have more weight and to be fair more logs.

@malexanderlim
Copy link
Collaborator

@Clausinho , I've opened a ticket with the Mautic team here:
mautic/api-library#305

It does not appear to be very active, but I'm hoping we can get some answers from their team as to the best way to handle this type of error.

@Clausinho
Copy link
Author

@Clausinho , I've opened a ticket with the Mautic team here:
mautic/api-library#305

It does not appear to be very active, but I'm hoping we can get some answers from their team as to the best way to handle this type of error.

@malexanderlim it happened again today.
Couldn't the auth just be retried periodically as a fix from pipedream?

My only other option is to do the auth myself, is there a way I could set the tokens of the connected source myself?

@dylburger
Copy link
Contributor

dylburger commented Jul 12, 2023

@Clausinho Thanks for the patience. We actually implement complex retry logic for different scenarios and normally would, but a 400 Bad Request should not be retried — that indicates a malformed request by the client. I understand in this situation, it's not ideal answer, but Mautic needs to fix this on their end.

Some of our customers run a Pizzly instance to handle token refresh in a custom way. You should be able to connect Pizzly to your Mautic instance to see if that gives you more control, then use our Pizzly integration to fetch access tokens for specific users within a workflow. You can also implement custom token refresh logic on Pipedream or your own service, persisting them in some data store / database that you have access to, then fetch them in relevant workflows and authorize requests with those tokens.

We also don't see this with all customers using Mautic — are you on the latest version of Mautic?

@Clausinho
Copy link
Author

hey @dylburger thanks for taking your time to formulate a very thorough response.
I can write a token refresh by myself I think- It should be no problem.
But as an easy and unsecure? fix I just extended the refresh tokens lifetime to 1 universe time. That should be enough time for our business.
I am not thinking mautic is gonna fix this, so I'll close this issue. Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked internally Issue is also tracked in our internal issue tracker triaged For maintainers: This issue has been triaged by a Pipedream employee
Projects
None yet
Development

No branches or pull requests

4 participants