pyrevitlabs / pyRevit

Rapid Application Development (RAD) Environment for Autodesk Revit®
http://wiki.pyrevitlabs.io
GNU General Public License v3.0
1.3k stars 331 forks source link

[Bug]: Error during update (Any help with what this means and if i need to fix something on my end) #2412

Open virtdesign17 opened 1 week ago

virtdesign17 commented 1 week ago

✈ Pre-Flight checks

🐞 Describe the bug

Hi everyone I was just installing the latest update, currently running revit24. Received the code below, I would have know idea what it means, any help would be greatly appreciated.

⌨ Error/Debug Message



INFO [pyrevit.versionmgr.updater] Checking internet connection... 

INFO [pyrevit.versionmgr.updater]  Successfully updated: EF-Tools.extension to d32ee52 

INFO [pyrevit.versionmgr.updater]  Successfully updated: pyApex.extension to 450ab1d 

INFO [pyrevit.versionmgr.updater]  Successfully updated: pyArchitect.extension to 1e893d5 

INFO [pyrevit.versionmgr.updater]  Successfully updated: pyChilizer.extension to 5872a26 

INFO [pyrevit.versionmgr.updater]  Successfully updated: PyRevitPlus.extension to 121799d 

INFO [pyrevit.versionmgr.updater]  Successfully updated: pyStructure.extension to 976342f 

INFO [pyrevit.versionmgr.updater]  Successfully updated: pyTiBa.extension to 44950a9 

INFO [pyrevit.loader.sessionmgr] Reloading.... 

IronPython Traceback:
Traceback (most recent call last):
 File "C:\Users\VDMBIM\AppData\Roaming\pyRevit-Master\extensions\pyRevitCore.extension\pyRevit.tab\pyRevit.panel\Update.smartbutton\script.py", line 32, in <module>
 File "C:\Users\VDMBIM\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\versionmgr\updater.py", line 258, in update_pyrevit
 File "C:\Users\VDMBIM\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py", line 327, in reload_pyrevit
 File "C:\Users\VDMBIM\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py", line 285, in load_session
 File "C:\Users\VDMBIM\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py", line 105, in _perform_onsessionloadstart_ops
 File "C:\Users\VDMBIM\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py", line 57, in _clear_running_engines
StandardError: Exception has been thrown by the target of an invocation.

Script Executor Traceback:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Stream was not writable.
 at System.IO.StreamWriter..ctor(Stream stream, Encoding encoding, Int32 bufferSize, Boolean leaveOpen)
 at System.IO.StreamWriter..ctor(Stream stream, Encoding encoding)
 at Microsoft.Scripting.Hosting.ScriptIO.SetOutput(Stream stream, Encoding encoding)
 at PyRevitLabs.PyRevit.Runtime.IronPythonEngine.CleanupStreams()
 --- End of inner exception stack trace ---
 at Microsoft.Scripting.Runtime.LightExceptions.ThrowException(LightException lightEx)
 at Microsoft.Scripting.Runtime.LightExceptions.CheckAndThrow(Object value)
 at Microsoft.Scripting.Interpreter.FuncCallInstruction`2.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.HandleException(InterpretedFrame frame, Exception exception)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
 at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
 at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
 at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
 at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
 at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
 at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
 at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
 at update_pyrevit$2169(Closure , PythonFunction )
 at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
 at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
 at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
 at PyRevitLabs.PyRevit.Runtime.IronPythonEngine.Execute(ScriptRuntime& runtime)

♻️ To Reproduce

Clicked on update Received error

⏲️ Expected behavior

Install latest update

🖥️ Hardware and Software Setup (please complete the following information)

Microsoft Windows [Version 10.0.22631.4317]
(c) Microsoft Corporation. All rights reserved.

C:\Users\VDMBIM>pyrevit env
==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
master | Deploy: "basepublic" | Branch: "master" | Version: "4.8.13.23182+2215" | Path: "C:\Users\VDMBIM\AppData\Roaming\pyRevit-Master"
==> Attachments
master | Product: "Autodesk Revit 2024" | Engine: IPY277 (277) | Path: "C:\Users\VDMBIM\AppData\Roaming\pyRevit-Master" | AllUsers
==> Installed Extensions
EF-Tools | Type: UIExtension | Repo: "https://github.com/ErikFrits/EF-Tools.git" | Installed: "S:\16_Pyrevit\EF-Tools.extension"
MyTool | Type: Unknown | Repo: "" | Installed: "S:\16_Pyrevit\MyTool.extension"
pyApex | Type: UIExtension | Repo: "https://github.com/apex-project/pyApex.git" | Installed: "S:\16_Pyrevit\pyApex.extension"
pyArchitect | Type: UIExtension | Repo: "https://github.com/romangolev/pyArchitect.git" | Installed: "S:\16_Pyrevit\pyArchitect.extension"
pyChilizer | Type: UIExtension | Repo: "https://github.com/dnenov/pyChilizer" | Installed: "S:\16_Pyrevit\pyChilizer.extension"
PyRevitPlus | Type: UIExtension | Repo: "https://github.com/gtalarico/pyrevitplus.git" | Installed: "S:\16_Pyrevit\PyRevitPlus.extension"
pySSG | Type: UIExtension | Repo: "https://github.com/kbruxvoort/SSG.extension.git" | Installed: "S:\16_Pyrevit\pySSG.extension"
pyStructure | Type: UIExtension | Repo: "https://github.com/sampy23/pyStruct.extension" | Installed: "S:\16_Pyrevit\pyStructure.extension"
pyTiBa | Type: UIExtension | Repo: "https://github.com/tillbaum/pytiba.git" | Installed: "S:\16_Pyrevit\pyTiBa.extension"
VDMBIM | Type: Unknown | Repo: "" | Installed: "S:\16_Pyrevit\VDMBIM.extension"
==> Default Extension Search Path
C:\Users\VDMBIM\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
S:\16_Pyrevit
==> Extension Sources - Default
https://github.com/eirannejad/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
Autodesk Revit 2024 | Version: 24.3.0.13 | Build: 20240912_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2024\"
==> Running Revit Instances
Error: Object reference not set to an instance of an object.
Run with "--debug" option to see debug messages

Additional context

No response

sanzoghenzo commented 1 week ago

Hi @virtdesign17, Pyrevit has been updated, but the function that reloads the python engine incurred in an error. I believe a Revit restart is enough, but we should check this and make it more robust.

virtdesign17 commented 1 week ago

Hi Mate

Thanks for getting back to me, I've just tried that out and received this now , which i believe could be the same error.

INFO [pyrevit.versionmgr.updater] Checking internet connection...
INFO [pyrevit.versionmgr.updater]  Successfully updated: EF-Tools.extension to d32ee52
INFO [pyrevit.versionmgr.updater]  Successfully updated: pyApex.extension to 450ab1d
INFO [pyrevit.versionmgr.updater]  Successfully updated: pyArchitect.extension to 1e893d5
INFO [pyrevit.versionmgr.updater]  Successfully updated: pyChilizer.extension to 5872a26
INFO [pyrevit.versionmgr.updater]  Successfully updated: PyRevitPlus.extension to 121799d
INFO [pyrevit.versionmgr.updater]  Successfully updated: pyStructure.extension to 976342f
INFO [pyrevit.versionmgr.updater]  Successfully updated: pyTiBa.extension to 44950a9
INFO [pyrevit.loader.sessionmgr] Reloading....

IronPython Traceback:
Traceback (most recent call last):
 File "C:\Users\VDMBIM\AppData\Roaming\pyRevit-Master\extensions\pyRevitCore.extension\pyRevit.tab\pyRevit.panel\Update.smartbutton\script.py", line 32, in <module>
 File "C:\Users\VDMBIM\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\versionmgr\updater.py", line 258, in update_pyrevit
 File "C:\Users\VDMBIM\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py", line 327, in reload_pyrevit
 File "C:\Users\VDMBIM\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py", line 285, in load_session
 File "C:\Users\VDMBIM\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py", line 105, in _perform_onsessionloadstart_ops
 File "C:\Users\VDMBIM\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py", line 57, in _clear_running_engines
StandardError: Exception has been thrown by the target of an invocation.

Script Executor Traceback:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Stream was not writable.
 at System.IO.StreamWriter..ctor(Stream stream, Encoding encoding, Int32 bufferSize, Boolean leaveOpen)
 at System.IO.StreamWriter..ctor(Stream stream, Encoding encoding)
 at Microsoft.Scripting.Hosting.ScriptIO.SetOutput(Stream stream, Encoding encoding)
 at PyRevitLabs.PyRevit.Runtime.IronPythonEngine.CleanupStreams()
 --- End of inner exception stack trace ---
 at Microsoft.Scripting.Runtime.LightExceptions.ThrowException(LightException lightEx)
 at Microsoft.Scripting.Runtime.LightExceptions.CheckAndThrow(Object value)
 at Microsoft.Scripting.Interpreter.FuncCallInstruction`2.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.HandleException(InterpretedFrame frame, Exception exception)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
 at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
 at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
 at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
 at update_pyrevit$2169(Closure , PythonFunction )
 at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
 at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
 at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
 at PyRevitLabs.PyRevit.Runtime.IronPythonEngine.Execute(ScriptRuntime& runtime)
sanzoghenzo commented 6 days ago

Didn't pyrevit update itself? The messages tell that the extension were updated, and the error is thrown while trying to reload the python engines. A pyrevit restart doesn’t get rid of the error, but you should have an updated pyrevit (so no need to retry the update). Is it not?

virtdesign17 commented 3 days ago

No it just said that message i last sent again

[cid:5f4b3c0e-f844-436c-9733-0a79a70573c8]

Building Designs / Interior Designs / BIM Consulting

JAD NEWMAN

DIRECTOR

P:0407 705 141

E: @.**@.>

W:www.vdmbim.com.au


From: Andrea Ghensi @.> Sent: Thursday, 10 October 2024 5:01 PM To: pyrevitlabs/pyRevit @.> Cc: virtdesign17 @.>; Mention @.> Subject: Re: [pyrevitlabs/pyRevit] [Bug]: Error during update (Any help with what this means and if i need to fix something on my end) (Issue #2412)

Didn't pyrevit update itself? The messages tell that the extension were updated, and the error is thrown while trying to reload the python engines. A pyrevit restart doesn’t get rid of the error, but you should have an updated pyrevit (so no need to retry the update). Is it not?

— Reply to this email directly, view it on GitHubhttps://github.com/pyrevitlabs/pyRevit/issues/2412#issuecomment-2404105245, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BEQTZUOF24LR4IVDH4YIUDDZ2YJ2XAVCNFSM6AAAAABPTP6QF6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBUGEYDKMRUGU. You are receiving this because you were mentioned.Message ID: @.***>

sanzoghenzo commented 2 days ago

Please note that, as stated here, the "Update" button only updates pyRevit extensions, not pyRevit itself. For it, you need to download and run the installer.