toolmanager bombed out , all tools gone.

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
freman
Veteran
Posts: 2214
Joined: Tue Nov 27, 2018 10:30 pm

Re: toolmanager bombed out , all tools gone.

Post by freman »

thanks, I realise that. I've been building FreeCAD and thunder's asm3 from source for about a year now. That involved building a number of other libs from source too, and I've seen the build on Unix guide.

I have a specific problem since trying to switch from qt4 to qt5. Sometimes it's a bit of guessing game to find out exactly what package is missing, or whether there is a flaw in the build scripts or a distro specific quirk. If you can see anything more specific , that would be very helpful.
User avatar
freman
Veteran
Posts: 2214
Joined: Tue Nov 27, 2018 10:30 pm

Re: toolmanager bombed out , all tools gone.

Post by freman »

mlampert:
As for your tools, the default tool library is stored in your FC settings. You can look at "Tools" -> "Edit Parameters ..." -> "Preferences" -> "Mod" -> "Path". If there is a "ToolLibrary-Main" entry, then the value is your json formatted tool library. If there is nothing there then it's really gone, unless you exported it at some point.
"ToolLibrary-Main" entry shows this:

Code: Select all

[{"Tools": {}, "Version": 1, "TableName": "Tool Table-1"}]
Is that what you meant ?
User avatar
freman
Veteran
Posts: 2214
Joined: Tue Nov 27, 2018 10:30 pm

Re: toolmanager bombed out , all tools gone.

Post by freman »

this getting a bit crazy. I don't understand what is going on here.

I did

Code: Select all

 git pull 
 git checkout master
 git checkout src
then switched to an earlier build to try to get around the problem.

I removed the contents of the build dir with rm -rf , ran cmake ../freecad-source to get a previous build using py2/qt4 , this is my new FC info:
OS: Linux (LXDE/LXDE)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18058 (Git)
Build type: Unknown
Branch: (HEAD detached at 871de20de)
Hash: 871de20deae2cd5909ab69c7ca1348a8994768f9
Python version: 2.7.16
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)


I still have exactly the same issue , either from Menu | Path | Toolmanager or via the comboview Job Editor | Tools tab | "Add" button.

Code: Select all

Traceback (most recent call last):
  File "/~/freecad-master-py3-build/Mod/Path/PathScripts/PathJobGui.py", line 857, in toolControllerAdd
    PathToolLibraryManager.CommandToolLibraryEdit().edit(self.obj, self.updateToolController)
  File "/~/freecad-master-py3-build/Mod/Path/PathScripts/PathToolLibraryManager.py", line 859, in edit
    editor = EditorPanel(job, cb)
  File "/~/freecad-master-py3-build/Mod/Path/PathScripts/PathToolLibraryManager.py", line 521, in __init__
    self.TLM = ToolLibraryManager()
  File "/~/freecad-master-py3-build/Mod/Path/PathScripts/PathToolLibraryManager.py", line 162, in __init__
    self.loadToolTables()
  File "/~/freecad-master-py3-build/Mod/Path/PathScripts/PathToolLibraryManager.py", line 301, in loadToolTables
    tt = self.tooltableFromAttrs(table)
  File "/~/freecad-master-py3-build/Mod/Path/PathScripts/PathToolLibraryManager.py", line 260, in tooltableFromAttrs
    tt.Name = stringattrs.get('TableName')
TypeError: cannot return std::string from Unicode object
Per previous details, it seems that a tooltable is still referenced in the parameters. Maybe it has been written with some unicode value included which is causing the error.
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: toolmanager bombed out , all tools gone.

Post by mlampert »

From your output above your tool table seems to be empty and the TableName is a regular string. I would probably suggest removing your configuration files, I have the feeling that something else in the config file got out of whack and it's spilling into the tool table.
User avatar
freman
Veteran
Posts: 2214
Joined: Tue Nov 27, 2018 10:30 pm

Re: toolmanager bombed out , all tools gone.

Post by freman »

I've found what looks like an anomalous gap in user.cfg, 30 apparently blank lines. Is this relevant?

Code: Select all

          <FCParamGroup Name="FemWorkbench"/>
          <FCParamGroup Name="NoneWorkbench"/>
          <FCParamGroup Name="gearWorkbench"/></FCParamGroup>
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        <FCParamGroup Name="System">
          <FCParamGroup Name="PathWorkbench"/>
        </FCParamGroup>
      </FCParamGroup>
      <FCParamGroup Name="NavigationIndicator">
        <FCBool Name="Compact" Value="0"/>
        <FCBool Name="Tooltip" Value="1"/>
      </FCParamGroup>
    </FCParamGroup>
    <FCParamGroup Name="Plugins">
      <FCParamGroup Name="addonsRepository">
        <FCBool Name="readWarning" Value="1"/>
      </FCParamGroup>
    </FCParamGroup>
  </FCParamGroup>
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: toolmanager bombed out , all tools gone.

Post by mlampert »

The blank lines I don't know, but the additional end tag doesn't look like valid XML to me. Not an expert though.
User avatar
freman
Veteran
Posts: 2214
Joined: Tue Nov 27, 2018 10:30 pm

Re: toolmanager bombed out , all tools gone.

Post by freman »

Thanks, that does look broken.

I also removed FCgear from the tree and rebuilt. I thought I would have got a clean tree from git checkout master but it seems not.

This gives me a slightly different error in the same circumstances.

Code: Select all

Path workbench activated
Running the Python command 'Path_ToolLibraryEdit' failed:
Traceback (most recent call last):
  File "/~/freecad-master-py3-build/Mod/Path/PathScripts/PathToolLibraryManager.py", line 877, in Activated
    self.edit()
  File "/~/freecad-master-py3-build/Mod/Path/PathScripts/PathToolLibraryManager.py", line 859, in edit
    editor = EditorPanel(job, cb)
  File "/~/freecad-master-py3-build/Mod/Path/PathScripts/PathToolLibraryManager.py", line 521, in __init__
    self.TLM = ToolLibraryManager()
  File "/~/freecad-master-py3-build/Mod/Path/PathScripts/PathToolLibraryManager.py", line 162, in __init__
    self.loadToolTables()
  File "/~/freecad-master-py3-build/Mod/Path/PathScripts/PathToolLibraryManager.py", line 293, in loadToolTables
    prefsData = json.loads(self.prefs.GetString(self.PreferenceMainLibraryJSON, ""))
  File "/usr/lib64/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")

No JSON object could be decoded
Last edited by freman on Mon Oct 07, 2019 9:41 pm, edited 1 time in total.
User avatar
freman
Veteran
Posts: 2214
Joined: Tue Nov 27, 2018 10:30 pm

Re: toolmanager bombed out , all tools gone.

Post by freman »

still seeing odd gaps coming back after removing cfg files. :(

Code: Select all

git reset --hard
Is that the right command to get me properly synced with the official tree ?
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: toolmanager bombed out , all tools gone.

Post by DeepSOIC »

btw, people are still using py2-qt4 because of 3d view issues of py3-qt5.
See also Py2ectomy thread.
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: toolmanager bombed out , all tools gone.

Post by mlampert »

That's hard to say, depends on your branch and when you pulled/fetched the last time.

What I do is fetch the latest changes to freecad, then swtich to a new branch based on freecad/master. I build out of source so I delete the build directory and create a new build. I don't know enough about cmake and ccache to know when to do what, so I just start from a clean slate each time.
Post Reply