Addon Manager freezes FreeCAD up

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Olav
Posts: 211
Joined: Sun Nov 27, 2016 7:58 pm
Location: Netherlands

Addon Manager freezes FreeCAD up

Post by Olav »

Hello, I am compiling FreeCAD on Xubuntu 22.04 according to these instructions:

https://wiki.freecadweb.org/Compile_on_Linux

Compilation is successful and as far as I can see, FreeCAD generally works like it should.

Except when I try to use the Addon Manager, it never goes further than "Downloaded icon for frame", like in this screenshot:

Addon Manager_001.png
Addon Manager_001.png (78.25 KiB) Viewed 1181 times

It's always at this exact point that FreeCAD becomes unresponsive and must be killed. When started from a terminal, these are the messages:

Code: Select all

olav@pc-olav:/opt/freecad/bin$ ./FreeCAD
FreeCAD 0.21, Libs: 0.21R30509 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2022
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

connect failed: Bestand of map bestaat niet
pip took longer than 30 seconds to return results, giving up on itTraceback (most recent call last):
  File "/opt/freecad/Mod/AddonManager/manage_python_dependencies.py", line 54, in run
    if check_for_python_package_updates():
  File "/opt/freecad/Mod/AddonManager/manage_python_dependencies.py", line 64, in check_for_python_package_updates
    outdated_packages_stdout = call_pip(["list", "-o", "--path", vendor_path])
  File "/opt/freecad/Mod/AddonManager/manage_python_dependencies.py", line 112, in call_pip
    raise Exception(proc.stderr.decode())
UnboundLocalError: local variable 'proc' referenced before assignment
The message "connect failed: No such file or directory" appears immediately on start of the program.

The message "pip took longer than 30 seconds to return results, giving up on it" and everything after that appears exactly when FreeCAD freezes.

I have searched and found another reference here:

https://forum.freecadweb.org/viewtopic.php?t=72176

However I'm not sure how the fix that is proposed there would address this issue. What advice can you give me? Did I miss some dependency? Thanks in advance!

Also here's my "About" info:

Code: Select all

OS: Ubuntu 22.04.1 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.21.30509 (Git)
Build type: Unknown
Branch: master
Hash: 8a77ea8c989550566246d37916affe7c4c0dc351
Python 3.10.6, Qt 5.15.3, Coin 4.0.0, Vtk 7.1.1, OCC 7.5.2
Locale: Dutch/Netherlands (nl_NL)
User avatar
chennes
Veteran
Posts: 3904
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon Manager freezes FreeCAD up

Post by chennes »

Sorry about that -- I wrote the fix but never pushed it! It's uploaded now: git commit 9b4183581f
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Olav
Posts: 211
Joined: Sun Nov 27, 2016 7:58 pm
Location: Netherlands

Re: Addon Manager freezes FreeCAD up

Post by Olav »

chennes wrote: Mon Oct 03, 2022 5:55 pm Sorry about that -- I wrote the fix but never pushed it! It's uploaded now: git commit 9b4183581f
Thank you for your reply. I just updated and recompiled the whole thing and I can see your changes in the manage_python_dependencies.py file. The problem remains exactly the same as before though, I see no change in behaviour. Again after "Downloaded icon for frame" the program just freezes up and the same message appears in the terminal. Anything I can do to help diagnose this better?

Code: Select all

OS: Ubuntu 22.04.1 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.21.30522 (Git)
Build type: Unknown
Branch: master
Hash: 26aaf0af451e0af91ffd9d43128f902e854a00c3
Python 3.10.6, Qt 5.15.3, Coin 4.0.0, Vtk 7.1.1, OCC 7.5.2
Locale: Dutch/Netherlands (nl_NL)
User avatar
chennes
Veteran
Posts: 3904
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon Manager freezes FreeCAD up

Post by chennes »

Can you double-check the line numbers in the new error message? They shouldn't be the same, the code has moved around some.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Olav
Posts: 211
Joined: Sun Nov 27, 2016 7:58 pm
Location: Netherlands

Re: Addon Manager freezes FreeCAD up

Post by Olav »

chennes wrote: Mon Oct 03, 2022 8:45 pm Can you double-check the line numbers in the new error message? They shouldn't be the same, the code has moved around some.
I was wrong where I said that the problem was exactly the same after the update! Here's what appears to be the relevant output from the terminal, it's actually slightly different than before:

Code: Select all

pip took longer than 30 seconds to return results, giving up on itTraceback (most recent call last):
  File "/opt/freecad/Mod/AddonManager/manage_python_dependencies.py", line 54, in run
    if check_for_python_package_updates():
  File "/opt/freecad/Mod/AddonManager/manage_python_dependencies.py", line 64, in check_for_python_package_updates
    outdated_packages_stdout = call_pip(["list", "-o", "--path", vendor_path])
  File "/opt/freecad/Mod/AddonManager/manage_python_dependencies.py", line 113, in call_pip
    raise Exception("pip timed out")
Exception: pip timed out
I hope this helps.
User avatar
chennes
Veteran
Posts: 3904
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon Manager freezes FreeCAD up

Post by chennes »

Great, that's one step forward anyway. But FreeCAD is still freezing after printing that error?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Olav
Posts: 211
Joined: Sun Nov 27, 2016 7:58 pm
Location: Netherlands

Re: Addon Manager freezes FreeCAD up

Post by Olav »

chennes wrote: Mon Oct 03, 2022 9:33 pm Great, that's one step forward anyway. But FreeCAD is still freezing after printing that error?
Yes it is.

Turns out that between the moment that the progress bar stalls on "Download icon for frame" and the moment that the message appears on the terminal, I can still close the Addon Manager window and do stuff in the program for about half a minute. But the message still does appear and from that point FreeCAD is completely unresponsive.

I may check further tomorrow afternoon/evening, it's almost midnight here.
User avatar
chennes
Veteran
Posts: 3904
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon Manager freezes FreeCAD up

Post by chennes »

Thanks again for testing, and for the report. When you are back at it, if possible could you see if https://github.com/FreeCAD/FreeCAD/pull/7552 fixes the freeze? I still don't know what's causing the pip timeout, but priority one right now is stopping it from hanging.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3904
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon Manager freezes FreeCAD up

Post by chennes »

Also, regardless of whether that resolves the hang, can you enter the following into your Python console inside FreeCAD and paste in the output? I'd like to track down why some folks aren't getting results from pip.

Code: Select all

import subprocess
import addonmanager_utilities as utils
python_exe = utils.get_python_exe()
print(python_exe )
call_args = [python_exe, "-m", "pip", "--disable-pip-version-check", "--version"]
proc = subprocess.run(
                call_args,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
                check=True,
                timeout=30,
            )
# The above may throw an exception: if it does not, also run these two lines
print(proc.stderr.decode())
print(proc.stdout.decode())
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Olav
Posts: 211
Joined: Sun Nov 27, 2016 7:58 pm
Location: Netherlands

Re: Addon Manager freezes FreeCAD up

Post by Olav »

chennes wrote: Mon Oct 03, 2022 10:13 pm if possible could you see if https://github.com/FreeCAD/FreeCAD/pull/7552 fixes the freeze?
I'm not sure what I'm looking at on that page. Please treat me like an idiot: what exactly should I do here?

I did update the source files and rebuilt the program. Freeze is still there.

chennes wrote: Tue Oct 04, 2022 2:44 am can you enter the following into your Python console inside FreeCAD and paste in the output?
That I can do ;-)

Code: Select all

>>> import subprocess
>>> import addonmanager_utilities as utils
>>> python_exe = utils.get_python_exe()
>>> print(python_exe )
/usr/bin/python3
>>> call_args = [python_exe, "-m", "pip", "--disable-pip-version-check", "--version"]
>>> proc = subprocess.run(
...                 call_args,
...                 stdout=subprocess.PIPE,
...                 stderr=subprocess.PIPE,
...                 check=True,
...                 timeout=30,
...             )
>>> # The above may throw an exception: if it does not, also run these two lines
>>> print(proc.stderr.decode())

>>> print(proc.stdout.decode())
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)

>>> 
Seems fine, no?
Post Reply