crash when entering name in empty tool db (Beta 8.994)

Issue #453 resolved
Paul G. created an issue

Flatcam beta (8.994) crashes if you try to enter a letter in the empty “Name“ field if there is no entry in the database.

geometry object -> Pick from DB → enter NAME = crash

console output:

[ERROR][MainThread] Could not load tools DB file.
back (most recent call last):
File "/mnt/store/build/flatcam3/flatcam/appDatabase.py", line 2402, in update_storage
self.db_tool_dict[tool_id]['name'] = val
KeyError: 'None'

enviroment:

Arch Linux, Python 3.8.6

Comments (8)

  1. Marius Stanciu

    Hi Paul,

    Ok, you see that error about loading the database? I guess this is the culprit. The app could not load the tools DB file but it still did opened the GUI.
    I’ve added a protection against that and while it does not solve really the issue it will block the user to open the Tools DB if there is an error. If on app reboot (when the file is recreated if it is no longer there) you can’t still open the tools DB then the OS is doing something behind your back and need to be solved on the folder (perhaps it does not have read permissions and so on).

    Could you please try the latest commit in the Beta branch and see if it lets you open the DB now?

    I’ve also added a log.error with details which should be in the Console.

  2. Paul G. reporter

    With your new code I now got that warning:

    [ERROR][MainThread] Could not load tools DB file.
    [DEBUG][MainThread] The tools DB file is not loaded: [Errno 2] Datei oder Verzeichnis nicht gefunden: '/home/p/.Fl
    atCAM\\tools_db.FlatDB'
    [ERROR][MainThread] Could not access tools DB file. The file may be locked,
    not existing or doesn't have the read permissions.
    Check to see if exists, it should be here: /home/p/.FlatCAM
    It may help to reboot the app, it will try to recreate it if it's missing.

    But the file is there:

    ls -lah ~/.FlatCAM/tools_db.FlatDB
    -rw-r--r-- 1 p p 2,2K 29. Okt 10:18 /home/p/.FlatCAM/tools_db.FlatDB

    After restarting I get the same error message. Maybe you have a typo in the path? (\\) Looks not like valid linux path?

  3. Marius Stanciu

    Oops. Forgot about that. There is a pull request for that. It looks like the way the path is constructed does not work Ok for Linux.

    If the one that made the PR does not update it soon, I will. It's a simple enough change.

  4. Log in to comment