-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
AccessControlException (java.io.FilePermission) when trying to access Cloud Storage #1731
Comments
First off, what environment are you developing for? GAE Std, Flex, GKE, GCP, something else? Take a look at the results of Are you using Maven, Gradle, or something else? If Maven, which plugin are you using? |
@lesv Java App Engine Standard Environment. I am trying to develop and test out the application locally. Output of
Using Maven. There are quite a few plugins listed in my |
If you are using the old Maven Plugin, you'll be having the problem that they were discussing in #1500 - we can't access the file system, so none of the access mechanisms work. You might wish to try to the new plugin, but beware, it's BETA, and has trouble doing async IO requests - this should be fixed early next Q. Some of the older client libraries (not from this REPO) continue to work with App Engine. (This is probably a better solution than using the new plugin for now). Apologies for the confusion -- I'll look into why we have samples that don't work locally. |
@lesv I assume this conversation I had earlier is relevant: GoogleCloudPlatform/app-maven-plugin#151 The
I assume this is the "new" plugin. This issue persists. |
Also, note that their seems to be a issue when using the following method:
throws an NPE:
I can read the file normally using GSON, so the file definitely exists. The issue seems to be internal. |
@Orbyt Can you provide me the full stacktrace of the |
Code: public class DemoServlet extends HttpServlet {
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
Storage storage = StorageOptions.getDefaultInstance().getService();
}
} Stacktrace:
|
Thanks, this looks the same issue as #1500. The cause of this issue is:
where The failure is caused by the reflection method here where the GAE API classes are not loaded in the classpath. To confirm, can you try to package your application via maven: |
@shinfan Is this why using
Also fails, except with an NPE, as shown above? I executed
Inside |
The NPE issue of @lesv Is it okay to ask the customer to send a copy of their sample application so I can try to reproduce the issue here? I could not repro with my own app (my own app works fine after adding the appengine sdk dependency) |
@shinfan @lesv I would have no issue posting a repo to github as the project is empty and only contains a single @shinfan You mentioned you are no longer able to reproduce this issue. Are you saying your are able to call |
Yes, my sample application was able to call |
@shinfan Give me a few minutes and I will upload a repository. |
@shinfan I've uploaded a private repository and sent you a collaboration invite. If others need or would like an invite for any reason, please let me know. |
@shinfan Additionally, perhaps uploading your sample application would help me debug. |
Well, automatic authentication seems to suddenly work and an I am not sure why it has suddenly started working. Yesterday I was curious to see if I would have the same issues listed above with the Node.js implementation of App Engine. I cloned the getting started example, and added the Later that evening, I switched back to my Java App Engine project, and it began working as expected. Perhaps someone here has an idea of why this process fixed this issue. |
I'm also having a similar problem, I get the below error. I have also tried using a service key and setting the environment variable to point to the key with no luck.
|
@jabubake This issue should be fixed by adding the correct dependency into your application pom: |
@shinfan That dependency is included. |
I'm still experiencing this issue, is there any update on this? |
Have you tried updating to 0.10.0-beta ?? (Not sure it will help, but at least that will eliminate that case) (I'm going to reread the notes.) |
@Orbyt Apologies - I looked at some sample code and saw that it included the client library so I thought it was actually using the API. But I looked at the code and it's actually using older blobstore API's. In looking at our documentation, the recommendation (r/w to gcs) is to use the GCS for GAE client. @jerjou Please update the GAE Bookshelf to use these API's. |
|
@jakeam , are you still having trouble with this? |
No response, so I'm going to close this out. Feel free to re-open if there are still issues. |
@lesv
Continuing from the conversation here.
I have tried every method suggested here but routinely get a
java.security.AccessControlException
which differs depending on which authentication used.If I don't use
.setCredentials
(and therefore it trys to authenticate automatically or useGOOGLE_APPLICATION_CREDENTIALS
env variable) I get anAccessControlException
for a file calledactive_config
. If I instead do call.setCredentials
and use a file downloaded by creating a service account key (as specified in option 1 here: https://developers.google.com/identity/protocols/application-default-credentials) then I get the same exception but for that specific file.@lesv you made this comment in the other issue:
I assume you are referring to the same method I linked to above, correct? If so, as stated, i've tried that.
The text was updated successfully, but these errors were encountered: