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

[Bug]: pyRevit_config.ini is being used by another process #2512

Open
5 tasks done
archeduardo5 opened this issue Jan 12, 2025 · 3 comments
Open
5 tasks done

[Bug]: pyRevit_config.ini is being used by another process #2512

archeduardo5 opened this issue Jan 12, 2025 · 3 comments
Labels
Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class]

Comments

@archeduardo5
Copy link

✈ Pre-Flight checks

  • I don't have SentinelOne antivirus installed (see above for the solution)
  • I have searched in the issues (open and closed) but couldn't find a similar issue
  • I have searched in the pyRevit Forum for similar issues
  • I already followed the installation troubleshooting guide thoroughly
  • I am using the latest pyRevit Version

🐞 Describe the bug

PyRevit is unable to load due to a file access conflict with the configuration file. When launching Revit, pyRevit throws an IOError indicating that the pyRevit_config.ini file is being used by another process and cannot be accessed.

This happens on every Revit startup attempt and prevents pyRevit from loading properly. The error occurs specifically with the configuration file located at:
C:\Users[username]\AppData\Roaming\pyRevit\pyRevit_config.ini

The error prevents PyRevit from initializing and loading any of its tools or functions. This appears to be a file locking issue where the configuration file is either:

  1. Locked by another process
  2. Has incorrect permissions
  3. Is being accessed simultaneously by multiple processes

⌨ Error/Debug Message

IronPython Traceback:
Traceback (most recent call last):
  File "C:\Program Files\pyRevit-Master\bin\engines\pyRevitLoader.py", line 33, in <module>
  File "C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\loader\sessionmgr.py", line 267, in load_session
  File "C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\loader\sessioninfo.py", line 49, in setup_runtime_vars
  File "C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\userconfig.py", line 689, in get_current_attachment
IOError: [Errno 32] The process cannot access the file 'C:\Users\arch1\AppData\Roaming\pyRevit\pyRevit_config.ini' because it is being used by another process.

Script Executor Traceback:
System.IO.IOException: The process cannot access the file 'C:\Users\arch1\AppData\Roaming\pyRevit\pyRevit_config.ini' because it is being used by another process.
   at Microsoft.Scripting.Runtime.LightExceptions.ThrowException(LightException lightEx)
   at Microsoft.Scripting.Runtime.LightExceptions.CheckAndThrow(Object value)
   [resto del traceback...]

♻️ To Reproduce

  1. Start Revit
  2. Wait for pyRevit to initialize
  3. Error message appears indicating inability to access pyRevit_config.ini
  4. The error consistently appears on every Revit startup
  5. PyRevit fails to load completely

⏲️ Expected behavior

PyRevit should load normally on Revit startup without any file access errors. The configuration file should be accessible and allow PyRevit to initialize properly with all its tools and functions available.

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

C:\Windows\System32>pyrevit env
==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
master | Deploy: "basepublic" | Branch: "master" | Version: "4.8.15.24089+0912" | Path: "C:\Program Files\pyRevit-Master"
==> Attachments
master | Product: "Autodesk Revit 2025" | Engine: DEFAULT (2711) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
master | Product: "Autodesk Revit 2024" | Engine: DEFAULT (2711) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
==> Installed Extensions
==> Default Extension Search Path
C:\Users\archl\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
Autodesk Revit 2025 | Version: 25.4.0.32 | Build: 20241202_1040(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2025\"
Autodesk Revit 2024 | Version: 24.3.10.22 | Build: 20241105_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2024\"
==> Running Revit Instances
Error: Referencia a objeto no establecida como instancia de un objeto.
Run with "--debug" option to see debug messages

Additional context

  • The error occurs in a fresh installation of pyRevit
  • No antivirus software is blocking the file access
  • All Revit processes have been checked in Task Manager to ensure no conflicting processes
  • The config file location has been verified to have proper read/write permissions
  • Previous attempts to resolve:
    • Restarted Revit
    • Checked file permissions
    • Verified no other processes are locking the file
    • Attempted to create a new config file
@archeduardo5 archeduardo5 added the Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] label Jan 12, 2025
@sanzoghenzo
Copy link
Contributor

Hi @archeduardo5 , thanks for the detailed description of your issue.
Unfortunately, this seems like the exact same error of #2463 , that (as of now) is just 5 items down the list of the open issues... but from your description it seems that you're not using multiple Revit copies...

Can you confirm that there are no other revit revit apps or processes opened while this error occur?
Have you already tried to restart the computer (I see that you verified that the file is not locked, but a reboot solves many things in mysterious ways 😅 )?

A complete overhaul of the settings management has started in #2482 that should solve this issue.

In the meantime, do you need pyRevit to be installed as administrator/ for all users? Or can you try to uninstall it and use the single user install and try to see if it works?

@sanzoghenzo sanzoghenzo changed the title [Bug]: ### Description PyRevitLoader is unable to access the configuration file due to a file access conflict. The error indicates that the file 'C:\Users\[user]\AppData\Roaming\pyRevit\pyRevit_config.ini' is being used by another process. ### Error Message [Bug]: pyRevit_config.ini is being used by another process Jan 12, 2025
@jmcouffin
Copy link
Contributor

jmcouffin commented Jan 12, 2025

Got to add to this, you are using a 2+ years old version.
That might help to use the latest release a wip installer

@archeduardo5
Copy link
Author

Hi @sanzoghenzo @jmcouffin

Thank you for the follow-up. I managed to resolve the issue by performing a clean installation as a single user and updating to the latest version, as you suggested.

Thank you for keeping PyRevit updated! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class]
Projects
None yet
Development

No branches or pull requests

3 participants