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

Runtime permissions lost after >7 days, permissions need to be regranted #198

Open
FLAGEL opened this issue Apr 18, 2023 · 12 comments
Open

Comments

@FLAGEL
Copy link

FLAGEL commented Apr 18, 2023

Steps to reproduce

  1. Follow instructions documented in "Installation and setup" (https://github.com/GioBonvi/GoogleContactsEventsNotifier/blob/master/docs/install-and-setup.md).
  2. Run the script. A pop-up box titled "Authorization required" appears. Bread text is "This project requires your permission to access your data". Press "Review permissions" and select account to use. You will face a page with the content "Google hasn’t verified this app. You’ve been given access to an app that’s currently being tested. You should only continue if you know the developer that invited you". Press "Continue" and "Allow". Script will run and produce output as intended.
  3. More than a week later (Google Scripts seems to only keep logs for 7 days), but not more than a month later, step 2 above needs to be repeated for the script to keep running. The behaviour is reoccurring and does not stop after n times.

Expected behaviour

Permissions (step 2 above) should be given once and stay until revoked. While I understand that this is likely related to Google Apps Scripts as a service and not Google Contacts Events Notifier, if this is expected behaviour, it would be wise to include a note on it in the installation documentation.

Context

  • Version of the script: 5.1.4

Lastly, I want to extend a big thank you to the author and all contributors for their efforts - this is a great little script!

@BobBruni
Copy link

Same Problem!

@plainerman
Copy link
Collaborator

I am not sure what is going on there. I was not able to reproduce this.

If anyone is willing to take a closer look, feel free!

@chpasha
Copy link

chpasha commented Apr 7, 2024

Same problem, test execution works, run notifyStart - permissions granted, trigger is created, 7 days later no notifications anymore, trigger last executed on 1.04. Running notifyStart requires to grant permissions again, which should not happen as far as I understand

@chpasha
Copy link

chpasha commented Apr 15, 2024

I have observed the execution for a week and today, exactly a week after activation, the script didn't run any more. Executing notifyStart brought me again to the consent screen where I had to grant all those permissions for the script :-(

P. S. perhaps this is the reason https://stackoverflow.com/questions/66857421/why-my-google-apps-script-permissions-are-revoked-after-few-days

Authorizations by a test user will expire seven days from the time of consent. If your OAuth client requests an offline access type and receives a refresh token, that token will also expire.

@chpasha
Copy link

chpasha commented Apr 15, 2024

I noticed, that my project status is test in google cloud platform, I've choosen "publish", let's see if it was it
image

@plainerman
Copy link
Collaborator

That is a great find. Please keep us in the loop!

@chpasha
Copy link

chpasha commented Apr 23, 2024

unfortunately, that didn't work, yesterday the script ran for the last time and today no more. I will keep googling :-(

@plainerman
Copy link
Collaborator

That is unfortunate. I was checking it on my (working) configuration and the project status is set to test.
Thank you for looking into this!

@baatochan
Copy link
Contributor

As for now I was not able to reproduce the issue. I set up the script about a year ago (after the last update I applied) and didn't have to re-grant any permission after that.

@chpasha
Copy link

chpasha commented Apr 23, 2024

try to create and assign a new project, I also had no issues for a long time until something broke and I've started to change things and finally created and assigned a new project instead of some default one

@chpasha
Copy link

chpasha commented May 6, 2024

I've managed to make it work longer than a week. There is a possiblity to "release" a script (I don't know the exact english version of this button, it is in the top right corner, where versions are managed). So I created a "version" of the script, deleted the trigger for test version and created manually one for "released" version. Since then, it is running.

@FLAGEL
Copy link
Author

FLAGEL commented Jun 27, 2024

I've managed to make it work longer than a week. There is a possiblity to "release" a script (I don't know the exact english version of this button, it is in the top right corner, where versions are managed). So I created a "version" of the script, deleted the trigger for test version and created manually one for "released" version. Since then, it is running.

Thanks for the pointer, I am trying it out now. Hopefully iy works! :-)

For anyone else reading this, the "release" mentioned by chpasha is "Deploy" in English.

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

5 participants