Get from Team Foundation - tf.exe getting stuck

I’m experimenting with setting up an FB project to build my product. Overall, things are going fine, but I’m having occasional problems with the Team Foundation Get action getting stuck - tf.exe is running, but using no CPU time and doing no I/O. It’s as if tf.exe is trying to read from the console or something like that.

Has anyone seen this sort of behavior? Any ideas how to eliminate it?

Hi Carl,

Sorry to hear you’re having problems. It’s quite possible that tf.exe is pausing for input, although I don’t know what it could be asking. I have some ideas, though:

- Is it possible TF is sometimes asking for credentials? If you specify explicit credentials as part of the action, does the problem go away (I don’t know why a problem like this would be intermittent, but it could be…)?

- If you press the red Terminate button, do you get any further output from the action? Sometimes a prompt for information does not get flushed to the FB log until the action is terminated.

- The action logs the command line (sans password) that it uses to run tf.exe. If you run the same command line from a command prompt (in the correct working directory), do you see a prompt for input?

… if all that fails, could you please post the log output from the stalled action?

Thanks.

I have a theory that this is related to the “Live Log View” option on the build summary page. I’d had it both checked and unchecked for various runs, but when I unchecked it, closed FB4 and then re-opened it, I haven’t seen the “stuck” problem again.

To answer your question though -

No, tf is using the credentials of the logged in user and doesn’t prompt.

If I press the Terminate button, I get one line of additional output - Action Failed!

I can run the same command line from a command prompt without indicdent. tf.exe doesn’t prompt for input or otherwise pause.

I’ll keep an eye on it over the next few days - if I notice anything that looks relevant, I’ll let you know.

Hi Carl,

Thanks for the quick response. Sorry that none of those suggestions helped out.

The action itself doesn’t know anything about the setting of the “Live Log View” option, so it’s extremely unlikely that it would change runtime behaviour.

Please let us know if you come up with any steps to reproduce it. Is it possible that something on either the TF server, or the connection to the TF server, is disrupting the connection?

I don't think there's anything related to the server or the connection. While tf.exe is stuck, I'm still able to interact with TFS through Visual Studio on the same client machine.

I've aksed over on the TFS forums if anyone's seen anything like this before as well. If I haven't done anything that should have fixed it - most likely it'll come back. They always do!

If I learn more, I'll be back :)

By the way - does the TFS Get action include /noprompt in the command-line options? I’m not at the machine where FB4 is installed at the moment, so I can’t readily check.

It definitely should be. That’s not to say thay tf.exe always honours that flag, though.

Another idea from the MSFT guys:

are you redirecting any of the standard
streams? In particular, tf.exe will block trying to read from stdin if
the stream isn’t closed


That would seem to fit the symptoms, but it’s not clear why it would work sometimes and not others.

Based on additional feedback from the team system folks, it sounds like this might well have to do with running tf.exe with stdin redirected. Does the FB action redirect stdin? If so, when does it close the stream?

Hi Carl,

It is possible that tf.exe is blocking on stdin if it is attempting to read data (although it should not be, given the /noprompt option.) I’ve made some changes to ensure the stdin handle is always closed (I’ll post a test build URL when it’s available.)

OK, Thanks!

Test build now available:

https://www.finalbuilder.com/downloads/finalbuilder/410/FB410_251.exe

(Please note that there have been some changes to FTP in this build to allow large file (>2Gb) upload support. The changes have been thoroughly tested, but the test build still comes with a warning to take care for FTP actions, at least for now.)

Thanks! I’ll give that version a try if my current investigation doesn’t pan out. Since I last posted, we’ve encountered other issues that suggest that this is really a network issue and doesn’t have anything per-se to do with FB or TFS. I’ve made some network changes and want to let those cook for a few days to see what (if anything) develops.

Hi Carl,

Glad to hear that you might have it sorted.

By the way - we recently moved to a new office, and I've haven't seen this problem again since the move (but it did continue to appear sporadically at the old location).  I'd concluded a while back that it was actually a network issue - intermittent packet loss with unknown cause - that was really causing tf.exe to hang.

It's good to finally "close the loop" on this though!

Hi Carl,

Thanks for the feedback. Always good to hear of a solution to an outstanding issue.

Regards,

Angus