Bug 1021357 - Non-admin project maintainer failed to push source documents with maven client
Summary: Non-admin project maintainer failed to push source documents with maven client
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Zanata
Classification: Retired
Component: Authentication-Fedora
Version: 3.1
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 3.1
Assignee: Carlos Munoz
QA Contact: Zanata-QA Mailling List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-21 07:13 UTC by Ding-Yi Chen
Modified: 2013-11-27 03:35 UTC (History)
4 users (show)

Fixed In Version: 3.1.3-SNAPSHOT (20131022-1725)
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-27 03:24:52 UTC


Attachments (Terms of Use)

Description Ding-Yi Chen 2013-10-21 07:13:53 UTC
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

Comment 1 Ding-Yi Chen 2013-10-21 07:16:29 UTC
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.

Comment 2 Carlos Munoz 2013-10-22 03:39:55 UTC
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.

Comment 3 Carlos Munoz 2013-10-22 03:49:17 UTC
See:
https://github.com/zanata/zanata-server/pull/240

Comment 4 Ding-Yi Chen 2013-10-22 08:08:16 UTC
VERIFIED with Zanata version 3.1.3-SNAPSHOT (20131022-1725)

Note that this can still reproduced in 3.2-SNAPSHOT (20131022-1356).

Comment 7 Sean Flanigan 2013-10-23 01:37:33 UTC
The fix has now been merged to integration/master.

Comment 8 Ding-Yi Chen 2013-10-23 07:43:42 UTC
VERIFIED with Zanata version 3.2-SNAPSHOT (20131023-1236)

Comment 9 Sean Flanigan 2013-11-27 03:15:29 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 10 Sean Flanigan 2013-11-27 03:16:48 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 11 Sean Flanigan 2013-11-27 03:18:47 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 12 Sean Flanigan 2013-11-27 03:24:52 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 13 Sean Flanigan 2013-11-27 03:33:27 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 14 Sean Flanigan 2013-11-27 03:35:43 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.


Note You need to log in before you can comment on or make changes to this bug.