Unable to extend private and public extensions from GitHub Repo

Howdy folks,

I seem to be having trouble pyrevit extend-ing both public and private extensions from their respective GitHub repos via the CLI and am wondering if anyone else is experiencing anything similar. I have a bug report created although since not everyone looks there as much as they do on the forum, I’d figure I’d ask here if anyone is experiencing anything similar where they get a PyRevitException exception from LibGit2Sharp.Core.NativeMethods when the script attempts to clone the repo from GitHub.

More info is in the bug report linked above including sample outputs, reproduction steps, and screenshots. I’m thinking the issue may be something like what was discussed here in a previous release. Any thoughts/input is appreciated!

Did you delete the old clone before extending?

CLI 5.0.X depends on a .pyrevitargs (if i remember correctly, not at the computer right now). If the old clone is still installed, the CLI will find the path but missing .pyrevitargs, was my finding when debug testing all possible install configs before deploying to our users.

The only solution i found was manually deleting the clone folder or running delete clone command with 4.8.16 before updating cli and adding a 5.0.X clone and extend.

Thanks for the insight on a test case for deployment, but in this case the only clone installed was v5.0.1.

==> Registered Clones (deployed from archive/image)
main | Branch: "master" | Version: "5.0.1.25051+1323" | Path: "C:\pyRevit\main"

Ah, I see! Then I dont have any new input, but I also need to test 5.0.1 soon, so will report if i stumble on something. :thinking:

1 Like

Gonna bump this thread since I’m still having issues. Digging through the code I’m assume the error is occuring during this function call to this function in libgit2sharp - however thats where the trail goes cold for me.

I’m not sure what else I can do to debug this, may try replacing the libgit2sharp.dll in the pyrevit-cli folder with an older version & see if that fixes it? Although I’m wondering if that requires a rebuild of the .exe.

@Jean-Marc sorry for the ping do you have any thoughts on potential causes/debug steps/solutions since it seems like this may have happened before with pyrevit v4.8.14?

Update: tried this with LibGit2Sharp 0.29.0 (whats used in pyRevit v4.8.16) & got a System.IO.FileNotFoundException since it needs the exact version to work.

Alright, been poking around trying to find a workaround to no avail yet, but made an observation.

While I’m unable to successfully clone EF-Tools via pyRevit CLI with the command pyrevit extend ui EF-Tools https://github.com/ErikFrits/EF-Tools --debug, I was able to clone EF-Tools using the build in extension manager in the pyRevit tab. Digging though the code it eventually calls the same Clone function in LibGit2Sharp (code snippet here) which TBH is confusing me more now that LibGit2Sharp is happy within the context of being called by pyRevit’s extension script, but not when I am calling it via the CLI. Could be indicitive of user error?

More into flu and fever these days.

:pensive: Sorry to hear that - I ended up with something nasty too on Sunday. Didn’t know illness could transmit over IP lol

1 Like

I’ve tested it here, and it worked fine for me. Have you tried again?

Hmm, still experiencing it. Wondering if its a localized user error/dependency issue since its happening across many devices at my company. Heres the screenshots of me trying to extend EF-Tools just now:



just to cover my bases, are you on v5.0.1 of the CLI as well?

Yes

my pyrevit env output

==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
master | Branch: "master" | Version: "5.0.1.25051+1239" | Path: "C:\Users\Iorhan\AppData\Roaming\pyRevit-Master"

when running

pyrevit extend ui EF-Tools https://github.com/ErikFrits/EF-Tools --dest=C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions --branch=main --debug
--dest = C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions
--branch = main
extend = True
<extension_name> = EF-Tools
ui = True
<repo_url> = https://github.com/ErikFrits/EF-Tools
Debug: Checking for all: wiki 
Debug: Missing: wiki 
Debug: Checking for all: blog 
Debug: Missing: blog 
Debug: Checking for all: docs 
Debug: Missing: docs 
Debug: Checking for all: source 
Debug: Missing: source 
Debug: Checking for all: youtube 
Debug: Missing: youtube 
Debug: Checking for all: support 
Debug: Missing: support 
Debug: Checking for all: env 
Debug: Missing: env 
Debug: Checking for all: update 
Debug: Missing: update 
Debug: Checking for all: clone 
Debug: Missing: clone 
Debug: Checking for all: clones 
Debug: Missing: clones 
Debug: Checking for all: attach 
Debug: Missing: attach 
Debug: Checking for all: detach 
Debug: Missing: detach 
Debug: Checking for all: attached 
Debug: Missing: attached 
Debug: Checking for all: switch 
Debug: Missing: switch 
Debug: Checking for all: extend 
Debug: Checking for any: ui,lib 
Debug: Matching: ui 
Debug: Looking up installed extension "EF-Tools"... 
Debug: Try getting config as list "core:userextensions" 
Debug: Try getting config "core:userextensions" 
Debug: Config "core:userextensions" = "["C:\\Users\\Iorhan\\AppData\\Roaming\\pyRevit Extensions","C:\\Users\\Iorhan\\AppData\\Roaming\\pyRevit\\Extensions"]" 
Debug: Normalizing "C:\Users\Iorhan\AppData\Roaming\pyRevit Extensions" 
Debug: Normalized as "C:\Users\Iorhan\AppData\Roaming\pyRevit Extensions" 
Debug: Verified extension search path "C:\Users\Iorhan\AppData\Roaming\pyRevit Extensions" 
Debug: Normalizing "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions" 
Debug: Normalized as "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions" 
Debug: Verified extension search path "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions" 
Debug: Config "core:userextensions" already set to "["C:\\Users\\Iorhan\\AppData\\Roaming\\pyRevit Extensions","C:\\Users\\Iorhan\\AppData\\Roaming\\pyRevit\\Extensions"]" 
Debug: Looking for installed extensions under "C:\Users\Iorhan\AppData\Roaming\pyRevit Extensions"... 
Debug: Found installed extension "C:\Users\Iorhan\AppData\Roaming\pyRevit Extensions\ZoneD.extension"... 
Debug: Looking for installed extensions under "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions"... 
Debug: Found installed extension "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions\pyApex.extension"... 
Debug: Looking up registered extension "pyApex"... 
Debug: Determining file or remote source "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json" 
Debug: Source is a remote resource "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json" 
Debug: Downloading remote resource "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json"... 
Debug: Downloading "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json" 
Debug: Parsing extension metadata file... 
Debug: Registered extension "PyRevitPlus" 
Debug: Registered extension "PyRevitMEP" 
Debug: Registered extension "pyApex" 
Debug: "pyApex" Matched registered extension "pyApex" 
Debug: Registered extension "Revitron" 
Debug: Registered extension "Revitron UI" 
Debug: Registered extension "pyStructure" 
Debug: Registered extension "MEPDesign" 
Debug: Registered extension "pyTiBa" 
Debug: Registered extension "EF-Tools" 
Debug: Registered extension "pyChilizer" 
Debug: Registered extension "pySSG" 
Debug: Registered extension "pyArchitect" 
Debug: Registered extension "Pam Building Design+" 
Debug: Registered extension "pyRevit-Autosave" 
Debug: Extension found "pyApex"... 
Debug: Found installed extension "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions\pyChilizer.extension"... 
Debug: Found installed extension "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions\pySSG.extension"... 
Debug: -----------> ZoneD 
Debug: -----------> pyApex 
Debug: -----------> pyChilizer 
Debug: -----------> pySSG 
Debug: Normalizing "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions\EF-Tools.extension" 
Debug: Normalized as "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions\EF-Tools.extension" 
Debug: Extension branch name determined as "main" 
Debug: Installing extension into "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions\EF-Tools.extension" 
Debug: Cloning "https://github.com/ErikFrits/EF-Tools:main" to "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions\EF-Tools.extension" 
Debug: Verifying repo validity "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions\EF-Tools.extension\" 
Debug: Clone successful "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions\EF-Tools.extension\" 
Debug: Normalizing "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions" 
Debug: Normalized as "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions" 
Debug: Adding extension search path "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions" 
Debug: Try getting config as list "core:userextensions" 
Debug: Try getting config "core:userextensions" 
Debug: Config "core:userextensions" = "["C:\\Users\\Iorhan\\AppData\\Roaming\\pyRevit Extensions","C:\\Users\\Iorhan\\AppData\\Roaming\\pyRevit\\Extensions"]" 
Debug: Normalizing "C:\Users\Iorhan\AppData\Roaming\pyRevit Extensions" 
Debug: Normalized as "C:\Users\Iorhan\AppData\Roaming\pyRevit Extensions" 
Debug: Verified extension search path "C:\Users\Iorhan\AppData\Roaming\pyRevit Extensions" 
Debug: Normalizing "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions" 
Debug: Normalized as "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions" 
Debug: Verified extension search path "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions" 
Debug: Config "core:userextensions" already set to "["C:\\Users\\Iorhan\\AppData\\Roaming\\pyRevit Extensions","C:\\Users\\Iorhan\\AppData\\Roaming\\pyRevit\\Extensions"]" 
Debug: Normalizing "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions" 
Debug: Normalized as "C:\Users\Iorhan\AppData\Roaming\pyRevit\Extensions" 
Debug: Updating config "core:userextensions = ["C:\\Users\\Iorhan\\AppData\\Roaming\\pyRevit Extensions","C:\\Users\\Iorhan\\AppData\\Roaming\\pyRevit\\Extensions","C:\\Users\\Iorhan\\AppData\\Roaming\\pyRevit\\Extensions"]" 
Debug: Saving config file "C:\Users\Iorhan\AppData\Roaming\pyRevit\pyRevit_config.ini" 

We are running a different version. I’ve installed the latest build from GitHub 5.0.1.25051+1239

Here’s the output of pyrevit -V, looks like we are on the same version unless I’m missing something else

PS C:\Users\TPJW> pyrevit -V
pyrevit v5.0.1.25051+1239.a19f9a76cf00d7256cf522f5ec874fea9dd0baa8
You have the latest version.

And just for the sake of trying again, i did copy/paste your command & only replace your username with mine & got the same issue:

PS C:\Users\TPJW> pyrevit extend ui EF-Tools https://github.com/ErikFrits/EF-Tools --dest=C:\Users\TPJW\AppData\Roaming\pyRevit\Extensions --branch=main --debug
--dest = C:\Users\TPJW\AppData\Roaming\pyRevit\Extensions
--branch = main
extend = True
<extension_name> = EF-Tools
ui = True
<repo_url> = https://github.com/ErikFrits/EF-Tools
Debug: Checking for all: wiki
Debug: Missing: wiki
Debug: Checking for all: blog
Debug: Missing: blog
Debug: Checking for all: docs
Debug: Missing: docs
Debug: Checking for all: source
Debug: Missing: source
Debug: Checking for all: youtube
Debug: Missing: youtube
Debug: Checking for all: support
Debug: Missing: support
Debug: Checking for all: env
Debug: Missing: env
Debug: Checking for all: update
Debug: Missing: update
Debug: Checking for all: clone
Debug: Missing: clone
Debug: Checking for all: clones
Debug: Missing: clones
Debug: Checking for all: attach
Debug: Missing: attach
Debug: Checking for all: detach
Debug: Missing: detach
Debug: Checking for all: attached
Debug: Missing: attached
Debug: Checking for all: switch
Debug: Missing: switch
Debug: Checking for all: extend
Debug: Checking for any: ui,lib
Debug: Matching: ui
Debug: Looking up installed extension "EF-Tools"...
Debug: Try getting config as list "core:userextensions"
Debug: Try getting config "core:userextensions"
Debug: Config "core:userextensions" = "["C:\\pyRevit\\Extensions"]"
Debug: Normalizing "C:\pyRevit\Extensions"
Debug: Normalized as "C:\pyRevit\Extensions"
Debug: Verified extension search path "C:\pyRevit\Extensions"
Debug: Config "core:userextensions" already set to "["C:\\pyRevit\\Extensions"]"
Debug: Looking for installed extensions under "C:\pyRevit\Extensions"...
Debug: Found installed extension "C:\pyRevit\Extensions\PyRevitPlus.extension"...
Debug: Looking up registered extension "PyRevitPlus"...
Debug: Determining file or remote source "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json"
Debug: Source is a remote resource "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json"
Debug: Downloading remote resource "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json"...
Debug: Downloading "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json"
Debug: Parsing extension metadata file...
Debug: Registered extension "PyRevitPlus"
Debug: "PyRevitPlus" Matched registered extension "PyRevitPlus"
Debug: Registered extension "PyRevitMEP"
Debug: Registered extension "pyApex"
Debug: Registered extension "Revitron"
Debug: Registered extension "Revitron UI"
Debug: Registered extension "pyStructure"
Debug: Registered extension "MEPDesign"
Debug: Registered extension "pyTiBa"
Debug: Registered extension "EF-Tools"
Debug: Registered extension "pyChilizer"
Debug: Registered extension "pySSG"
Debug: Registered extension "pyArchitect"
Debug: Registered extension "Pam Building Design+"
Debug: Registered extension "pyRevit-Autosave"
Debug: Extension found "PyRevitPlus"...
Debug: Found installed extension "C:\pyRevit\Extensions\myTools.extension"...
Debug: Looking up registered extension "myTools"...
Debug: Determining file or remote source "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json"
Debug: Source is a remote resource "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json"
Debug: Downloading remote resource "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json"...
Debug: Downloading "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json"
Debug: Parsing extension metadata file...
Debug: Registered extension "PyRevitPlus"
Debug: Registered extension "PyRevitMEP"
Debug: Registered extension "pyApex"
Debug: Registered extension "Revitron"
Debug: Registered extension "Revitron UI"
Debug: Registered extension "pyStructure"
Debug: Registered extension "MEPDesign"
Debug: Registered extension "pyTiBa"
Debug: Registered extension "EF-Tools"
Debug: Registered extension "pyChilizer"
Debug: Registered extension "pySSG"
Debug: Registered extension "pyArchitect"
Debug: Registered extension "Pam Building Design+"
Debug: Registered extension "pyRevit-Autosave"
Debug: Try getting config as list "environment:sources"
Debug: Try getting config "environment:sources"
Debug: Config "environment:sources" not set.
Debug: Found installed extension "C:\pyRevit\Extensions\myToolsELEC.extension"...
Debug: Looking up registered extension "myToolsELEC"...
Debug: Determining file or remote source "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json"
Debug: Source is a remote resource "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json"
Debug: Downloading remote resource "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json"...
Debug: Downloading "https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json"
Debug: Parsing extension metadata file...
Debug: Registered extension "PyRevitPlus"
Debug: Registered extension "PyRevitMEP"
Debug: Registered extension "pyApex"
Debug: Registered extension "Revitron"
Debug: Registered extension "Revitron UI"
Debug: Registered extension "pyStructure"
Debug: Registered extension "MEPDesign"
Debug: Registered extension "pyTiBa"
Debug: Registered extension "EF-Tools"
Debug: Registered extension "pyChilizer"
Debug: Registered extension "pySSG"
Debug: Registered extension "pyArchitect"
Debug: Registered extension "Pam Building Design+"
Debug: Registered extension "pyRevit-Autosave"
Debug: Try getting config as list "environment:sources"
Debug: Try getting config "environment:sources"
Debug: Config "environment:sources" not set.
Debug: -----------> PyRevitPlus
Debug: -----------> myTools
Debug: -----------> myToolsELEC
Debug: Normalizing "C:\Users\TPJW\AppData\Roaming\pyRevit\Extensions\EF-Tools.extension"
Debug: Normalized as "C:\Users\TPJW\AppData\Roaming\pyRevit\Extensions\EF-Tools.extension"
Debug: Extension branch name determined as "main"
Debug: Installing extension into "C:\Users\TPJW\AppData\Roaming\pyRevit\Extensions\EF-Tools.extension"
Debug: Cloning "https://github.com/ErikFrits/EF-Tools:main" to "C:\Users\TPJW\AppData\Roaming\pyRevit\Extensions\EF-Tools.extension"
Error: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. (pyRevitLabs.Common.PyRevitException)
   at pyRevitLabs.Common.GitInstaller.Clone(String repoPath, String branchName, String destPath, GitInstallerCredentials creds, Boolean checkout)
   at pyRevitLabs.PyRevit.PyRevitExtensions.InstallExtension(String extensionName, PyRevitExtensionTypes extensionType, String repoPath, String destPath, String branchName, GitInstallerCredentials credentials)
   at pyRevitCLI.PyRevitCLIExtensionCmds.Extend(Boolean ui, Boolean lib, String extName, String destPath, String repoUrl, String branchName, GitInstallerCredentials credentials)
   at pyRevitCLI.PyRevitCLI.ProcessArguments()
   at pyRevitCLI.PyRevitCLI.Main(String[] args)
PS C:\Users\TPJW>

Gah! Trying everything to no avail :frowning:

Since the issue is company wide across all devices at the moment, but seems to maybe be isolated, or at least not universal since @iorhanV is able to extend extensions, I tried to install EF-Tools with a fresh install of the CLI on my own personal hardware on my own network in case it was a firewall thing getting in the way. Unfortunately I’m still getting the same LibGit2Sharp even when I’m not using company hardware/network so I can’t isolate the issue to something internal.

As a sanity check - I reverted my CLI to pyrevit v4.8.16.24121+2117.23a0b8cbc4babdeb29a0611e159d017bbe9cbad5 and it was able to extend extensions just fine

Changed my cli to pyrevit v5.0.0.25034+1521.5254fce169ea7164f9452751d9c91c580e45ef5b and it worked! seems like the issue is isolated to version V5.0.1

@sanzoghenzo it looks like what you pointed earlier this week