You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] fly intercept randomly asks to choose container although step is passed on command-line #2067
I have pipeline hello with job hello.j which contains two tasks, say-hello-1.t and say-hello-2.t. I want to fly intercept in a non-interactive way, so I specify on the command-line the task I want to intercept:
Since i am running intercept under watch (watch fly -t tutorial intercept -j hello/hello.j -s say-hello-1.t ps aux), the effect is that the intercept hangs forever and watch doesn't have the possibility to re-run my intercept each 2 seconds.
Since the two tasks run very fast, maybe this is a race condition somewhere in fly logic / query ?
I think the time resource can be removed. You can keep triggering the job on the web UI and keep running fly intercept, sometimes you get the container shell (or the ps output if specified), sometimes you get the choose a container: prompt.
A Modest Proposal
Fixing the root cause would be great, but I was thinking, in any case adding a flag --no-interactive to fly intercept, with the behavior of always failing instead of asking to chose a container, could be beneficial also outside my use case.
Imagine for example running something like fly -t tutorial intercept -j hello/hello.j -s say-hello-1.t ps aux from a script, you really don't want it to hang :-)
The following can also be handy:
Concourse version: 3.9.1
Deployment type (BOSH/Docker/binary): binary
Infrastructure/IaaS: test deployment in a VM (ATC and 1 worker on same VM)
changed the title [-]fly intercept randomly asks to choose container although step is passed on command-line[/-][+][BUG] fly intercept randomly asks to choose container although step is passed on command-line[/+]on Mar 13, 2018
Randomly fly behaves as if the -s say-hello-1.t was not specified and drops in interactive mode:
If you have containers matching the name of task with multiple builds, then interactive option is prompted. To avoid this try to add -b, --build= to mention a specific build number. Another option would be to try -u, --url= along with -s too.
To avoid watch hang for a prompt consider using either URL(-u) + -s or use -j, -s and -b option.
Ah @shashwathi thanks, you made me realize that I confused two things. I Though that the only reason for fly intercept to drop to interactive mode was if the step was not specified (and this is what I put in the title of this ticket), while it is clear that it was as you mention: fly was asking me to select the build, not the step:
Having cleared this misunderstanding on my side, here is what I think:
the --url or --build still don't solve my problem, because if one runs fly under watch, one cannot / doesn't want to specify a build, one would like the "latest" build.
maybe we could introduce a special value for --build that means "latest" ?
still the --no-interactive flag with guaranteed failure in case of non-uniqueness looks like useful to me.
maybe we could introduce a special value for --build that means "latest" ?
I am not a fan of using this practice.
still the --no-interactive flag with guaranteed failure in case of non-uniqueness looks like useful to me.
I do like the approach of -n where build number should point to latest build information.
Questions
Consider an example where build 1,2,3 are triggered and containers for build 3 are deleted after a while, -n would ssh into build 2 container but technically its not the latest. Is this misleading to a user? How to make it clear that latest build containers are not available anymore?
Regarding your question with the example, -n should fail if the latest container is not available, it should not fall back to "the latest available container". This to follow POLA: Principle Of Least Astonishment. Maybe one way to make it clear that the latest container is not available any more is to return a 5XX code with a text message ?
@marco-m If there are no replies then there is no news. :) Lots of things to do, so little time.
I think we could have --non-interactive target only the latest build. If the latest build has no matching containers, it should fail. As an added bonus, we could have fly auto-detect non-interactive for things like watch by checking if stdin is a tty.
Activity
[-]fly intercept randomly asks to choose container although step is passed on command-line[/-][+][BUG] fly intercept randomly asks to choose container although step is passed on command-line[/+]marco-m commentedon Mar 26, 2018
hello ?
shashwathi commentedon Mar 29, 2018
@marco-m :
If you have containers matching the name of task with multiple builds, then interactive option is prompted. To avoid this try to add
-b, --build=to mention a specific build number. Another option would be to try-u, --url=along with-stoo.To avoid
watchhang for a prompt consider using either URL(-u) +-sor use-j,-sand-boption.marco-m commentedon Mar 29, 2018
Ah @shashwathi thanks, you made me realize that I confused two things. I Though that the only reason for
fly interceptto drop to interactive mode was if the step was not specified (and this is what I put in the title of this ticket), while it is clear that it was as you mention: fly was asking me to select the build, not the step:Having cleared this misunderstanding on my side, here is what I think:
--urlor--buildstill don't solve my problem, because if one runs fly underwatch, one cannot / doesn't want to specify a build, one would like the "latest" build.--buildthat means "latest" ?--no-interactiveflag with guaranteed failure in case of non-uniqueness looks like useful to me.What do you think?
shashwathi commentedon Mar 29, 2018
I am not a fan of using this practice.
I do like the approach of
-nwhere build number should point to latest build information.Questions
Consider an example where build 1,2,3 are triggered and containers for build 3 are deleted after a while,
-nwould ssh into build 2 container but technically its not the latest. Is this misleading to a user? How to make it clear that latest build containers are not available anymore?@vito : Thoughts?
marco-m commentedon Apr 4, 2018
Regarding your question with the example,
-nshould fail if the latest container is not available, it should not fall back to "the latest available container". This to follow POLA: Principle Of Least Astonishment. Maybe one way to make it clear that the latest container is not available any more is to return a 5XX code with a text message ?marco-m commentedon Apr 16, 2018
Hello @shashwathi, any news ?
vito commentedon Apr 16, 2018
@marco-m If there are no replies then there is no news. :) Lots of things to do, so little time.
I think we could have
--non-interactivetarget only the latest build. If the latest build has no matching containers, it should fail. As an added bonus, we could haveflyauto-detect non-interactive for things likewatchby checking if stdin is a tty.marco-m commentedon Apr 16, 2018
@vito @shashwathi Thanks for the answer, and sorry for the noise, I will set my timeout longer :-)
bump etree tsa handlers mux clockwork goxmldsig genproto grpc
stale commentedon Jul 31, 2019
Beep boop! This issue has been idle for long enough that it's time to check in and see if it's still important.
If it is, what is blocking it? Would anyone be interested in submitting a PR or continuing the discussion to help move things forward?
If no activity is observed within the next week, this issue will be
exterminatedclosed, in accordance with our stale issue process.