I’m having trouble with the Google Drive API Java sample. I’ve tried to set it up twice but it’s not working as expected.
When I try to show a file’s content, I get a 404 error in the FileServlet (/svc path). The service.files().get(fileId).execute(); call seems to return null. This happens with different files and MIME types, both from Google Drive and the File Picker.
I followed the setup steps carefully. Has anyone managed to get this sample working?
Update:
I checked the log output when requesting a file. It shows a 403 error with this message:
Daily Limit Exceeded. Please sign up
I double-checked my Client ID and Secret. The API Console shows two sets: one for web apps and one for Drive SDK. I tried both, but got the same error.
Any ideas on how to fix this? I’m stuck and could use some help.
hey flyingleaf, i ran into this too. the 403 error is mostly due to hitting api limits. check ur quota in the google cloud console and ensure the api is enabled. if it persists, try a fresh project. good luck!
I’ve been down this road before, and it can be quite frustrating. The ‘Daily Limit Exceeded’ error usually crops up when you’re using the free tier of Google Cloud. While checking quotas is a good start, I found that creating a billing account and linking it to my project resolved the issue entirely. Even if you don’t intend to exceed the free limits, having a billing account seems to lift some restrictions.
Another thing to consider is the scope of your OAuth consent screen. Make sure you’ve set it up correctly and included all necessary scopes for the Drive API. Sometimes, insufficient permissions can masquerade as quota issues.
Lastly, double-check your redirect URIs in the API console. Mismatched URIs can cause authentication failures that might not be immediately apparent. If all else fails, try creating a new project from scratch – sometimes it’s quicker than troubleshooting an existing one.
I’ve encountered similar issues with the Google Drive API Java sample. In my experience, the ‘Daily Limit Exceeded’ error is more often about quota restrictions than about authentication problems. I made sure that the Drive API was enabled in the Google Cloud Console and inspected the default quotas, which can be quite low. Adjusting the quota settings or upgrading the account helped me alleviate the issue. I also added exponential backoff in my implementation to manage rate limiting. Testing credentials through the OAuth 2.0 Playground confirmed that my setup was correct. If this does not resolve the problem, consulting Google Support for more specific insights might be beneficial.