Skip to content
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

Problem with checkin #99

Closed
AWMKarlas opened this issue Mar 22, 2020 · 13 comments
Closed

Problem with checkin #99

AWMKarlas opened this issue Mar 22, 2020 · 13 comments

Comments

@AWMKarlas
Copy link

AWMKarlas commented Mar 22, 2020

Good day,

i have a problem with that component. Could you please check the error. I use Azure DevOps 2019, agent 2.153.1. Thanks.

##[debug]Evaluating condition for step: 'CheckIn AssymblyInfo with new version'
##[debug]Evaluating: succeeded()
##[debug]Evaluating succeeded:
##[debug]=> True
##[debug]Result: True
##[section]Starting: CheckIn AssymblyInfo with new version
==============================================================================
Task         : TFVC - Check-in changes 
Description  : Checks in any files changed in the repository.
Version      : 2.2.10
Author       : Jesse Houwing
Help         : [More Information](https://github.com/jessehouwing/azure-pipelines-tfvc-tasks/wiki/Check-in)
==============================================================================
##[debug]VstsTaskSdk 0.11.0 commit 7ff27a3e0bdd6f7b06690ae5f5b63cb84d0f23f4
##[debug]Entering script TfvcCheckin.v3.ps1
##[debug]INPUT_COMMENT: '[version][broker]'
##[debug]INPUT_INCLUDENOCICOMMENT: 'true'
##[debug] Converted to bool: True
##[debug]INPUT_ITEMSPEC: '$/OLB_Scrum/Shared/BrokerWorkplace/AssemblyInfo.cs'
##[debug]INPUT_RECURSION: 'None'
##[debug]INPUT_CONFIRMUNDERSTAND: 'true'
##[debug] Converted to bool: True
##[debug]INPUT_OVERRIDEPOLICY: 'false'
##[debug] Converted to bool: False
##[debug]INPUT_OVERRIDEPOLICYREASON (empty)
##[debug] Defaulted to: ''
##[debug]INPUT_NOTES (empty)
##[debug] Defaulted to: ''
##[debug]INPUT_SKIPGATED: 'true'
##[debug] Converted to bool: True
##[debug]INPUT_SKIPSHELVESET: 'true'
##[debug] Converted to bool: True
##[debug]INPUT_AUTODETECTADDS: 'false'
##[debug] Converted to bool: False
##[debug]INPUT_AUTODETECTDELETES: 'false'
##[debug] Converted to bool: False
##[debug]INPUT_BYPASSGATEDCHECKIN: 'false'
##[debug] Converted to bool: False
##[debug]INPUT_AUTHOR: 'Custom'
##[debug]INPUT_AUTHORCUSTOM: 'aparamonov@gcgroup'
##[debug]Loading module from path 'C:\TfsAgent\_work\_tasks\tf-vc-checkin_31f040e5-e040-4556-878a-59a47c7128bd\2.2.10\ps_modules\VstsTfvcShared\VstsTfvcShared.psm1'.
##[debug]Loading module from path 'C:\TfsAgent\_work\_tasks\tf-vc-checkin_31f040e5-e040-4556-878a-59a47c7128bd\2.2.10\ps_modules\VstsTfvcShared\TlsHelper\TlsHelper.psm1'.
##[debug]Loading resource strings from: C:\TfsAgent\_work\_tasks\tf-vc-checkin_31f040e5-e040-4556-878a-59a47c7128bd\2.2.10\ps_modules\VstsTfvcShared\TlsHelper/module.json
##[debug]Loaded 3 strings.
##[debug]SYSTEM_CULTURE: 'en-US'
##[debug]Loading resource strings from: C:\TfsAgent\_work\_tasks\tf-vc-checkin_31f040e5-e040-4556-878a-59a47c7128bd\2.2.10\ps_modules\VstsTfvcShared\TlsHelper\Strings\resources.resjson\en-US\resources.resjson
##[debug]Loaded 3 strings.
##[debug]Exporting function 'Add-Tls12InSession'.
##[debug]Exporting function 'Assert-TlsError'.
##[debug]Importing function 'Add-Tls12InSession'.
##[debug]Importing function 'Assert-TlsError'.
Added TLS 1.2 in session.
##[debug]Setting default assembly locations
##[debug]Trying: C:\TfsAgent\Agent\Worker\Newtonsoft.Json.dll
##[debug]Trying: C:\TfsAgent\externals\vstsom\Newtonsoft.Json.dll
##[debug]Loading assembly: C:\TfsAgent\externals\vstsom\Newtonsoft.Json.dll
##[debug]Setting default assembly locations
##[debug]Trying: C:\TfsAgent\Agent\Worker\Microsoft.TeamFoundation.Client.dll
##[debug]Trying: C:\TfsAgent\externals\vstsom\Microsoft.TeamFoundation.Client.dll
##[debug]Loading assembly: C:\TfsAgent\externals\vstsom\Microsoft.TeamFoundation.Client.dll
##[debug]Setting default assembly locations
##[debug]Trying: C:\TfsAgent\Agent\Worker\Microsoft.TeamFoundation.Common.dll
##[debug]Trying: C:\TfsAgent\externals\vstsom\Microsoft.TeamFoundation.Common.dll
##[debug]Loading assembly: C:\TfsAgent\externals\vstsom\Microsoft.TeamFoundation.Common.dll
##[debug]Setting default assembly locations
##[debug]Trying: C:\TfsAgent\Agent\Worker\Microsoft.TeamFoundation.VersionControl.Client.dll
##[debug]Trying: C:\TfsAgent\externals\vstsom\Microsoft.TeamFoundation.VersionControl.Client.dll
##[debug]Loading assembly: C:\TfsAgent\externals\vstsom\Microsoft.TeamFoundation.VersionControl.Client.dll
##[debug]Setting default assembly locations
##[debug]Trying: C:\TfsAgent\Agent\Worker\Microsoft.TeamFoundation.WorkItemTracking.Client.dll
##[debug]Trying: C:\TfsAgent\externals\vstsom\Microsoft.TeamFoundation.WorkItemTracking.Client.dll
##[debug]Loading assembly: C:\TfsAgent\externals\vstsom\Microsoft.TeamFoundation.WorkItemTracking.Client.dll
##[debug]Setting default assembly locations
##[debug]Trying: C:\TfsAgent\Agent\Worker\Microsoft.TeamFoundation.Diff.dll
##[debug]Trying: C:\TfsAgent\externals\vstsom\Microsoft.TeamFoundation.Diff.dll
##[debug]Loading assembly: C:\TfsAgent\externals\vstsom\Microsoft.TeamFoundation.Diff.dll
##[debug]Exporting function 'Write-Message'.
##[debug]Exporting function 'Invoke-DisposeSourceProvider'.
##[debug]Exporting function 'Get-SourceProvider'.
##[debug]Exporting function 'AutoPend-WorkspaceChanges'.
##[debug]Exporting function 'Convert-ToItemSpecs'.
##[debug]Exporting function 'Find-VisualStudio'.
##[debug]The 'AutoPend-WorkspaceChanges' command in the VstsTfvcShared' module was imported, but because its name does not include an approved verb, it might be difficult to find. For a list of approved verbs, type Get-Verb.
##[debug]Importing function 'AutoPend-WorkspaceChanges'.
##[debug]Importing function 'Convert-ToItemSpecs'.
##[debug]Importing function 'Find-VisualStudio'.
##[debug]Importing function 'Get-SourceProvider'.
##[debug]Importing function 'Invoke-DisposeSourceProvider'.
##[debug]Importing function 'Write-Message'.
##[debug]Importing modules
##[debug]Entering script TfvcCheckin.v3.ps1
##[debug]Entering Get-SourceProvider
##[debug]SYSTEM_TEAMFOUNDATIONCOLLECTIONURI: 'http://localhost:8080/tfs/VTB24/'
##[debug]Entering Get-VstsTfsClientCredentials.
##[debug] OMDirectory: ''
##[debug]ENDPOINT_URL_SystemVssConnection: 'http://localhost:8080/tfs/VTB24/'
##[debug]ENDPOINT_AUTH_SystemVssConnection: '********'
##[debug]ENDPOINT_DATA_SystemVssConnection (empty)
##[debug]Testing file path: 'Newtonsoft.Json.dll'
##[debug]Not found. Rethrowing exception.
##[debug]Leaving Get-VstsTfsClientCredentials.
##[debug]Entering Invoke-DisposeSourceProvider
##[debug]Leaving Invoke-DisposeSourceProvider
##[debug]Leaving Get-SourceProvider
##[debug]Entering Invoke-DisposeSourceProvider
##[debug]Leaving Invoke-DisposeSourceProvider
##[debug]Caught exception from task script.
##[debug]Error record:
##[debug]Get-VstsTfsClientCredentials : ScriptHalted
##[debug]At C:\TfsAgent\_work\_tasks\tf-vc-checkin_31f040e5-e040-4556-878a-59a47c7128bd\2.2.10\ps_modules\VstsTfvcShared\VstsTfvcShared.psm1:99 char:29
##[debug]+ ... edentials = Get-VstsTfsClientCredentials -OMDirectory $(Find-VisualSt ...
##[debug]+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##[debug]    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep    tion
##[debug]    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio    n,Get-VstsTfsClientCredentials
##[debug] 
##[debug]Script stack trace:
##[debug]at Get-TfsClientCredentials, C:\TfsAgent\_work\_tasks\tf-vc-checkin_31f040e5-e040-4556-878a-59a47c7128bd\2.2.10\ps_modules\VstsTaskSdk\ServerOMFunctions.ps1: line 177
##[debug]at Get-TfsTeamProjectCollection, C:\TfsAgent\_work\_tasks\tf-vc-checkin_31f040e5-e040-4556-878a-59a47c7128bd\2.2.10\ps_modules\VstsTfvcShared\VstsTfvcShared.psm1: line 99
##[debug]at Get-SourceProvider, C:\TfsAgent\_work\_tasks\tf-vc-checkin_31f040e5-e040-4556-878a-59a47c7128bd\2.2.10\ps_modules\VstsTfvcShared\VstsTfvcShared.psm1: line 122
##[debug]at <ScriptBlock>, C:\TfsAgent\_work\_tasks\tf-vc-checkin_31f040e5-e040-4556-878a-59a47c7128bd\2.2.10\TfvcCheckin.v3.ps1: line 179
##[debug]at <ScriptBlock>, <No file>: line 1
##[debug]at <ScriptBlock>, <No file>: line 22
##[debug]at <ScriptBlock>, <No file>: line 18
##[debug]at <ScriptBlock>, <No file>: line 1
##[debug]Exception:
##[debug]Microsoft.PowerShell.Commands.WriteErrorException: ScriptHalted
##[error]ScriptHalted
##[debug]Processed: ##vso[task.logissue type=error]ScriptHalted
##[debug]Processed: ##vso[task.complete result=Failed]
##[section]Finishing: CheckIn AssymblyInfo with new version
@jessehouwing
Copy link
Owner

jessehouwing commented Mar 22, 2020 via email

@AWMKarlas
Copy link
Author

AWMKarlas commented Mar 22, 2020

I have server with deployed Azure Server 2019 and agent and also VS 2017. Is it necessary to have VS installed on agent machine?

@jessehouwing
Copy link
Owner

jessehouwing commented Mar 22, 2020 via email

@jessehouwing
Copy link
Owner

jessehouwing commented Mar 22, 2020 via email

@kdrayton
Copy link

I had a similar issue and following up on your feedback I added a literal path to the visual studio 14 and it worked. I did some additional testing and confirmed that vswhere.exe returns an empty string even when run at the command line. Can you tell me why "$PSScript/vswhere.exe" does not appear to work?

This was my work-around:
function Find-VisualStudio {
$ErrorActionPreference = 'Stop'

$path = & $PSScriptRoot/vswhere.exe -latest -products * -requires Microsoft.VisualStudio.TeamExplorer -property installationPath
#Added a literal path since I know exactly where VS 14.0 is located.
if ([string]::IsNullOrWhiteSpace($path))
{
    #vswhere returns null. so use literal path to VS 14
    $path = 'C:\Program Files (x86)\Microsoft Visual Studio 14.0'
}
if ( -not [string]::IsNullOrWhiteSpace($path)) {
    $path = join-path $path '\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\'
    return $path
}
return $null

}

@jessehouwing
Copy link
Owner

jessehouwing commented May 22, 2020

Visual Studio 14.*, That's 2015 from the top of my head. it used a different installer technique. vswhere supports 2017 and above.

vs 16 => 2019
vs 15 => 2017
vs 14 => *2015*

I can add a registry lookup to find the correct installation path, though I'd recommend a newer version of Team Explorer.

@kdrayton
Copy link

Then that makes sense. I thought that version 2 of the script supported VS2015. Does this mean that I'll need to upgrade to VS2017 or greater?

@jessehouwing
Copy link
Owner

@jessehouwing
Copy link
Owner

I may have a possible solution. If you send me your org name, I can share a test version. The hosted pool no longer ahs images with just VS2015 n it, so I can't test it easily anymore. @kdrayton

@jessehouwing
Copy link
Owner

jessehouwing commented May 26, 2020

I think I found the cause op the bug. The path to the assemblies is mostly handled by my own code. That used to be in one place. The auth code needs a pointer to the Visual Studio installation as well. There I only pass in the Find-VisualStudio function, which won't resolve VS2015.

I moved all the find logic into Find-Visualstudio.

9e417af

@kdrayton @AWMKarlas can either of you confirm the fix? It has been deployed in 2.2.15.

@kdrayton
Copy link

Hi Jesse,

I tested your latest changes to the VstsTfvcShared.psm1 module and the Find-Visualstudio function. It worked well with no errors. Thank you for jumping on this and getting it resolved so quickly.

@jessehouwing
Copy link
Owner

FINALLY! Thanks for confirming. Closing.

@jessehouwing
Copy link
Owner

If the extension helps you, it would help me if you could do any or all of the following:

@jessehouwing jessehouwing pinned this issue Sep 22, 2020
@jessehouwing jessehouwing unpinned this issue Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants