Author Topic: Gitlab runner - сould not find connection to version control provider  (Read 1707 times)

prozelit

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Hello. I wrote a powershell script that updates the local working copy of the Package file.
It works locally. But when this is run in CI I get the error Сould not find connection to version control provider
Gitlab runner run from system

Here is a simplified (without recursion) part of the script

Code: [Select]
   svn checkout **** $newPath --non-interactive --trust-server-cert --username $USERNAME --password $PASSWORD
   $app = New-Object -ComObject "EA.App" -Strict
   $app.Repository.OpenFile($file_path)
   $first_root_model = $app.Repository.Models.GetAt(0)
   $root_guid = $first_root_model.PackageGUID
   $package = $app.Repository.GetPackageByGuid($root_guid)
   svn-auth
   $package.VersionControlGetLatest($true)
   $package.GetLastError()

After this command
   
Code: [Select]
   $package.VersionControlGetLatest($true)
I get
Code: [Select]
Object reference not set to an instance of an object.
At C:\Windows\TEMP\build_script3916629379\script.ps1:312 char:5
+     $package.VersionControlGetLatest($true)
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException

After this command
   
Code: [Select]
$package.GetLastError()
I get
Code: [Select]
Could not find connection to version control provider

Authorization data is stored in a file. svn auth outputs

Code: [Select]
Credentials cache in 'C:\Windows\system32\config\systemprofile\AppData\Roaming\Subversion' contains 1 credential

How to fix this problem?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Gitlab runner - сould not find connection to version control provider
« Reply #1 on: December 06, 2022, 07:39:28 pm »
You are doing some weird stuff.

Code: [Select]
   $first_root_model = $app.Repository.Models.GetAt(0)
   $root_guid = $first_root_model.PackageGUID
   $package = $app.Repository.GetPackageByGuid($root_guid)

Here you already have the package object you need in $first_root_model, but you still get it again using it's guid. Why?

Apart from that I'm guessing you have a problem because the user running the script does not have the correct configurations or authorizations to connect to the version control provider.

Geert