pyRevit icon indicating copy to clipboard operation
pyRevit copied to clipboard

Load Error

Open HamezMM opened this issue 3 years ago • 15 comments

Describe the bug PyRevit installation causes Revit to crash on startup. PyRevit tab does not show on the ribbon in the loading screen. There is no ability to interrupt Revit's load sequence.

To Reproduce

  1. Start a clean install of PyRevit
  2. Open Revit
  3. Select " Always load" when prompted to load PyRevit upon startup
  4. Revit crashes

Expected behavior I expected revit to startup and load PyRevit properly.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10
  • pyRevit 4.8.9.22004+1713-wip
  • pyRevit Environment:
C:\Users\JamesMckinnon>pyrevit env
==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
master | Deploy: "basepublic" | Branch: "master" | Version: "4.8.9.22004+1713-wip" | Path: "C:\Users\JamesMckinnon\AppData\Roaming\pyRevit-Master"
==> Attachments
master | Product: "2022.1" | Engine: IPY277 (277) | Path: "C:\Users\JamesMckinnon\AppData\Roaming\pyRevit-Master"
master | Product: "Autodesk Revit 2021" | Engine: IPY277 (277) | Path: "C:\Users\JamesMckinnon\AppData\Roaming\pyRevit-Master"
==> Installed Extensions
==> Default Extension Search Path
C:\Users\JamesMckinnon\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
==> Extension Sources - Default
https://github.com/eirannejad/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
2022.1 | Version: 22.1.1.516 | Build: 20210921_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2022\"
Autodesk Revit 2021 | Version: 21.1.21.45 | Build: 20201116_1100(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2021\"
==> Running Revit Instances
==> User Environment
Microsoft Windows 10 [Version 10.0.19043]
Executing User: AzureAD\JamesMckinnon
Active User: AzureAD\JamesMckinnon
Admin Access: No
%APPDATA%: "C:\Users\JamesMckinnon\AppData\Roaming"
Latest Installed .Net Framework: 4.8
No .Net Target Packs are installed.
No .Ne-Core Target Packs are installed.
pyRevit CLI v4.8.9.22004+1713-wip

Additional context This error has also occured with version 4.8.9, non WIP version.

HamezMM avatar Jan 05 '22 18:01 HamezMM

Which Revit version?

eirannejad avatar Jan 07 '22 08:01 eirannejad

The error occurs for both Revit 2021 and Revit 2022.

Uninstalling PyRevit without disabling the add-in does not resolve the error. The only quick resolution I have found is disabling PyRevit using the Stantec Revit add-in manager.

HamezMM avatar Jan 07 '22 15:01 HamezMM

Would you mind sending me ALL the *.log files in %APPDATA%/pyRevit/2021 and %APPDATA%/pyRevit/2022

eirannejad avatar Jan 07 '22 18:01 eirannejad

The following files below are the two logs present within the folders:

pyRevit_2021_36adc1423c73aaae_PyRevitLabs.PyRevit.Runtime.log

pyRevit_2022_36adc1423c73aaae_PyRevitLabs.PyRevit.Runtime.log

HamezMM avatar Jan 07 '22 18:01 HamezMM

@HamezMM I pushed a fix and the WIP installers are here: https://github.com/eirannejad/pyRevit/actions/runs/1669963623 Would you mind installing and see if it loads with Revit?

The problem seems to be related to System.Web dll that was being loaded for the x86 architecture. I had the same warning on my machine but it was not throwing any issues.

eirannejad avatar Jan 08 '22 00:01 eirannejad

@eirannejad I uninstalled PyRevit and did a clean install on my machine after restarting. The same bug is persisting with the 4.8.9.22008+0042 WIP build when loading Revit 2022.1. Upon loading Revit 2021.1.2 there was no crash but PyRevit did not appear on the ribbon and was not accessible through the keyboard shortcut dialogue window.

Futhermore, I could not find the same log files in the PyRevit folder as before.

HamezMM avatar Jan 08 '22 21:01 HamezMM

Okay so pyRevit is not properly attached. Let's open a command prompt, type pyrevit env, and share the results please

eirannejad avatar Jan 09 '22 00:01 eirannejad

Here are the results from checking the PyRevit env

:\Users\JamesMckinnon>pyrevit env ==> Registered Clones (full git repos) ==> Registered Clones (deployed from archive/image) master | Deploy: "basepublic" | Branch: "master" | Version: "4.8.9.22008+0042-wip" | Path: "C:\Users\JamesMckinnon\AppData\Roaming\pyRevit-Master" ==> Attachments ==> Installed Extensions ==> Default Extension Search Path C:\Users\JamesMckinnon\AppData\Roaming\pyRevit\Extensions ==> Extension Search Paths ==> Extension Sources - Default https://github.com/eirannejad/pyRevit/raw/master/extensions/extensions.json ==> Extension Sources - Additional ==> Installed Revits 2022.1 | Version: 22.1.1.516 | Build: 20210921_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2022" Autodesk Revit 2021 | Version: 21.1.21.45 | Build: 20201116_1100(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2021" ==> Running Revit Instances Error: Object reference not set to an instance of an object. Run with "--debug" option to see debug messages

C:\Users\JamesMckinnon>

HamezMM avatar Jan 10 '22 15:01 HamezMM

Okay now run pyrevit attach master 277 --installed This should attach pyRevit to Revit 2021 and 2022

eirannejad avatar Jan 10 '22 23:01 eirannejad

Running into the same issue after reinstalling pyRevit (4.8.9.22008+0042-wip and running the above command. Here are my results from "pyRevit env":

==> Registered Clones (full git repos) ==> Registered Clones (deployed from archive/image) master | Deploy: "basepublic" | Branch: "master" | Version: "4.8.9.22008+0042-wip" | Path: "C:\Users\rspeicher\AppData\Roaming\pyRevit-Master" ==> Attachments master | Product: "2022.1.1" | Engine: IPY277 (277) | Path: "C:\Users\rspeicher\AppData\Roaming\pyRevit-Master" master | Product: "2021.1.5" | Engine: IPY277 (277) | Path: "C:\Users\rspeicher\AppData\Roaming\pyRevit-Master" master | Product: "2020.2.6" | Engine: IPY277 (277) | Path: "C:\Users\rspeicher\AppData\Roaming\pyRevit-Master" master | Product: "2019.2.4" | Engine: IPY277 (277) | Path: "C:\Users\rspeicher\AppData\Roaming\pyRevit-Master" ==> Installed Extensions ==> Default Extension Search Path C:\Users\rspeicher\AppData\Roaming\pyRevit\Extensions ==> Extension Search Paths ==> Extension Sources - Default https://github.com/eirannejad/pyRevit/raw/master/extensions/extensions.json ==> Extension Sources - Additional ==> Installed Revits 2022.1.1 | Version: 22.1.10.541 | Build: 20211103_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2022" 2021.1.5 | Version: 21.1.50.27 | Build: 20211018_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2021" 2020.2.6 | Version: 20.2.60.15 | Build: 20211019_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2020" 2019.2.4 | Version: 19.2.40.15 | Build: 20211029_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2019" ==> Running Revit Instances ==> User Environment Microsoft Windows 10 [Version 10.0.19042] Executing User: WMF\rspeicher Active User: WMF\rspeicher Admin Access: No %APPDATA%: "C:\Users\rspeicher\AppData\Roaming" Latest Installed .Net Framework: 4.8 No .Net Target Packs are installed. No .Ne-Core Target Packs are installed. pyRevit CLI v4.8.9.22008+0042-wip

Please note that this instance is running on a virtual platform hosted on VMware, if that makes a difference.

RichSpeicher avatar Jan 20 '22 17:01 RichSpeicher

Sorry for the late response, running the "pyrevit attach master 277 --installed" command has not resolved the error.

HamezMM avatar Feb 22 '22 19:02 HamezMM

The following is my current version and environment setup in the command prompt:

C:\Users\JamesMckinnon>pyrevit -V pyrevit v4.8.10.22040+1743 Missing authorization token. Set on GITHUBTOKEN env var

C:\Users\JamesMckinnon>pyrevit env ==> Registered Clones (full git repos) ==> Registered Clones (deployed from archive/image) master | Deploy: "basepublic" | Branch: "master" | Version: "4.8.9.22008+0042-wip" | Path: "C:\Users\JamesMckinnon\AppData\Roaming\pyRevit-Master" ==> Attachments master | Product: "2022.1" | Engine: IPY277 (277) | Path: "C:\Users\JamesMckinnon\AppData\Roaming\pyRevit-Master" master | Product: "Autodesk Revit 2021" | Engine: IPY277 (277) | Path: "C:\Users\JamesMckinnon\AppData\Roaming\pyRevit-Master" ==> Installed Extensions ==> Default Extension Search Path C:\Users\JamesMckinnon\AppData\Roaming\pyRevit\Extensions ==> Extension Search Paths ==> Extension Sources - Default https://github.com/eirannejad/pyRevit/raw/master/extensions/extensions.json ==> Extension Sources - Additional ==> Installed Revits 2022.1 | Version: 22.1.1.516 | Build: 20210921_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2022" Autodesk Revit 2021 | Version: 21.1.21.45 | Build: 20201116_1100(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2021" ==> Running Revit Instances ==> User Environment Microsoft Windows 10 [Version 10.0.19043] Executing User: AzureAD\JamesMckinnon Active User: AzureAD\JamesMckinnon Admin Access: No %APPDATA%: "C:\Users\JamesMckinnon\AppData\Roaming" Latest Installed .Net Framework: 4.8 No .Net Target Packs are installed. No .Ne-Core Target Packs are installed. pyRevit CLI v4.8.10.22040+1743

HamezMM avatar Feb 22 '22 19:02 HamezMM

I started digging through the Revit log files and found where the API failed to load. Upon googling the error I found that in issue #1055 ChrisCrosley had the exact same log result as I had. Our IT provider uses SentinelOne for their endpoints. I have reached out to our IT to request that Revit and PyRevit get whitelisted on SentinelOne. I will update once this gets dealt with.

HamezMM avatar Feb 22 '22 20:02 HamezMM

@HamezMM - Excellent sleuthing on your part! White listing pyRevit and the Revit(s) solved the issue. Thanks!

RichSpeicher avatar Feb 23 '22 16:02 RichSpeicher

Hi All, installing the latest files that Ehsan refered to helped me fix the issue with Revit 2020. Thanks @eirannejad image

AminShahkaram avatar Mar 14 '22 03:03 AminShahkaram

@HamezMM - Excellent sleuthing on your part! White listing pyRevit and the Revit(s) solved the issue. Thanks!

Hi I have the same problem here, can you show us which folders you whitelisted please?

tjxme avatar Mar 27 '23 14:03 tjxme