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

[Problem] Draft Workbench modules are not loaded #12575

Closed
2 tasks done
FalcoGer opened this issue Feb 23, 2024 · 9 comments
Closed
2 tasks done

[Problem] Draft Workbench modules are not loaded #12575

FalcoGer opened this issue Feb 23, 2024 · 9 comments
Labels
Bug This issue or PR is related to a bug Missing: confirmation Missing confirmation from other testers Packaging: PPA WB Draft Related to the Draft Workbench

Comments

@FalcoGer
Copy link

FalcoGer commented Feb 23, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

When opening the draft workbench, I get errors about the draft modules not being able to load.

00:09:32  <built-in function SoFieldContainer_getField> returned a result with an exception setError: Initializing one or more of the Draft modules failed, Draft will not work as expected.
00:09:32  Unknown command 'Draft_Fillet'
00:09:32  Unknown command 'Draft_Circle'
00:09:32  Unknown command 'Draft_Ellipse'
00:09:32  Unknown command 'Draft_Rectangle'
00:09:32  Unknown command 'Draft_Polygon'
00:09:32  Unknown command 'Draft_BSpline'
00:09:32  Unknown command 'Draft_Point'
00:09:32  Unknown command 'Draft_Facebinder'
00:09:32  Unknown command 'Draft_ShapeString'
00:09:32  Unknown command 'Draft_Text'
00:09:32  Unknown command 'Draft_Dimension'
00:09:32  Unknown command 'Draft_Label'
00:09:32  Unknown command 'Draft_AnnotationStyleEditor'
00:09:32  Unknown command 'Draft_Move'
00:09:32  Unknown command 'Draft_Rotate'
00:09:32  Unknown command 'Draft_Scale'
00:09:32  Unknown command 'Draft_Mirror'
00:09:32  Unknown command 'Draft_Offset'
00:09:32  Unknown command 'Draft_Trimex'
00:09:32  Unknown command 'Draft_Stretch'
00:09:32  Unknown command 'Draft_Clone'
00:09:32  Unknown command 'Draft_Edit'
00:09:32  Unknown command 'Draft_SubelementHighlight'
00:09:32  Unknown command 'Draft_Join'
00:09:32  Unknown command 'Draft_Split'
00:09:32  Unknown command 'Draft_Upgrade'
00:09:32  Unknown command 'Draft_Downgrade'
00:09:32  Unknown command 'Draft_WireToBSpline'
00:09:32  Unknown command 'Draft_Draft2Sketch'
00:09:32  Unknown command 'Draft_Slope'
00:09:32  Unknown command 'Draft_FlipDimension'
00:09:32  Unknown command 'Draft_Shape2DView'
00:09:32  Unknown command 'Draft_LayerManager'
00:09:32  Unknown command 'Draft_AddNamedGroup'
00:09:32  Unknown command 'Draft_AddToGroup'
00:09:32  Unknown command 'Draft_SelectGroup'
00:09:32  Unknown command 'Draft_AddConstruction'
00:09:32  Unknown command 'Draft_ToggleDisplayMode'
00:09:32  Unknown command 'Draft_WorkingPlaneProxy'
00:09:32  Unknown command 'Draft_Snap_Lock'
00:09:32  Unknown command 'Draft_Snap_Endpoint'
00:09:32  Unknown command 'Draft_Snap_Midpoint'
00:09:32  Unknown command 'Draft_Snap_Center'
00:09:32  Unknown command 'Draft_Snap_Angle'
00:09:32  Unknown command 'Draft_Snap_Intersection'
00:09:32  Unknown command 'Draft_Snap_Perpendicular'
00:09:32  Unknown command 'Draft_Snap_Extension'
00:09:32  Unknown command 'Draft_Snap_Parallel'
00:09:32  Unknown command 'Draft_Snap_Special'
00:09:32  Unknown command 'Draft_Snap_Near'
00:09:32  Unknown command 'Draft_Snap_Ortho'
00:09:32  Unknown command 'Draft_Snap_Grid'
00:09:32  Unknown command 'Draft_Snap_WorkingPlane'
00:09:32  Unknown command 'Draft_Snap_Dimensions'
00:09:32  Unknown command 'Draft_ToggleGrid'
00:09:32  Unknown command 'Draft_Fillet'
00:09:32  Unknown command 'Draft_Circle'
00:09:32  Unknown command 'Draft_Ellipse'
00:09:32  Unknown command 'Draft_Rectangle'
00:09:32  Unknown command 'Draft_Polygon'
00:09:32  Unknown command 'Draft_BSpline'
00:09:32  Unknown command 'Draft_Point'
00:09:32  Unknown command 'Draft_Facebinder'
00:09:32  Unknown command 'Draft_ShapeString'
00:09:32  Unknown command 'Draft_Text'
00:09:32  Unknown command 'Draft_Dimension'
00:09:32  Unknown command 'Draft_Label'
00:09:32  Unknown command 'Draft_AnnotationStyleEditor'
00:09:32  Unknown command 'Draft_Move'
00:09:32  Unknown command 'Draft_Rotate'
00:09:32  Unknown command 'Draft_Scale'
00:09:32  Unknown command 'Draft_Mirror'
00:09:32  Unknown command 'Draft_Offset'
00:09:32  Unknown command 'Draft_Trimex'
00:09:32  Unknown command 'Draft_Stretch'
00:09:32  Unknown command 'Draft_Clone'
00:09:32  Unknown command 'Draft_Edit'
00:09:32  Unknown command 'Draft_SubelementHighlight'
00:09:32  Unknown command 'Draft_Join'
00:09:32  Unknown command 'Draft_Split'
00:09:32  Unknown command 'Draft_Upgrade'
00:09:32  Unknown command 'Draft_Downgrade'
00:09:32  Unknown command 'Draft_WireToBSpline'
00:09:32  Unknown command 'Draft_Draft2Sketch'
00:09:32  Unknown command 'Draft_Slope'
00:09:32  Unknown command 'Draft_FlipDimension'
00:09:32  Unknown command 'Draft_Shape2DView'
00:09:32  Unknown command 'Draft_SetStyle'
00:09:32  Unknown command 'Draft_ApplyStyle'
00:09:32  Unknown command 'Draft_Layer'
00:09:32  Unknown command 'Draft_LayerManager'
00:09:32  Unknown command 'Draft_AddNamedGroup'
00:09:32  Unknown command 'Draft_AddToGroup'
00:09:32  Unknown command 'Draft_SelectGroup'
00:09:32  Unknown command 'Draft_ToggleConstructionMode'
00:09:32  Unknown command 'Draft_AddConstruction'
00:09:32  Unknown command 'Draft_ToggleDisplayMode'
00:09:32  Unknown command 'Draft_ToggleGrid'
00:09:32  Unknown command 'Draft_SelectPlane'
00:09:32  Unknown command 'Draft_WorkingPlaneProxy'
00:09:32  Unknown command 'Draft_Heal'
00:09:32  Unknown command 'Draft_ShowSnapBar'
00:09:33  Traceback (most recent call last):
00:09:33    File "/usr/share/freecad-daily/Mod/Draft/draftutils/init_draft_statusbar.py", line 247, in init_draft_statusbar_snap
00:09:33      snap_widget.addAction(Gui.Command.get("Draft_ToggleGrid").getAction()[0])
00:09:33  AttributeError: 'NoneType' object has no attribute 'getAction'

Most of the buttons have disappeared and it basically doesn't do anything now.

Full version info

OS: Ubuntu 22.04 LTS (MATE/mate)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.36097 (Git)
Build type: Release
Branch: main
Hash: 14d2915e6c5828a697921cc9144ef368f8dd0e2f
Python 3.10.12, Qt 5.15.3, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: C/Default (C) [ OS: English/United States (en_US) ]
Installed mods: 
  * Curves 0.6.23
  * Help 1.0.3
  * lattice2 1.0.0
  * A2plus 0.4.63
  * CurvedShapes 1.0.5

Subproject(s) affected?

Draft

Anything else?

This happens with 0.22dev and 0.21, both installed with my package manager. I thought installing the dev version would fix it, but it did not.

I am using these PPAs.

ppa:freecad-maintainers/freecad-stable
ppa:freecad-maintainers/freecad-daily

Code of Conduct

  • I agree to follow this project's Code of Conduct
@maxwxyz maxwxyz added Bug This issue or PR is related to a bug WB Draft Related to the Draft Workbench Missing: confirmation Missing confirmation from other testers labels Feb 24, 2024
@Roy-043
Copy link
Contributor

Roy-043 commented Feb 24, 2024

@adrianinsaval AFAIK you handle the PPAs. Can you have a look at this issue? Thanks.

@Roy-043
Copy link
Contributor

Roy-043 commented Feb 24, 2024

@FalcoGer
Copy link
Author

I would prefer to keep using the package manager. But the appimage works as expected.

@adrianinsaval
Copy link
Member

I can't reproduce this so it's not an inherent problem of the ppa distribution. I would expect some sort of conflict in your system. Are you still experiencing this if you use the ppa @FalcoGer ?

@FalcoGer
Copy link
Author

FalcoGer commented Mar 8, 2024

Yes, I still get the same errors, updated just now. Probably missing or wrong version dependencies.

19:34:50  <built-in function SoFieldContainer_getField> returned a result with an exception setError: Initializing one or more of the Draft modules failed, Draft will not work as expected.
19:34:50  Unknown command 'Draft_Fillet'
19:34:50  Unknown command 'Draft_Circle'
19:34:50  Unknown command 'Draft_Ellipse'
19:34:50  Unknown command 'Draft_Rectangle'
19:34:50  Unknown command 'Draft_Polygon'
19:34:50  Unknown command 'Draft_BSpline'
19:34:50  Unknown command 'Draft_Point'
19:34:50  Unknown command 'Draft_Facebinder'
19:34:50  Unknown command 'Draft_ShapeString'
19:34:50  Unknown command 'Draft_Text'
19:34:50  Unknown command 'Draft_Dimension'
19:34:50  Unknown command 'Draft_Label'
19:34:50  Unknown command 'Draft_AnnotationStyleEditor'
19:34:50  Unknown command 'Draft_Move'
19:34:50  Unknown command 'Draft_Rotate'
19:34:50  Unknown command 'Draft_Scale'
19:34:50  Unknown command 'Draft_Mirror'
19:34:50  Unknown command 'Draft_Offset'
19:34:50  Unknown command 'Draft_Trimex'
19:34:50  Unknown command 'Draft_Stretch'
19:34:50  Unknown command 'Draft_Clone'
19:34:50  Unknown command 'Draft_Edit'
19:34:50  Unknown command 'Draft_SubelementHighlight'
19:34:50  Unknown command 'Draft_Join'
19:34:50  Unknown command 'Draft_Split'
19:34:50  Unknown command 'Draft_Upgrade'
19:34:50  Unknown command 'Draft_Downgrade'
19:34:50  Unknown command 'Draft_WireToBSpline'
19:34:50  Unknown command 'Draft_Draft2Sketch'
19:34:50  Unknown command 'Draft_Slope'
19:34:50  Unknown command 'Draft_FlipDimension'
19:34:50  Unknown command 'Draft_Shape2DView'
19:34:50  Unknown command 'Draft_LayerManager'
19:34:50  Unknown command 'Draft_AddNamedGroup'
19:34:50  Unknown command 'Draft_AddToGroup'
19:34:50  Unknown command 'Draft_SelectGroup'
19:34:50  Unknown command 'Draft_AddConstruction'
19:34:50  Unknown command 'Draft_ToggleDisplayMode'
19:34:50  Unknown command 'Draft_WorkingPlaneProxy'
19:34:50  Unknown command 'Draft_Snap_Lock'
19:34:50  Unknown command 'Draft_Snap_Endpoint'
19:34:50  Unknown command 'Draft_Snap_Midpoint'
19:34:50  Unknown command 'Draft_Snap_Center'
19:34:50  Unknown command 'Draft_Snap_Angle'
19:34:50  Unknown command 'Draft_Snap_Intersection'
19:34:50  Unknown command 'Draft_Snap_Perpendicular'
19:34:50  Unknown command 'Draft_Snap_Extension'
19:34:50  Unknown command 'Draft_Snap_Parallel'
19:34:50  Unknown command 'Draft_Snap_Special'
19:34:50  Unknown command 'Draft_Snap_Near'
19:34:50  Unknown command 'Draft_Snap_Ortho'
19:34:50  Unknown command 'Draft_Snap_Grid'
19:34:50  Unknown command 'Draft_Snap_WorkingPlane'
19:34:50  Unknown command 'Draft_Snap_Dimensions'
19:34:50  Unknown command 'Draft_ToggleGrid'
19:34:50  Unknown command 'Draft_Fillet'
19:34:50  Unknown command 'Draft_Circle'
19:34:50  Unknown command 'Draft_Ellipse'
19:34:50  Unknown command 'Draft_Rectangle'
19:34:50  Unknown command 'Draft_Polygon'
19:34:50  Unknown command 'Draft_BSpline'
19:34:50  Unknown command 'Draft_Point'
19:34:50  Unknown command 'Draft_Facebinder'
19:34:50  Unknown command 'Draft_ShapeString'
19:34:50  Unknown command 'Draft_Text'
19:34:50  Unknown command 'Draft_Dimension'
19:34:50  Unknown command 'Draft_Label'
19:34:50  Unknown command 'Draft_AnnotationStyleEditor'
19:34:50  Unknown command 'Draft_Move'
19:34:50  Unknown command 'Draft_Rotate'
19:34:50  Unknown command 'Draft_Scale'
19:34:50  Unknown command 'Draft_Mirror'
19:34:50  Unknown command 'Draft_Offset'
19:34:50  Unknown command 'Draft_Trimex'
19:34:50  Unknown command 'Draft_Stretch'
19:34:50  Unknown command 'Draft_Clone'
19:34:50  Unknown command 'Draft_Edit'
19:34:50  Unknown command 'Draft_SubelementHighlight'
19:34:50  Unknown command 'Draft_Join'
19:34:50  Unknown command 'Draft_Split'
19:34:50  Unknown command 'Draft_Upgrade'
19:34:50  Unknown command 'Draft_Downgrade'
19:34:50  Unknown command 'Draft_WireToBSpline'
19:34:50  Unknown command 'Draft_Draft2Sketch'
19:34:50  Unknown command 'Draft_Slope'
19:34:50  Unknown command 'Draft_FlipDimension'
19:34:50  Unknown command 'Draft_Shape2DView'
19:34:50  Unknown command 'Draft_SetStyle'
19:34:50  Unknown command 'Draft_ApplyStyle'
19:34:50  Unknown command 'Draft_Layer'
19:34:50  Unknown command 'Draft_LayerManager'
19:34:50  Unknown command 'Draft_AddNamedGroup'
19:34:50  Unknown command 'Draft_AddToGroup'
19:34:50  Unknown command 'Draft_SelectGroup'
19:34:50  Unknown command 'Draft_ToggleConstructionMode'
19:34:50  Unknown command 'Draft_AddConstruction'
19:34:50  Unknown command 'Draft_ToggleDisplayMode'
19:34:50  Unknown command 'Draft_ToggleGrid'
19:34:50  Unknown command 'Draft_SelectPlane'
19:34:50  Unknown command 'Draft_WorkingPlaneProxy'
19:34:50  Unknown command 'Draft_Heal'
19:34:50  Unknown command 'Draft_ShowSnapBar'
19:34:51  Traceback (most recent call last):
19:34:51    File "/usr/share/freecad-daily/Mod/Draft/draftutils/init_draft_statusbar.py", line 247, in init_draft_statusbar_snap
19:34:51      snap_widget.addAction(Gui.Command.get("Draft_ToggleGrid").getAction()[0])
19:34:51  AttributeError: 'NoneType' object has no attribute 'getAction'

Which python/pip packages do I need?

@adrianinsaval
Copy link
Member

can you uninstall and purge freecad-daily, freecad, opencascade and pivy and coin3d and the reinstall? THe package should install everything you need from the repo. If possible clear everything you had installed with pip as that often creates conflicts.

@FalcoGer
Copy link
Author

FalcoGer commented Mar 8, 2024

I can't find opencascade and coin3d. and i can only find python3-pivy.
i ran apt purge with --autoremove and it deleted a bunch of stuff.

~$ sudo apt purge freecad freecad-daily freecad-daily-common freecad-daily-python3 python3-pivy  --autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'freecad' is not installed, so not removed
The following packages will be REMOVED:
  calculix-ccx* freecad-daily* freecad-daily-common* freecad-daily-python3* libfreecad-daily-python3-0.22* libspooles2.2* linux-headers-5.15.0-97*
  linux-headers-5.15.0-97-generic* linux-image-5.15.0-97-generic* linux-modules-5.15.0-97-generic* linux-modules-extra-5.15.0-97-generic* python3-pivy*
  python3-pyside2.qtnetwork* python3-pyside2.qtopengl* python3-pyside2.qtprintsupport* python3-pyside2.qtsvg* python3-pyside2.qtuitools* python3-pyside2.qtwebchannel*
  python3-pyside2.qtwebengine* python3-pyside2.qtwebenginecore* python3-pyside2.qtwebenginewidgets* python3-pyside2.qtxml*
0 upgraded, 0 newly installed, 22 to remove and 2 not upgraded.
After this operation, 866 MB disk space will be freed.

I reinstalled freecad-daily and those are the packages it got as dependencies.

Get:1 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 libspooles2.2 amd64 2.2-14 [466 kB]
Get:2 https://ppa.launchpadcontent.net/freecad-maintainers/freecad-daily/ubuntu jammy/main amd64 freecad-daily-common all 0.22~pre1~202403071417~ubuntu22.04.1 [22,9 MB]
Get:3 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 calculix-ccx amd64 2.17-3 [1.825 kB]
Get:4 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 python3-pyside2.qtopengl amd64 5.15.2-2build2 [114 kB]
Get:5 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 python3-pivy amd64 0.6.5-1build6 [4.414 kB]
Get:6 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 python3-pyside2.qtxml amd64 5.15.2-2build2 [130 kB]
Get:7 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 python3-pyside2.qtuitools amd64 5.15.2-2build2 [168 kB]
Get:8 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 python3-pyside2.qtsvg amd64 5.15.2-2build2 [56,1 kB]
Get:9 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 python3-pyside2.qtwebengine amd64 5.15.2-2build2 [12,8 kB]
Get:10 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 python3-pyside2.qtnetwork amd64 5.15.2-2build2 [316 kB]
Get:11 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 python3-pyside2.qtwebenginecore amd64 5.15.2-2build2 [49,0 kB]
Get:12 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 python3-pyside2.qtwebchannel amd64 5.15.2-2build2 [25,8 kB]
Get:13 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 python3-pyside2.qtprintsupport amd64 5.15.2-2build2 [108 kB]
Get:14 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 python3-pyside2.qtwebenginewidgets amd64 5.15.2-2build2 [111 kB]
Get:15 https://ppa.launchpadcontent.net/freecad-maintainers/freecad-daily/ubuntu jammy/main amd64 libfreecad-daily-python3-0.22 amd64 0.22~pre1~202403071417~ubuntu22.04.1 [41,4 MB]
Get:16 https://ppa.launchpadcontent.net/freecad-maintainers/freecad-daily/ubuntu jammy/main amd64 freecad-daily-python3 amd64 0.22~pre1~202403071417~ubuntu22.04.1 [58,6 kB]
Get:17 https://ppa.launchpadcontent.net/freecad-maintainers/freecad-daily/ubuntu jammy/main amd64 freecad-daily all 0.22~pre1~202403071417~ubuntu22.04.1 [15,5 kB]

I don't know what other packages are dependencies and which might not be installed.
The problem persists.

I also noticed that the icons load when I open the draft workbench before opening project (from the start workbench), but then an error occurs when I click any icon.

22:20:42  Running the Python command 'Draft_Text' failed:
Traceback (most recent call last):
  File "/usr/share/freecad-daily/Mod/Draft/draftguitools/gui_texts.py", line 65, in Activated
    super().Activated(name="Text")
  File "/usr/share/freecad-daily/Mod/Draft/draftguitools/gui_base_original.py", line 267, in Activated
    super().Activated(name)
  File "/usr/share/freecad-daily/Mod/Draft/draftguitools/gui_base_original.py", line 133, in Activated
    self.wp = WorkingPlane.get_working_plane()
  File "/usr/share/freecad-daily/Mod/Draft/WorkingPlane.py", line 1758, in get_working_plane
    wp.set_to_default()
  File "/usr/share/freecad-daily/Mod/Draft/WorkingPlane.py", line 1460, in set_to_default
    self.set_to_auto()
  File "/usr/share/freecad-daily/Mod/Draft/WorkingPlane.py", line 1475, in set_to_auto
    self._update_all()
  File "/usr/share/freecad-daily/Mod/Draft/WorkingPlane.py", line 1687, in _update_all
    self._update_grid()
  File "/usr/share/freecad-daily/Mod/Draft/WorkingPlane.py", line 1724, in _update_grid
    FreeCADGui.Snapper.setGrid()
  File "/usr/share/freecad-daily/Mod/Draft/draftguitools/gui_snapper.py", line 1585, in setGrid
    self.setTrackers()
  File "/usr/share/freecad-daily/Mod/Draft/draftguitools/gui_snapper.py", line 1607, in setTrackers
    self.grid = trackers.gridTracker()
  File "/usr/share/freecad-daily/Mod/Draft/draftguitools/gui_trackers.py", line 1015, in __init__
    pick.style.setValue(coin.SoPickStyle.UNPICKABLE)
  File "/usr/lib/python3/dist-packages/pivy/coin.py", line 3989, in __getattr__
    field = self.getField(name)
  File "/usr/lib/python3/dist-packages/pivy/coin.py", line 3873, in getField
    return _coin.SoFieldContainer_getField(self, name)

<built-in function SoFieldContainer_getField> returned a result with an exception set

Maybe I shot my system with pip packages by not using virtualenv everywhere...

@FalcoGer
Copy link
Author

switched to flatpak after dist upgrade to 24.04. that works.

@adrianinsaval
Copy link
Member

I was never able to reproduce this problem, I'll assume it was some weird problem in your system since you don't have it anymore to keep investigating. I will update the daily ppa to have a package for 24.04 soon, you may test to see if the issue persists then if you're interested.

@adrianinsaval adrianinsaval closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This issue or PR is related to a bug Missing: confirmation Missing confirmation from other testers Packaging: PPA WB Draft Related to the Draft Workbench
Projects
None yet
Development

No branches or pull requests

4 participants