2

I have a problem with azure pipeline and one of my servers.

The server where it fails is a windows 2019 server.

If I in powershell call git, then it treats all warnings and following lines as errors. If I do the same thing on two og my different servers - no issues - even though same outout.

This is the error returned:

CD to  D:\web\test\testsite.com
 ##[error]git : Warning: Permanently added the RSA host key for IP address 'X' to the list of known hosts.
##[error]git : From bitbucket.org:SITE
##[error]At C:\azagent\A1\_work\_temp\c1ff2d2b-c773-4adc-9040-155e92a914bd.ps1:12 char:1
+ git pull origin master
+ ~~~~~~~~~~~~~~~~~~~~~~
##[error]    + CategoryInfo          : NotSpecified: (From bitbucket....b/fletcocarpets:String) [], RemoteException
##[error]    + FullyQualifiedErrorId : NativeCommandError
##[error] 
##[error]PowerShell exited with code '1'.

Git does make the pull and everything is actually OK. But for some reason - on this server - azure pipelines treats the text as errors.

Any ideas why? hard to explain the problem aswell properly on text.

This is how its returned on the server where it works, as an example:

CD to  D:\web\testsite.com
Warning: Permanently added the RSA host key for IP address 'X' to the list of known hosts.
From bitbucket.org:SITE
* branch            master     -> FETCH_HEAD
 ...
 1 file changed, 27 insertions(+), 23 deletions(-)
 ##[section]Finishing: PowerShell Script - GIT
jan
  • 309
  • 3
  • 14
  • can you post the script – Scott Heath Oct 21 '19 at 12:36
  • Did you specify the git commands in ps1 file, then called it in the task? Could you update with your git commands? – Mengdi Liang Oct 21 '19 at 13:30
  • Hi, the only coomand is "git pull orgin master" really. Then what is returned in output seems to be returned as en error no matter what via azure pipelines powershell. This only happens on this one server - for some reason I cant figure out The azure pipelines powershell is set to stop on error - and not continue - which is important - so I know if it fails or not. I can set it to continue - but then I would not be notified on error. – jan Oct 21 '19 at 18:15
  • I don't think this is a dup... the git command is successful, unlike the linked question. – BenV Dec 17 '19 at 15:19

1 Answers1

6

I found out what helped me. Thought I had tried it - but seems not:

Added this to the top. for some reason this server and git needs this: $env:GIT_REDIRECT_STDERR = '2>&1'

jan
  • 309
  • 3
  • 14