Closed Foxite closed 4 months ago
It might also be worth mentioning that the first time I tried to use this, I got this error, but I have since fixed it. Perhaps this error prevented the api key from being saved.
Hello! I also have an error about missed API key in result of background sync. One time import works like a charm...
Google API ServerException|ClientException error : Client error: `GET https://www.googleapis.com/calendar/v3/calendars/wmd/events?maxResults=2500` resulted in a `403 Forbidden` response: { "error": { "code": 403, "message": "The request is missing a valid API key.", "errors": [ { (truncated...) status code: 403 body: { "error": { "code": 403, "message": "The request is missing a valid API key.", "errors": [ { "message": "The request is missing a valid API key.", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } }
And there are two additional errors in the Log, PHP related
Error: Undefined property: OCA\Google\Service\GoogleCalendarAPIService::$appName at /var/www/html/custom_apps/google_synchronization/lib/Service/GoogleCalendarAPIService.php#207 Error: Undefined array key "nbAdded" at /var/www/html/custom_apps/google_synchronization/lib/BackgroundJob/ImportCalendarJob.php#28
I use AIO docker image, default configuration. First, I'd enabled "Google Integration" app and made an initial import and then I've disabled it and enabled "Google Syncronization" app, reconfigured OAuth2 in Google API config (redirect URI).
What should I fix to get background sync work correctly?
I am having the same issues, with the same error messages
Error: Undefined property: OCA\Google\Service\GoogleCalendarAPIService::$appName at /var/www/html/custom_apps/google_synchronization/lib/Service/GoogleCalendarAPIService.php#207
This one could be solved just by commenting out the line 207 in the GoogleCalendarAPIService.php file, couse it's just a debug message.
Error: Undefined array key "nbAdded" at /var/www/html/custom_apps/google_synchronization/lib/BackgroundJob/ImportCalendarJob.php#28
This one also could be solved just by commenting out the line 28 in the ImportCalendarJob.php file, couse it's echoing the informational message.
The main problem (a lack of accessToken) could be connected to this error message
Error: Undefined property: OCA\Google\Service\GoogleCalendarAPIService::$appName at /var/www/html/custom_apps/google_synchronization/lib/Service/GoogleCalendarAPIService.php#207
By the documentation, $this->appName
is used to set/get accessToken to/from User config values:
https://docs.nextcloud.com/server/latest/developer_manual/basics/storage/configuration.html#user-values
But in the ConfigController.php file "Application::APP_ID" is used instead of appName...
$this->config->setUserValue($this->userId, Application::APP_ID, 'token', $accessToken);
Oh mighty Creator, come and save us! :)
Hello, I am having the exact same error. I tried some of the solutions in this post, but what I have tried does not seem to work. I will continue trying the solutions given there and update if something happens!
Hi! I've updated my NextCloud to 25.0.6, now I have this errors in logs:
Google OAuth error : Client error:
POST https://oauth2.googleapis.com/token
resulted in a400 Bad Request
response: { "error": "invalid_grant", "error_description": "Bad Request" }Google API error, impossible to refresh the token. Response: {"error":"Client error:
POST https:\/\/oauth2.googleapis.com\/token
resulted in a400 Bad Request
response:\n{\n \"error\": \"invalid_grant\",\n \"error_description\": \"Bad Request\"\n}\n"}Google API ServerException|ClientException error : Client error:
GET https://www.googleapis.com/oauth2/v1/userinfo?alt=json
resulted in a401 Unauthorized
response: { "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 (truncated...) status code: 401 body: { "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "status": "UNAUTHENTICATED" } }
Could you please try the latest release and let me know if you are still experiencing this issue.
Hello! I've updated to the latest release (manually, there is no update through Apps menu in NC). Going to monitor how it works now.
But I have these lines in Logging:
Error | PHP | Undefined property: OCA\Google\Service\GoogleCalendarAPIService::$appName at /var/www/html/custom_apps/google_synchronization/lib/Service/GoogleCalendarAPIService.php#177 Error | PHP | Undefined property: OCA\Google\Service\GoogleCalendarAPIService::$appName at /var/www/html/custom_apps/google_synchronization/lib/Service/GoogleCalendarAPIService.php#191
Warning | google_synchronization | Error when creating calendar event "
@dmitry-entin really? It should be in the app store: https://apps.nextcloud.com/apps/google_synchronization
This looks like #15. Could you please update to 2.1.0-2-nightly and see if it goes away?
Hm, I tried to update via NextCloud admin interface (Apps list) and it didn't show new version :( Nightly version should be installed manually? I'll try but later this week...
I will close this now for inactivity. Please feel free to reopen it if it's still a problem.
Also, I solved the problem with new versions not showing up in the NC UI.
After clicking "sync calendars", these errors are logged every 5 minutes:
Notably, these errors continue to occur after I've disconnected my google account.
Also notably, the third error indicates that a request was made to google that included my nextcloud user ID - this is a unique string that google has no business knowing, so it's probably an error that this gets sent.
Probably also of note is that I did not add the google drive, people and photo's APIs to the app in the google console, because I only want to sync calendar data and I don't think it needs those APIs for that. I also did not authorize these scopes when connecting my account.
Finally, this error only seems to occur on the background job schedule, and it doesn't happen when I manually click the import calendar button - in fact, that works properly (except that events regarding office hours don't show up, which I will make a feature request for).