saml2aws icon indicating copy to clipboard operation
saml2aws copied to clipboard

Executable file not in $PATH

Open lxadtz33 opened this issue 1 year ago • 10 comments

To whom it may concern,

Recently I did an upgrade (via brew) to 2.36.7. Unfortunately I don't recall the previous version I was using. After the update I started to get this error exec: "pipenv run chalice local --port 8980": executable file not found in $PATH

This is the saml2aws command that has been working until upgrading to 2.36.7 saml2aws exec -a AWS-profile "pipenv run chalice local --port 8980"

I did get the error to stop by removing the wrapping double quotes ("") saml2aws exec -a AWS-profile pipenv run chalice local --port 8980 but then it complained about --port 8980, because saml2aws assumed it was its option and not part of the chalice command

This worked, without --port 8980 saml2aws exec -a AWS-profile pipenv run chalice local

I'm not the only one on the team experiencing this. Any help would be great.

Thanks in advance, Fred

lxadtz33 avatar May 22 '23 14:05 lxadtz33

Hey @lxadtz33 Will this fix your issue? https://github.com/Versent/saml2aws/pull/1056

mapkon avatar May 23 '23 23:05 mapkon

@mapkon The bug topic is not really reflective of what is going on (and I have seen this error as well).

The problem is that, previously, one could submit the exec command with a double-hyphen flag like --port 8080 but now that seems to be getting interpreted as a command, which of course does not exist.

kmcduffee-verisk avatar May 24 '23 21:05 kmcduffee-verisk

That is interesting. I am not sure how that got mangled up. If you can submit a PR, I can look to merge it. CC: @gliptak

mapkon avatar May 25 '23 09:05 mapkon

Possibly more context/example:

➜  ~ which pipenv
/opt/homebrew/bin/pipenv
➜  ~ saml2aws exec -a AWS-profile "/opt/homebrew/bin/pipenv run chalice local --port 8980"
fork/exec /opt/homebrew/bin/pipenv run chalice local --port 8980: no such file or directory

Putting the command to be executed in quotes used to work, but without it the --port flag gets passed to saml2aws

kmcduffee-verisk avatar May 25 '23 13:05 kmcduffee-verisk

@mapkon #1056 will not fix the issue. I install saml2aws via brew. My original post, and what @kmcduffee-verisk also stated, we can use saml2aws, but now one can't wrap the sub-command and its options with double quotes

lxadtz33 avatar May 26 '23 12:05 lxadtz33

If any of you can submit a PR, we can work to get it merged ASAP.

mapkon avatar Jun 02 '23 09:06 mapkon

@mapkon ☝️ (that's me)

kmcduffee-verisk avatar Jun 02 '23 16:06 kmcduffee-verisk

This is the PR that broke the behavior: #737

The commit log says "it can always be wrapped in a shell on the command line" but that does not seem to work when provided a quoted string, at least on OS X.

An alternative might be to check if cmdline is wrapped in quotes and only then concat the command. Open to feedback and I can provide a change in that direction.

kmcduffee-verisk avatar Jun 02 '23 17:06 kmcduffee-verisk

After some investigation, it appears just using the current version and prefixing the command with -- allows the command to work as expected. This perhaps should be in the documentation somewhere.

kmcduffee-verisk avatar Jun 02 '23 17:06 kmcduffee-verisk

That is great to hear. Maybe if you can still submit a documentation ticket, I will merge it ASAP!

mapkon avatar Jun 03 '23 11:06 mapkon