-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[git-bash] aws iam create-role --path /x/ error: The specified value for path is invalid. It must begin and end with / and contain only alphanumeric characters and/or / characters. #3829
Comments
@rlyders Thanks for the debug logs. That is really helpful. It looks like an issue with git-bash. Specifically, it is expanding |
Hi Kyle,
Yes, once I saw that the path parameter was being prefixed as though it was a relative directory path, that was one of the first things I tried. I tried quotes, double-quotes, DOS paths, Linux paths. I was surprised
For example, I tried a DOS path in single quotes (‘C:\Users\Richard\...’) which allows me to use DOS paths in Git-Bash instead of Linux-style paths (/c/Users/Richard/…). Yet, that also became prefixed with the current directory path.
Interestingly, git-bash appears to be adding this prefix completely off the name of the “path” parameter. Even if I entered gibberish in the path, it would be prefixed with the current directory path.
Let me know if you would like me to test anything else. I’d be happy to help if I can.
Regards,
Richard Lyders
…________________________________
From: Kyle Knapp <notifications@github.com>
Sent: Wednesday, January 9, 2019 4:02:17 PM
To: aws/aws-cli
Cc: rlyders; Mention
Subject: Re: [aws/aws-cli] [git-bash] aws iam create-role --path /x/ error: The specified value for path is invalid. It must begin and end with / and contain only alphanumeric characters and/or / characters. (#3829)
@rlyders<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frlyders&data=02%7C01%7C%7Cf529d32835704c43a26208d6767e1f05%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636826681382233079&sdata=SugQwFmaeK5eO7kcxK1nMmlOCIvyVRq4rA4x583RFoQ%3D&reserved=0> Thanks for the debug logs. That is really helpful. It looks like an issue with git-bash. Specifically, it is expanding /service-role/ to C:/Program Files/Git/service-role/. I'm not entirely sure why git-bash is expanding the value. Could you try quoting the --path value with single quotes instead of double quotes?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Faws%2Faws-cli%2Fissues%2F3829%23issuecomment-452885249&data=02%7C01%7C%7Cf529d32835704c43a26208d6767e1f05%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636826681382233079&sdata=tDn8x3IfqtW01SyhbVxR1NHHML62VJhNs6j%2B4%2B%2BQN2Q%3D&reserved=0>, or mute the thread<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAELxgKLQIGkjd7qqaDU6rqwj0XkgoFuMks5vBmbpgaJpZM4ZyB5q&data=02%7C01%7C%7Cf529d32835704c43a26208d6767e1f05%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636826681382233079&sdata=GWQu3D8H3gbi0ggtNCHCKfx0GaC5pcalYiEzntEwAzk%3D&reserved=0>.
|
Just to clarify, when I tested a DOS path, I did not include the full path (‘C:\Users\Richard\...’), but rather a relative path, which then was prefixed with the current directory. It was just an interesting test since I clearly didn’t want a directory path there anyways. 😊
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
…________________________________
From: Richard Lyders <Richard@Lyders.com>
Sent: Wednesday, January 9, 2019 4:10:44 PM
To: aws/aws-cli
Subject: RE: [aws/aws-cli] [git-bash] aws iam create-role --path /x/ error: The specified value for path is invalid. It must begin and end with / and contain only alphanumeric characters and/or / characters. (#3829)
Hi Kyle,
Yes, once I saw that the path parameter was being prefixed as though it was a relative directory path, that was one of the first things I tried. I tried quotes, double-quotes, DOS paths, Linux paths. I was surprised
For example, I tried a DOS path in single quotes (‘C:\Users\Richard\...’) which allows me to use DOS paths in Git-Bash instead of Linux-style paths (/c/Users/Richard/…). Yet, that also became prefixed with the current directory path.
Interestingly, git-bash appears to be adding this prefix completely off the name of the “path” parameter. Even if I entered gibberish in the path, it would be prefixed with the current directory path.
Let me know if you would like me to test anything else. I’d be happy to help if I can.
Regards,
Richard Lyders
________________________________
From: Kyle Knapp <notifications@github.com>
Sent: Wednesday, January 9, 2019 4:02:17 PM
To: aws/aws-cli
Cc: rlyders; Mention
Subject: Re: [aws/aws-cli] [git-bash] aws iam create-role --path /x/ error: The specified value for path is invalid. It must begin and end with / and contain only alphanumeric characters and/or / characters. (#3829)
@rlyders<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frlyders&data=02%7C01%7C%7Cf529d32835704c43a26208d6767e1f05%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636826681382233079&sdata=SugQwFmaeK5eO7kcxK1nMmlOCIvyVRq4rA4x583RFoQ%3D&reserved=0> Thanks for the debug logs. That is really helpful. It looks like an issue with git-bash. Specifically, it is expanding /service-role/ to C:/Program Files/Git/service-role/. I'm not entirely sure why git-bash is expanding the value. Could you try quoting the --path value with single quotes instead of double quotes?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Faws%2Faws-cli%2Fissues%2F3829%23issuecomment-452885249&data=02%7C01%7C%7Cf529d32835704c43a26208d6767e1f05%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636826681382233079&sdata=tDn8x3IfqtW01SyhbVxR1NHHML62VJhNs6j%2B4%2B%2BQN2Q%3D&reserved=0>, or mute the thread<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAELxgKLQIGkjd7qqaDU6rqwj0XkgoFuMks5vBmbpgaJpZM4ZyB5q&data=02%7C01%7C%7Cf529d32835704c43a26208d6767e1f05%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636826681382233079&sdata=GWQu3D8H3gbi0ggtNCHCKfx0GaC5pcalYiEzntEwAzk%3D&reserved=0>.
|
@rlyders I was looking around online. Maybe following this comment fixes it for you? moby/moby#24029 (comment) It seems like this path expansion is a feature for the git bash shell you are using but you may be able to turn it off. |
@rlyders - Thanks for the feedback and glad to here this is resolved. |
Another helpful tip from the “Known Issues” of the latest Git for Windows v2.20.1 Release Notes:
* If you specify command-line options starting with a slash, POSIX-to-Windows path conversion will kick in converting e.g. "/usr/bin/bash.exe" to "C:\Program Files\Git\usr\bin\bash.exe". When that is not desired -- e.g. "--upload-pack=/opt/git/bin/git-upload-pack" or "-L/regex/" -- you need to set the environment variable MSYS_NO_PATHCONV temporarily, like so:
MSYS_NO_PATHCONV=1 git blame -L/pathconv/ msys2_path_conv.cc
Alternatively, you can double the first slash to avoid POSIX-to-Windows path conversion, e.g. "//usr/bin/bash.exe".
Specifically, this is the tip I will try next time:
double the first slash to avoid POSIX-to-Windows path conversion, e.g. "//usr/bin/bash.exe".
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
From: Nancy Alvine<mailto:notifications@github.com>
Sent: Monday, January 14, 2019 11:55 AM
To: aws/aws-cli<mailto:aws-cli@noreply.github.com>
Cc: rlyders<mailto:Richard@Lyders.com>; Mention<mailto:mention@noreply.github.com>
Subject: Re: [aws/aws-cli] [git-bash] aws iam create-role --path /x/ error: The specified value for path is invalid. It must begin and end with / and contain only alphanumeric characters and/or / characters. (#3829)
Closed #3829<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Faws%2Faws-cli%2Fissues%2F3829&data=02%7C01%7C%7Cbfc71324bdf349662c2d08d67a497b25%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636830853343140980&sdata=HHbGHcwQfVG2o%2FERc%2F4%2F8sW51SNX6GOk8pZozhOsq5k%3D&reserved=0>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Faws%2Faws-cli%2Fissues%2F3829%23event-2072496359&data=02%7C01%7C%7Cbfc71324bdf349662c2d08d67a497b25%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636830853343140980&sdata=6rt2zYhnogOMRXHlL079m025lBcP9SCyNmcFQupW2g4%3D&reserved=0>, or mute the thread<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAELxgIGaHYXK884J0wfYgnQf643klpZiks5vDMSUgaJpZM4ZyB5q&data=02%7C01%7C%7Cbfc71324bdf349662c2d08d67a497b25%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636830853343140980&sdata=%2BbAdBM72Nh6Z2CDuhJuc%2BPs2D4AiXybHLEbnrAjD%2Bog%3D&reserved=0>.
|
Running awscli in git-bash
Windows 10
$ aws --version
aws-cli/1.16.84 Python/3.7.2 Windows/10 botocore/1.12.74
$ git --version
git version 2.12.0.windows.1
I get an error when I RUN the following in git-bash on Windows:
aws iam create-role --role-name testRole --path "/service-role/" --assume-role-policy-document file://trust-relationship.json --profile=$profile
ERROR:
An error occurred (ValidationError) when calling the CreateRole operation: The specified value for path is invalid. It must begin and end with / and contain only alphanumeric characters and/or / characters.
This same error occurs whether I surround the Path parameter in quotes, single quotes, or leave it unquoted.
Debugging this error in Python (awscli/clidriver.py: main()) I find that the '--path' parameters equals 'C:/Program Files/Git/service-role/' as opposed to '/service-role/'. Apparently the path is erroneously being interpreted as a file system path and being prefixed with the file path to git.
My ugly fix to this problem is the following hack starting on existing line 490:
I gather this could be an error with git-bash... I've only had time to debug this up to this point. I appreciate any advice you have on this. Thanks.
Resulting debug output showing corrected Path value
trust-relationship.json:
Original error log...
The text was updated successfully, but these errors were encountered: