You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (JIRA)" <ji...@codehaus.org> on 2012/06/15 17:44:21 UTC
[jira] (MRELEASE-774) CLONE - mvn release:prepare fails with
IOException and a write error (Access is denied)
Robert Scholte created MRELEASE-774:
---------------------------------------
Summary: CLONE - mvn release:prepare fails with IOException and a write error (Access is denied)
Key: MRELEASE-774
URL: https://jira.codehaus.org/browse/MRELEASE-774
Project: Maven 2.x Release Plugin
Issue Type: Bug
Components: prepare
Affects Versions: 2.3.1
Environment: Windows 7 both command prompt and cygwin using Perforce for SCM
Reporter: Robert Scholte
Attachments: maven-release-error.txt, mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
When running
{{mvn release:prepare -Dusername=<perforce_user> -Dpassword=<perforce_password>}}
I get the errors:
* java.io.IOException: The filename, directory name, or volume label syntax is incorrect
* [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c changelist#] [ -d -f -k -n -v ] [-t type] files...
Missing/wrong number of arguments.
* [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) -> [Help 1]
The full output is attached.
Sometimes I also get the error:
* [ERROR] D:\Server\pom.xml - file(s) not in client view.
Though I created the client in the same location I'm running from, and I'm not sure that error is related to the others (as the others also occur when that one doesn't).
It's been suggested (on stackoverflow: http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) that the error has to do with my D drive being a mapped drive, though I don't think it is as it's not listed if I run {{subst}}. However, I think it _must_ be at least a partition on the same hard drive, unless my PC has three physical drives :P (work PC), but I guess that shouldn't make any difference to the program?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (SCM-678) CLONE - mvn release:prepare fails with IOException
and a write error (Access is denied)
Posted by "Svend Hansen (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SCM-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=301337#comment-301337 ]
Svend Hansen edited comment on SCM-678 at 6/18/12 5:44 AM:
-----------------------------------------------------------
(I'm the one who created this but on this bug on the maven release plugin project)
I've downloaded the code and added a line that printed out the files it's looking at on line 109 (where the exception is thrown) here:
http://maven.apache.org/scm/maven-scm-providers/maven-scm-provider-perforce/xref/org/apache/maven/scm/provider/perforce/command/edit/PerforceEditCommand.html
With the line: {{String canfile = file.getCanonicalPath();}}
and the first file looks like {{D:\Server\D:\Server\pom.xml}} which obviously breaks. Further debug before the line:
{{File file = new File( workingDirectory, fs.get( i ).getPath() );}}
shows that the file path of the fs.get(i) file is absolute. I first tried removing the workingDirectory, as it seemed that it wasn't needed here, but that broke a test, so instead I've changed it to:
{{File file = null;}}
{{if(fs.get( i ).isAbsolute()) file = new File( fs.get( i ).getPath() );}}
{{else file = new File( workingDirectory, fs.get( i ).getPath() );}}
And now it seems to work (I'm getting a different error much later in the process, but it is now managing the update the pom's versions.
was (Author: svendhhh):
(I'm the one who created this but on this bug on the maven release plugin project)
I've downloaded the code and added a line that printed out the files it's looking at on line 109 (where the exception is thrown) here:
http://maven.apache.org/scm/maven-scm-providers/maven-scm-provider-perforce/xref/org/apache/maven/scm/provider/perforce/command/edit/PerforceEditCommand.html
With the line: {{String canfile = file.getCanonicalPath();}}
and the first file looks like {{D:\Server\D:\Server\pom.xml}} which obviously breaks. Further debug before the line:
{{File file = new File( workingDirectory, fs.get( i ).getPath() );}}
shows that the file path of the fs.get(i) file is absolute. I first tried removing the workingDirectory, as it seemed that it wasn't needed here, but that broke a test, so instead I've changed it to:
{{File file = null;
if(fs.get( i ).isAbsolute()) file = new File( fs.get( i ).getPath() );
else file = new File( workingDirectory, fs.get( i ).getPath() );}}
And now it seems to work (I'm getting a different error much later in the process, but it is now managing the update the pom's versions.
> CLONE - mvn release:prepare fails with IOException and a write error (Access is denied)
> ---------------------------------------------------------------------------------------
>
> Key: SCM-678
> URL: https://jira.codehaus.org/browse/SCM-678
> Project: Maven SCM
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Affects Versions: 1.7
> Environment: Windows 7 both command prompt and cygwin using Perforce for SCM
> Reporter: Robert Scholte
> Attachments: maven-release-error.txt, mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
>
>
> When running
> {{mvn release:prepare -Dusername=<perforce_user> -Dpassword=<perforce_password>}}
> I get the errors:
> * java.io.IOException: The filename, directory name, or volume label syntax is incorrect
> * [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c changelist#] [ -d -f -k -n -v ] [-t type] files...
> Missing/wrong number of arguments.
> * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) -> [Help 1]
> The full output is attached.
> Sometimes I also get the error:
> * [ERROR] D:\Server\pom.xml - file(s) not in client view.
> Though I created the client in the same location I'm running from, and I'm not sure that error is related to the others (as the others also occur when that one doesn't).
> It's been suggested (on stackoverflow: http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) that the error has to do with my D drive being a mapped drive, though I don't think it is as it's not listed if I run {{subst}}. However, I think it _must_ be at least a partition on the same hard drive, unless my PC has three physical drives :P (work PC), but I guess that shouldn't make any difference to the program?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (SCM-678) scm perforce: mvn release:prepare fails with
IOException and a write error (Access is denied)
Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SCM-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Olivier Lamy closed SCM-678.
----------------------------
Resolution: Fixed
Fix Version/s: 1.8
applied.
Thanks!
> scm perforce: mvn release:prepare fails with IOException and a write error (Access is denied)
> ---------------------------------------------------------------------------------------------
>
> Key: SCM-678
> URL: https://jira.codehaus.org/browse/SCM-678
> Project: Maven SCM
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Affects Versions: 1.7
> Environment: Windows 7 both command prompt and cygwin using Perforce for SCM
> Reporter: Robert Scholte
> Assignee: Olivier Lamy
> Fix For: 1.8
>
> Attachments: maven-release-error.txt, MNG-678-perforce.patch, mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
>
>
> When running
> {{mvn release:prepare -Dusername=<perforce_user> -Dpassword=<perforce_password>}}
> I get the errors:
> * java.io.IOException: The filename, directory name, or volume label syntax is incorrect
> * [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c changelist#] [ -d -f -k -n -v ] [-t type] files...
> Missing/wrong number of arguments.
> * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) -> [Help 1]
> The full output is attached.
> Sometimes I also get the error:
> * [ERROR] D:\Server\pom.xml - file(s) not in client view.
> Though I created the client in the same location I'm running from, and I'm not sure that error is related to the others (as the others also occur when that one doesn't).
> It's been suggested (on stackoverflow: http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) that the error has to do with my D drive being a mapped drive, though I don't think it is as it's not listed if I run {{subst}}. However, I think it _must_ be at least a partition on the same hard drive, unless my PC has three physical drives :P (work PC), but I guess that shouldn't make any difference to the program?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (SCM-678) CLONE - mvn release:prepare fails with IOException
and a write error (Access is denied)
Posted by "Svend Hansen (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SCM-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Svend Hansen updated SCM-678:
-----------------------------
Attachment: MNG-678-perforce.patch
I've attached a patch.
So, the fix is checking whether each file has an absolute path already, before prepending the working directory.
I've changed the existing unit tests, to remove some of the hard coding, and added an extra test method to test the absolute path situation for both the edit and the checkin classes.
Also, it turns out that it only breaks is the working directory exists, so I'm calling {{new File(".").getAbsoluteFile()}} to make sure it an existing directory, and to get files in there I do {{new File("foo.xml").getAbsoluteFile()}}.
This is because if you have a directory {{c:\foo}} but not a directory {{c:\bar}}, then {{new File("c:\foo\c:\foo\abc.xml}} throws an IOException, while {{new File("c:\bar\c:\bar.abc.xml}} does NOT.
> CLONE - mvn release:prepare fails with IOException and a write error (Access is denied)
> ---------------------------------------------------------------------------------------
>
> Key: SCM-678
> URL: https://jira.codehaus.org/browse/SCM-678
> Project: Maven SCM
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Affects Versions: 1.7
> Environment: Windows 7 both command prompt and cygwin using Perforce for SCM
> Reporter: Robert Scholte
> Attachments: maven-release-error.txt, MNG-678-perforce.patch, mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
>
>
> When running
> {{mvn release:prepare -Dusername=<perforce_user> -Dpassword=<perforce_password>}}
> I get the errors:
> * java.io.IOException: The filename, directory name, or volume label syntax is incorrect
> * [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c changelist#] [ -d -f -k -n -v ] [-t type] files...
> Missing/wrong number of arguments.
> * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) -> [Help 1]
> The full output is attached.
> Sometimes I also get the error:
> * [ERROR] D:\Server\pom.xml - file(s) not in client view.
> Though I created the client in the same location I'm running from, and I'm not sure that error is related to the others (as the others also occur when that one doesn't).
> It's been suggested (on stackoverflow: http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) that the error has to do with my D drive being a mapped drive, though I don't think it is as it's not listed if I run {{subst}}. However, I think it _must_ be at least a partition on the same hard drive, unless my PC has three physical drives :P (work PC), but I guess that shouldn't make any difference to the program?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (SCM-678) CLONE - mvn release:prepare fails with IOException
and a write error (Access is denied)
Posted by "Svend Hansen (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SCM-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=301425#comment-301425 ]
Svend Hansen commented on SCM-678:
----------------------------------
I've just noticed what the lines after the canonical path do. They seem to strip out the beginning of the path of the file if the file starts with the working directory. This explains why it would have been working on Linux. If the path was {{/home/user/project/home/user/project/pom.xml}} the canonical path call would probably still have worked (though the file wouldn't exist), and after stripping out the working directory it would have been back to just {{/home/user/project/pom.xml}}.
If that's a correct understanding of the problem, I'm just not sure if it wouldn't just be better to add my change and remove the removing of the working directory (unless it's supposed to strip it down to just {{pom.xml}}?
> CLONE - mvn release:prepare fails with IOException and a write error (Access is denied)
> ---------------------------------------------------------------------------------------
>
> Key: SCM-678
> URL: https://jira.codehaus.org/browse/SCM-678
> Project: Maven SCM
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Affects Versions: 1.7
> Environment: Windows 7 both command prompt and cygwin using Perforce for SCM
> Reporter: Robert Scholte
> Attachments: maven-release-error.txt, mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
>
>
> When running
> {{mvn release:prepare -Dusername=<perforce_user> -Dpassword=<perforce_password>}}
> I get the errors:
> * java.io.IOException: The filename, directory name, or volume label syntax is incorrect
> * [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c changelist#] [ -d -f -k -n -v ] [-t type] files...
> Missing/wrong number of arguments.
> * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) -> [Help 1]
> The full output is attached.
> Sometimes I also get the error:
> * [ERROR] D:\Server\pom.xml - file(s) not in client view.
> Though I created the client in the same location I'm running from, and I'm not sure that error is related to the others (as the others also occur when that one doesn't).
> It's been suggested (on stackoverflow: http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) that the error has to do with my D drive being a mapped drive, though I don't think it is as it's not listed if I run {{subst}}. However, I think it _must_ be at least a partition on the same hard drive, unless my PC has three physical drives :P (work PC), but I guess that shouldn't make any difference to the program?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (SCM-678) scm perforce: mvn release:prepare fails with
IOException and a write error (Access is denied)
Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SCM-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Olivier Lamy updated SCM-678:
-----------------------------
Summary: scm perforce: mvn release:prepare fails with IOException and a write error (Access is denied) (was: CLONE - mvn release:prepare fails with IOException and a write error (Access is denied))
> scm perforce: mvn release:prepare fails with IOException and a write error (Access is denied)
> ---------------------------------------------------------------------------------------------
>
> Key: SCM-678
> URL: https://jira.codehaus.org/browse/SCM-678
> Project: Maven SCM
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Affects Versions: 1.7
> Environment: Windows 7 both command prompt and cygwin using Perforce for SCM
> Reporter: Robert Scholte
> Assignee: Olivier Lamy
> Attachments: maven-release-error.txt, MNG-678-perforce.patch, mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
>
>
> When running
> {{mvn release:prepare -Dusername=<perforce_user> -Dpassword=<perforce_password>}}
> I get the errors:
> * java.io.IOException: The filename, directory name, or volume label syntax is incorrect
> * [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c changelist#] [ -d -f -k -n -v ] [-t type] files...
> Missing/wrong number of arguments.
> * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) -> [Help 1]
> The full output is attached.
> Sometimes I also get the error:
> * [ERROR] D:\Server\pom.xml - file(s) not in client view.
> Though I created the client in the same location I'm running from, and I'm not sure that error is related to the others (as the others also occur when that one doesn't).
> It's been suggested (on stackoverflow: http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) that the error has to do with my D drive being a mapped drive, though I don't think it is as it's not listed if I run {{subst}}. However, I think it _must_ be at least a partition on the same hard drive, unless my PC has three physical drives :P (work PC), but I guess that shouldn't make any difference to the program?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (SCM-678) CLONE - mvn release:prepare fails with IOException
and a write error (Access is denied)
Posted by "Robert Scholte (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SCM-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=301374#comment-301374 ]
Robert Scholte commented on SCM-678:
------------------------------------
If I have a look at [PerforceRemoveCommand|http://maven.apache.org/scm/maven-scm-providers/maven-scm-provider-perforce/xref/org/apache/maven/scm/provider/perforce/command/remove/PerforceRemoveCommand.html] and [PerforceAddCommand|http://maven.apache.org/scm/maven-scm-providers/maven-scm-provider-perforce/xref/org/apache/maven/scm/provider/perforce/command/add/PerforceAddCommand.html] they don't seem to require those canonical paths.
According to the comment it's for testing purpose, but it seems to cause trouble.
Could you create a Junit test with patch?
> CLONE - mvn release:prepare fails with IOException and a write error (Access is denied)
> ---------------------------------------------------------------------------------------
>
> Key: SCM-678
> URL: https://jira.codehaus.org/browse/SCM-678
> Project: Maven SCM
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Affects Versions: 1.7
> Environment: Windows 7 both command prompt and cygwin using Perforce for SCM
> Reporter: Robert Scholte
> Attachments: maven-release-error.txt, mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
>
>
> When running
> {{mvn release:prepare -Dusername=<perforce_user> -Dpassword=<perforce_password>}}
> I get the errors:
> * java.io.IOException: The filename, directory name, or volume label syntax is incorrect
> * [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c changelist#] [ -d -f -k -n -v ] [-t type] files...
> Missing/wrong number of arguments.
> * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) -> [Help 1]
> The full output is attached.
> Sometimes I also get the error:
> * [ERROR] D:\Server\pom.xml - file(s) not in client view.
> Though I created the client in the same location I'm running from, and I'm not sure that error is related to the others (as the others also occur when that one doesn't).
> It's been suggested (on stackoverflow: http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) that the error has to do with my D drive being a mapped drive, though I don't think it is as it's not listed if I run {{subst}}. However, I think it _must_ be at least a partition on the same hard drive, unless my PC has three physical drives :P (work PC), but I guess that shouldn't make any difference to the program?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (SCM-678) CLONE - mvn release:prepare fails with IOException
and a write error (Access is denied)
Posted by "Svend Hansen (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SCM-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=301415#comment-301415 ]
Svend Hansen edited comment on SCM-678 at 6/19/12 5:11 AM:
-----------------------------------------------------------
I don't think the canonical path is causing the problem, but it's just revealing it.
I'm not completely sure I understand the code and how it _should_ be working, but as far as I can see:
1) The files in the {{ScmFileSet}} passed into the two methods at actual runtime seem to be absolute, so using them with the ScmFileSet's {{basedir}} doesn't seem to make sense?
2) All the tests seem to set the {{basedir}} to '.' and then pass in a separate {{workingDirectory}} or {{workingDir}}, which it self seems to be relative (e.g. "baz/qux").
3) I guess this breaks _less_ in linux as {{/home/me/project/home/me/project/pom.xml}} is still a valid file path (though it would be pointing to a wrong place, of course).
I'm not sure if the bug is that the method doesn't handle absolute paths (before my change), or that the paths of the files are absolute. I think that the latter would be a bug somewhere else in the containing/calling maven modules (maven release plugin, etc).
How to I create a patch? Do I just commit my changes through SVN?
I can write a Junit test that breaks without my change, but works with... Or should I just add another test method to the {{PerforceEditCommandTest}} and {{PerforceCheckInCommandTest}}?
was (Author: svendhhh):
I don't think the canonical path is causing the problem, but it's just revealing it.
I'm not completely sure I understand the code, but as far as I can see:
1) The files in the {{ScmFileSet}} passed into the two methods at actual runtime seem to be absolute, so using them with the ScmFileSet's {{basedir}} doesn't seem to make sense?
2) All the tests seem to set the {{basedir}} to '.' and then pass in a separate {{workingDirectory}} or {{workingDir}}, which it self seems to be relative (e.g. "baz/qux").
3) I guess this breaks _less_ in linux as {{/home/me/project/home/me/project/pom.xml}} is still a valid file path (though it would be pointing to a wrong place, of course).
I'm not sure if the bug is that the method doesn't handle absolute paths (before my change), or that the paths of the files are absolute. I think that the latter would be a bug somewhere else in the containing/calling maven modules (maven release plugin, etc).
How to I create a patch? Do I just commit my changes through SVN?
I can write a Junit test that breaks without my change, but works with... Or should I just add another test method to the {{PerforceEditCommandTest}} and {{PerforceCheckInCommandTest}}?
> CLONE - mvn release:prepare fails with IOException and a write error (Access is denied)
> ---------------------------------------------------------------------------------------
>
> Key: SCM-678
> URL: https://jira.codehaus.org/browse/SCM-678
> Project: Maven SCM
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Affects Versions: 1.7
> Environment: Windows 7 both command prompt and cygwin using Perforce for SCM
> Reporter: Robert Scholte
> Attachments: maven-release-error.txt, mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
>
>
> When running
> {{mvn release:prepare -Dusername=<perforce_user> -Dpassword=<perforce_password>}}
> I get the errors:
> * java.io.IOException: The filename, directory name, or volume label syntax is incorrect
> * [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c changelist#] [ -d -f -k -n -v ] [-t type] files...
> Missing/wrong number of arguments.
> * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) -> [Help 1]
> The full output is attached.
> Sometimes I also get the error:
> * [ERROR] D:\Server\pom.xml - file(s) not in client view.
> Though I created the client in the same location I'm running from, and I'm not sure that error is related to the others (as the others also occur when that one doesn't).
> It's been suggested (on stackoverflow: http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) that the error has to do with my D drive being a mapped drive, though I don't think it is as it's not listed if I run {{subst}}. However, I think it _must_ be at least a partition on the same hard drive, unless my PC has three physical drives :P (work PC), but I guess that shouldn't make any difference to the program?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (SCM-678) CLONE - mvn release:prepare fails with IOException
and a write error (Access is denied)
Posted by "Robert Scholte (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SCM-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Scholte moved MRELEASE-774 to SCM-678:
---------------------------------------------
Complexity: Intermediate
Component/s: (was: prepare)
maven-scm-provider-perforce
Affects Version/s: (was: 2.3.1)
1.7
Key: SCM-678 (was: MRELEASE-774)
Project: Maven SCM (was: Maven 2.x Release Plugin)
> CLONE - mvn release:prepare fails with IOException and a write error (Access is denied)
> ---------------------------------------------------------------------------------------
>
> Key: SCM-678
> URL: https://jira.codehaus.org/browse/SCM-678
> Project: Maven SCM
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Affects Versions: 1.7
> Environment: Windows 7 both command prompt and cygwin using Perforce for SCM
> Reporter: Robert Scholte
> Attachments: maven-release-error.txt, mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
>
>
> When running
> {{mvn release:prepare -Dusername=<perforce_user> -Dpassword=<perforce_password>}}
> I get the errors:
> * java.io.IOException: The filename, directory name, or volume label syntax is incorrect
> * [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c changelist#] [ -d -f -k -n -v ] [-t type] files...
> Missing/wrong number of arguments.
> * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) -> [Help 1]
> The full output is attached.
> Sometimes I also get the error:
> * [ERROR] D:\Server\pom.xml - file(s) not in client view.
> Though I created the client in the same location I'm running from, and I'm not sure that error is related to the others (as the others also occur when that one doesn't).
> It's been suggested (on stackoverflow: http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) that the error has to do with my D drive being a mapped drive, though I don't think it is as it's not listed if I run {{subst}}. However, I think it _must_ be at least a partition on the same hard drive, unless my PC has three physical drives :P (work PC), but I guess that shouldn't make any difference to the program?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (SCM-678) CLONE - mvn release:prepare fails with IOException
and a write error (Access is denied)
Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SCM-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Olivier Lamy reassigned SCM-678:
--------------------------------
Assignee: Olivier Lamy
> CLONE - mvn release:prepare fails with IOException and a write error (Access is denied)
> ---------------------------------------------------------------------------------------
>
> Key: SCM-678
> URL: https://jira.codehaus.org/browse/SCM-678
> Project: Maven SCM
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Affects Versions: 1.7
> Environment: Windows 7 both command prompt and cygwin using Perforce for SCM
> Reporter: Robert Scholte
> Assignee: Olivier Lamy
> Attachments: maven-release-error.txt, MNG-678-perforce.patch, mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
>
>
> When running
> {{mvn release:prepare -Dusername=<perforce_user> -Dpassword=<perforce_password>}}
> I get the errors:
> * java.io.IOException: The filename, directory name, or volume label syntax is incorrect
> * [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c changelist#] [ -d -f -k -n -v ] [-t type] files...
> Missing/wrong number of arguments.
> * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) -> [Help 1]
> The full output is attached.
> Sometimes I also get the error:
> * [ERROR] D:\Server\pom.xml - file(s) not in client view.
> Though I created the client in the same location I'm running from, and I'm not sure that error is related to the others (as the others also occur when that one doesn't).
> It's been suggested (on stackoverflow: http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) that the error has to do with my D drive being a mapped drive, though I don't think it is as it's not listed if I run {{subst}}. However, I think it _must_ be at least a partition on the same hard drive, unless my PC has three physical drives :P (work PC), but I guess that shouldn't make any difference to the program?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (SCM-678) CLONE - mvn release:prepare fails with IOException
and a write error (Access is denied)
Posted by "Robert Scholte (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SCM-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=301446#comment-301446 ]
Robert Scholte commented on SCM-678:
------------------------------------
{quote}
How to I create a patch? Do I just commit my changes through SVN?
I can write a Junit test that breaks without my change, but works with... Or should I just add another test method to the PerforceEditCommandTest and PerforceCheckInCommandTest?
{quote}
You don't have the rights to commit, but creating a patch is just as simple. Your IDE or tools like for instance tortoisesvn have the option 'create patch/diff' next to the commit option.
If you'd prefer executions from command line, please check [http://maven.apache.org/guides/development/guide-m2-development.html#Creating_and_submitting_a_patch]
> CLONE - mvn release:prepare fails with IOException and a write error (Access is denied)
> ---------------------------------------------------------------------------------------
>
> Key: SCM-678
> URL: https://jira.codehaus.org/browse/SCM-678
> Project: Maven SCM
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Affects Versions: 1.7
> Environment: Windows 7 both command prompt and cygwin using Perforce for SCM
> Reporter: Robert Scholte
> Attachments: maven-release-error.txt, mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
>
>
> When running
> {{mvn release:prepare -Dusername=<perforce_user> -Dpassword=<perforce_password>}}
> I get the errors:
> * java.io.IOException: The filename, directory name, or volume label syntax is incorrect
> * [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c changelist#] [ -d -f -k -n -v ] [-t type] files...
> Missing/wrong number of arguments.
> * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) -> [Help 1]
> The full output is attached.
> Sometimes I also get the error:
> * [ERROR] D:\Server\pom.xml - file(s) not in client view.
> Though I created the client in the same location I'm running from, and I'm not sure that error is related to the others (as the others also occur when that one doesn't).
> It's been suggested (on stackoverflow: http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) that the error has to do with my D drive being a mapped drive, though I don't think it is as it's not listed if I run {{subst}}. However, I think it _must_ be at least a partition on the same hard drive, unless my PC has three physical drives :P (work PC), but I guess that shouldn't make any difference to the program?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (SCM-678) CLONE - mvn release:prepare fails with IOException
and a write error (Access is denied)
Posted by "Svend Hansen (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SCM-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=301337#comment-301337 ]
Svend Hansen commented on SCM-678:
----------------------------------
(I'm the one who created this but on this bug on the maven release plugin project)
I've downloaded the code and added a line that printed out the files it's looking at on line 109 (where the exception is thrown) here:
http://maven.apache.org/scm/maven-scm-providers/maven-scm-provider-perforce/xref/org/apache/maven/scm/provider/perforce/command/edit/PerforceEditCommand.html
With the line: {{String canfile = file.getCanonicalPath();}}
and the first file looks like {{D:\Server\D:\Server\pom.xml}} which obviously breaks. Further debug before the line:
{{File file = new File( workingDirectory, fs.get( i ).getPath() );}}
shows that the file path of the fs.get(i) file is absolute. I first tried removing the workingDirectory, as it seemed that it wasn't needed here, but that broke a test, so instead I've changed it to:
{{File file = null;
if(fs.get( i ).isAbsolute()) file = new File( fs.get( i ).getPath() );
else file = new File( workingDirectory, fs.get( i ).getPath() );}}
And now it seems to work (I'm getting a different error much later in the process, but it is now managing the update the pom's versions.
> CLONE - mvn release:prepare fails with IOException and a write error (Access is denied)
> ---------------------------------------------------------------------------------------
>
> Key: SCM-678
> URL: https://jira.codehaus.org/browse/SCM-678
> Project: Maven SCM
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Affects Versions: 1.7
> Environment: Windows 7 both command prompt and cygwin using Perforce for SCM
> Reporter: Robert Scholte
> Attachments: maven-release-error.txt, mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
>
>
> When running
> {{mvn release:prepare -Dusername=<perforce_user> -Dpassword=<perforce_password>}}
> I get the errors:
> * java.io.IOException: The filename, directory name, or volume label syntax is incorrect
> * [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c changelist#] [ -d -f -k -n -v ] [-t type] files...
> Missing/wrong number of arguments.
> * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) -> [Help 1]
> The full output is attached.
> Sometimes I also get the error:
> * [ERROR] D:\Server\pom.xml - file(s) not in client view.
> Though I created the client in the same location I'm running from, and I'm not sure that error is related to the others (as the others also occur when that one doesn't).
> It's been suggested (on stackoverflow: http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) that the error has to do with my D drive being a mapped drive, though I don't think it is as it's not listed if I run {{subst}}. However, I think it _must_ be at least a partition on the same hard drive, unless my PC has three physical drives :P (work PC), but I guess that shouldn't make any difference to the program?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (SCM-678) CLONE - mvn release:prepare fails with IOException
and a write error (Access is denied)
Posted by "Svend Hansen (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SCM-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=301506#comment-301506 ]
Svend Hansen edited comment on SCM-678 at 6/20/12 6:15 AM:
-----------------------------------------------------------
I've attached a patch.
So, the fix is checking whether each file has an absolute path already, before prepending the working directory (and only doing so if they don't).
I've changed the existing unit tests, to remove some of the hard coding, and added an extra test method to test the absolute path situation for both the edit and the checkin classes.
Also, it turns out that it only breaks is the working directory exists, so I'm calling {{new File(".").getAbsoluteFile()}} to make sure it an existing directory, and to get files in there I do {{new File("foo.xml").getAbsoluteFile()}}.
This is because if you have a directory {{c:\foo}} but not a directory {{c:\bar}}, then {{new File("c:\foo\c:\foo\abc.xml}} throws an IOException, while {{new File("c:\bar\c:\bar.abc.xml}} does NOT.
was (Author: svendhhh):
I've attached a patch.
So, the fix is checking whether each file has an absolute path already, before prepending the working directory.
I've changed the existing unit tests, to remove some of the hard coding, and added an extra test method to test the absolute path situation for both the edit and the checkin classes.
Also, it turns out that it only breaks is the working directory exists, so I'm calling {{new File(".").getAbsoluteFile()}} to make sure it an existing directory, and to get files in there I do {{new File("foo.xml").getAbsoluteFile()}}.
This is because if you have a directory {{c:\foo}} but not a directory {{c:\bar}}, then {{new File("c:\foo\c:\foo\abc.xml}} throws an IOException, while {{new File("c:\bar\c:\bar.abc.xml}} does NOT.
> CLONE - mvn release:prepare fails with IOException and a write error (Access is denied)
> ---------------------------------------------------------------------------------------
>
> Key: SCM-678
> URL: https://jira.codehaus.org/browse/SCM-678
> Project: Maven SCM
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Affects Versions: 1.7
> Environment: Windows 7 both command prompt and cygwin using Perforce for SCM
> Reporter: Robert Scholte
> Attachments: maven-release-error.txt, MNG-678-perforce.patch, mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
>
>
> When running
> {{mvn release:prepare -Dusername=<perforce_user> -Dpassword=<perforce_password>}}
> I get the errors:
> * java.io.IOException: The filename, directory name, or volume label syntax is incorrect
> * [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c changelist#] [ -d -f -k -n -v ] [-t type] files...
> Missing/wrong number of arguments.
> * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) -> [Help 1]
> The full output is attached.
> Sometimes I also get the error:
> * [ERROR] D:\Server\pom.xml - file(s) not in client view.
> Though I created the client in the same location I'm running from, and I'm not sure that error is related to the others (as the others also occur when that one doesn't).
> It's been suggested (on stackoverflow: http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) that the error has to do with my D drive being a mapped drive, though I don't think it is as it's not listed if I run {{subst}}. However, I think it _must_ be at least a partition on the same hard drive, unless my PC has three physical drives :P (work PC), but I guess that shouldn't make any difference to the program?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (SCM-678) CLONE - mvn release:prepare fails with IOException
and a write error (Access is denied)
Posted by "Svend Hansen (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SCM-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=301353#comment-301353 ]
Svend Hansen commented on SCM-678:
----------------------------------
The error I'm getting now is very similar, caused by the line:
{{File file = new File( workingDir, fs.get( i ).getPath() );}}
in PerforceCheckInCommand line 139. I've now also changed this one to:
{{File file = null;}}
{{if(fs.get( i ).isAbsolute()) file = new File( fs.get( i ).getPath() );}}
{{else file = new File( workingDir, fs.get( i ).getPath() );}}
And it now seems to be working completely. I'm not sure if my setup is a bit funny, causing this error, but I can't see any reason not to allow the absolute file paths?
Also, I don't know if there are similar "bugs" anywhere else.
> CLONE - mvn release:prepare fails with IOException and a write error (Access is denied)
> ---------------------------------------------------------------------------------------
>
> Key: SCM-678
> URL: https://jira.codehaus.org/browse/SCM-678
> Project: Maven SCM
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Affects Versions: 1.7
> Environment: Windows 7 both command prompt and cygwin using Perforce for SCM
> Reporter: Robert Scholte
> Attachments: maven-release-error.txt, mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
>
>
> When running
> {{mvn release:prepare -Dusername=<perforce_user> -Dpassword=<perforce_password>}}
> I get the errors:
> * java.io.IOException: The filename, directory name, or volume label syntax is incorrect
> * [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c changelist#] [ -d -f -k -n -v ] [-t type] files...
> Missing/wrong number of arguments.
> * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) -> [Help 1]
> The full output is attached.
> Sometimes I also get the error:
> * [ERROR] D:\Server\pom.xml - file(s) not in client view.
> Though I created the client in the same location I'm running from, and I'm not sure that error is related to the others (as the others also occur when that one doesn't).
> It's been suggested (on stackoverflow: http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) that the error has to do with my D drive being a mapped drive, though I don't think it is as it's not listed if I run {{subst}}. However, I think it _must_ be at least a partition on the same hard drive, unless my PC has three physical drives :P (work PC), but I guess that shouldn't make any difference to the program?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (SCM-678) CLONE - mvn release:prepare fails with IOException
and a write error (Access is denied)
Posted by "Svend Hansen (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SCM-678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=301415#comment-301415 ]
Svend Hansen commented on SCM-678:
----------------------------------
I don't think the canonical path is causing the problem, but it's just revealing it.
I'm not completely sure I understand the code, but as far as I can see:
1) The files in the {{ScmFileSet}} passed into the two methods at actual runtime seem to be absolute, so using them with the ScmFileSet's {{basedir}} doesn't seem to make sense?
2) All the tests seem to set the {{basedir}} to '.' and then pass in a separate {{workingDirectory}} or {{workingDir}}, which it self seems to be relative (e.g. "baz/qux").
3) I guess this breaks _less_ in linux as {{/home/me/project/home/me/project/pom.xml}} is still a valid file path (though it would be pointing to a wrong place, of course).
I'm not sure if the bug is that the method doesn't handle absolute paths (before my change), or that the paths of the files are absolute. I think that the latter would be a bug somewhere else in the containing/calling maven modules (maven release plugin, etc).
How to I create a patch? Do I just commit my changes through SVN?
I can write a Junit test that breaks without my change, but works with... Or should I just add another test method to the {{PerforceEditCommandTest}} and {{PerforceCheckInCommandTest}}?
> CLONE - mvn release:prepare fails with IOException and a write error (Access is denied)
> ---------------------------------------------------------------------------------------
>
> Key: SCM-678
> URL: https://jira.codehaus.org/browse/SCM-678
> Project: Maven SCM
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Affects Versions: 1.7
> Environment: Windows 7 both command prompt and cygwin using Perforce for SCM
> Reporter: Robert Scholte
> Attachments: maven-release-error.txt, mvn_release_output_x_client_env.txt, mvn_release_output_x.txt
>
>
> When running
> {{mvn release:prepare -Dusername=<perforce_user> -Dpassword=<perforce_password>}}
> I get the errors:
> * java.io.IOException: The filename, directory name, or volume label syntax is incorrect
> * [ERROR] CommandLineException Exit code: 1 - Usage: add/edit/delete [-c changelist#] [ -d -f -k -n -v ] [-t type] files...
> Missing/wrong number of arguments.
> * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.1:prepare (default-cli) on project root-project: Error writing POM: D:\Server\pom.xml (Access is denied) -> [Help 1]
> The full output is attached.
> Sometimes I also get the error:
> * [ERROR] D:\Server\pom.xml - file(s) not in client view.
> Though I created the client in the same location I'm running from, and I'm not sure that error is related to the others (as the others also occur when that one doesn't).
> It's been suggested (on stackoverflow: http://stackoverflow.com/questions/10999403/maven-releaseprepare-ioexception) that the error has to do with my D drive being a mapped drive, though I don't think it is as it's not listed if I run {{subst}}. However, I think it _must_ be at least a partition on the same hard drive, unless my PC has three physical drives :P (work PC), but I guess that shouldn't make any difference to the program?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira