Google Drive API Error “WARNING: unable to change permissions for owner/everbody”


I've been trying to allow a program I am writing to access Google Drive Applications. I have gotten the client secrets information successfully, and have copy and pasted the example code and tried using it to successfully authenticate my program and use the google drive API.

However, when it gets to the line

Credential credential = new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user");

I get this error. This error has been posted about before, and I've tried essentially every solution. I've elevated both my program and all the java.exe files to administrator and tried running the program and I still got this error.

The full error is:

Oct 03, 2015 11:48:39 AM com.google.api.client.util.store.FileDataStoreFactory setPermissionsToOwnerOnly WARNING: unable to change permissions for everybody: D:\directory Oct 03, 2015 11:48:39 AM com.google.api.client.util.store.FileDataStoreFactory setPermissionsToOwnerOnly WARNING: unable to change permissions for owner: D:\directory

I've also tried overriding the setPermissionToOwnerOnly when I instantiated the FileDataStoreFactory but that failed as well.

I have tried the following solutions:

http://stackoverflow.com/questions/30634827/warning-unable-to-change-permissions-for-everybody http://stackoverflow.com/questions/24382069/error-while-executing-google-prediction-api-command-line-sample https://groups.google.com/forum/#!topic/google-analytics-data-export-api/-7BH7Z40gkw (where the client secret data was hard coded into the program, this is bad, I know, but it didn't work anyway)

I don't know what to do at this point. I am running my program off a flash drive, and I tried running it off my computer as well, but it still failed. I am using NetBeans 8.0.2.

The error comes up as a warning, so maybe there is some way to just ignore the warning and proceed? That could be a solution, but I've researched and I'm not sure if that's a possibility. I am running windows 10 if that matters.


I just ran the Drive REST API example <a href="https://developers.google.com/drive/web/quickstart/java" rel="nofollow">Java Quickstart tutorial</a> through Eclipse and is working fine. It does requires a bit of setup time if you have not install <a href="http://gradle.org/gradle-download/" rel="nofollow">Gradle</a> (also Eclipse Marketplace has a plugin for Gradle).

To your point, I did get the same warning messages. However, it happened for me during the load client secret in the <em>authorize()</em> method.

public static Credential authorize() throws IOException { // Load client secrets. InputStream in = DriveQuickstart.class.getResourceAsStream("/client_secret.json"); GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));

I suspect this is where your issue is happening. Since, I am not able to see that part from your code snippet, have a look at where your <em>client_secret.json</em> file is located.

Hope this helps. Good luck!


  • Compiling z3 ocaml binding in linux
  • Cygwin Openssh can't see /etc/sshd_config
  • Disable OPTIONS Method Jetty Server
  • How can I use functools.partial on multiple methods on an object, and freeze parameters out of order
  • Check multiple file exists or not using ANT
  • ant copy copying order
  • Found com.google.android.gms:play-services-places:9.2.1, but version 9.0.2 is needed for the google-
  • OAuth2 flow for mobile app
  • Grails eager fetch doesn't retrieve all data
  • NetBeans doesn't see style.css [duplicate]
  • Can't access Facebook campaigns
  • How to upload files in php using html
  • How to extract a number from a string [duplicate]
  • Google Calendar Api is not showing event list
  • How to get a list with description of all dba packages
  • integrate POCO library in android ndk
  • Granting permissions to Azure Active Directory Web Application automatically
  • Changing Jupyter Notebook start up folder by modifying “start in” not working any more
  • opencv display image without x server
  • URLConnection doesn't work since API 10 and higher?
  • List images(01.png) and descriptions(01.txt) from directory
  • Copy to all folders batch file?
  • How solve “Qt: Untested Windows version 10.0 detected!”
  • Unable to install Git-core+svn by MacPorts
  • Unable to decode certificate at client new X509Certificate2()
  • C: Incompatible pointer type initializing
  • chrome.tabs.executeScript only fires when the Developer Console is open
  • How to test if a URL from an Eclipse bundle is a directory?
  • The plugin 'org.apache.maven.plugins:maven-jboss-as-plugin' does not exist or no valid ver
  • Launch Runnable Jar from Web Start
  • WinForms: two way TextBox problem
  • Function pointer “assignment from incompatible pointer type” only when using vararg ellipsis
  • Calling of Constructors in a Java
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • Traverse Array and Display in markup
  • Transpose CSV data with awk (pivot transformation)
  • Why can't I rebase on to an ancestor of source changesets if on a different branch?
  • Easiest way to encapsulate a HTML5 webpage into an android app?