Hide Forgot
Description of problem: When using maven client pushing source documents as project maintainer without admin role, the project failed with error messages like following: Authorization check failed for permission[HProjectIteration(super=SlugEntityBase(super=HProjectIteration@aefc4c0a[id=39,versionNum=0], slug=6.5), project=HProject(super=SlugEntityBase(super=HProject@e64bfcd4[id=21,versionNum=2], slug=rhel-installation-guide), name=RHEL Installation Guide)),import-template]] Version-Release number of selected component (if applicable): Zanata version 3.1.2-SNAPSHOT (20131021-1234) How reproducible: Always Steps to Reproduce: 1. Create a project and version on Zanata Server. 2. mvn -e zanata:push -Dzanata.url=<ZantaURL> -Dzanata.username=<USERNAME> -Dzanata.key=<APIKEY> Actual results: "Authorization check failed" shown at client error message. Expected results: Push successfully. Additional info: Server log shows nothing other than: Acount <USERNAME> authenticated Client error messages: [ERROR] Failed to execute goal org.zanata:zanata-maven-plugin:3.1.2:push (default-cli) on project standalone-pom: Zanata mojo exception: Operation failed. [ERROR] [ERROR] To retry from the last document, please set the following option(s): [ERROR] [ERROR] -Dzanata.fromDoc="Account_Configuration_common-figure-1" [ERROR] [ERROR] . Failed while pushing document: [Authorization check failed for permission[HProjectIteration(super=SlugEntityBase(super=HProjectIteration@aefc4c0a[id=39,versionNum=0], slug=6.5), project=HProject(super=SlugEntityBase(super=HProject@e64bfcd4[id=21,versionNum=2], slug=rhel-installation-guide), name=RHEL Installation Guide)),import-template]] [ERROR] -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.zanata:zanata-maven-plugin:3.1.2:push (default-cli) on project standalone-pom: Zanata mojo exception at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by: org.apache.maven.plugin.MojoExecutionException: Zanata mojo exception at org.zanata.maven.ConfigurableMojo.execute(ConfigurableMojo.java:141) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ... 19 more Caused by: java.lang.RuntimeException: Operation failed. To retry from the last document, please set the following option(s): -Dzanata.fromDoc="Account_Configuration_common-figure-1" . at org.zanata.client.commands.push.PushCommand.pushCurrentModule(PushCommand.java:459) at org.zanata.client.commands.push.PushCommand.run(PushCommand.java:207) at org.zanata.maven.ConfigurableMojo.runCommand(ConfigurableMojo.java:166) at org.zanata.maven.AbstractPushPullMojo.runCommand(AbstractPushPullMojo.java:41) at org.zanata.maven.ConfigurableMojo.execute(ConfigurableMojo.java:137) ... 21 more Caused by: java.lang.RuntimeException: Failed while pushing document: [Authorization check failed for permission[HProjectIteration(super=SlugEntityBase(super=HProjectIteration@aefc4c0a[id=39,versionNum=0], slug=6.5), project=HProject(super=SlugEntityBase(super=HProject@e64bfcd4[id=21,versionNum=2], slug=rhel-installation-guide), name=RHEL Installation Guide)),import-template]] at org.zanata.client.commands.push.PushCommand.pushSrcDocToServer(PushCommand.java:539) at org.zanata.client.commands.push.PushCommand.pushCurrentModule(PushCommand.java:422) ... 25 more
Also note that upload source documents with Web UI works, but there are large projects which consist 1000+ source documents which are not practical to upload one by one manually.
This is a problem with our Asynchronous tasks not inheriting the whole context from the caller. I will add a mechanism to copy some of that context over, but we will potentially encounter this problem in the future with other components that might be expected to be present in the context.
See: https://github.com/zanata/zanata-server/pull/240
VERIFIED with Zanata version 3.1.3-SNAPSHOT (20131022-1725) Note that this can still reproduced in 3.2-SNAPSHOT (20131022-1356).
The fix has now been merged to integration/master.
VERIFIED with Zanata version 3.2-SNAPSHOT (20131023-1236)
Closing VERIFIED bugs for Zanata versions <= 3.1.