No elements appearing in library

Hi everyone, new LibrePCB and very minimal ecad user here.

First, thanks to the developer, as a novice this is a very welcoming app and I found it easy to make my first pcb.

I’m having library trouble. First couple of sessions using LPCB I created some components (with all the category-symbol-component-package cat-package-device files) and got to make myself a little pcb design to mill out, which went well.

So far so good; I have the folder LibrePCB-Workspace/data/libraries/local/LPCBLibrary.lplib, containing a few files including library.lp, and the 6 folders for cmp, cmpcat etc. all of which contain a few subfolders with my library elements in them.

However, since a couple of days ago, when I click Library Manager and Open Library Editor for my local library, nothing shows up, no elements at all. Also if I do create a library element,a new folder is created containing the data I entered, but this is only visible in file explorer, nothing at all shows up in Library Editor so I can’t use these elements.

I’ve reinstalled LibrePCB a couple of times, updated library, turned it off and on etc. but no joy. Any suggestions?

Hi @freemoore,

Glad to hear you were able to create a PCB :blush:

Regarding your problem, that should not happen indeed. Some thoughts:

  • Did you manually copy/move library folders around, or are libraries synced to some cloud (e.g. Dropbox)? In this case, make sure the (hidden) “.librepcb-lib” file in the *.lplib library directory is not lost. Also every subfolder of library elements contains a dot-file.

  • Also check (when LibrePCB is closed) that there are no “.lock” files left over in these directories. I think they should not lead to the problem you describe, but still worth to check.

  • When LibrePCB is closed, delete all files starting with “cache_” in the workspace folder “data/libraries/” and start LibrePCB again. (no worries, these files will be rebuilt)

  • Try to run LibrePCB from command line. This will print logging messages to console. Check these messages or post them here. On Windows you need to log to a file (use cmd.exe, not Powershell):

    "C:\path\to\librepcb.exe" > log.txt 2>&1
    

If nothing helps:

  • Which operating system are you using?
  • How did you install LibrePCB (installer, ZIP, AppImage, Snap, …)?
  • Could you somehow show me the complete directory structure of your library directory (including hidden files)?
  • You do see your library in the library manager, right? Only its contained elements are missing?

Hi @ubruhin,
thanks for getting back so quickly!
So. Yes, I did a fair bit of manual moving around in trying to sync two installs of LPCB across a windows PC and a Mac laptop. However, the .librepcb-lib file is present (though it seems to be empty), and all subfolders do contain that dot-file.
There were no lock files.
Deleting the cache_v5.sqlite file did it! Next launch did a library scan that took some few seconds rather than disappearing almost immediately (it had been doing that, I forgot to mention). Now my library editor shows all my components, as well as maybe 10 copies of the eagle import I was trying out (from SamacSys’ ComponentSearchEngine, which looks great - do you think that guy would be up for offering LibrePCB as an export type option?).

I’m going to try opening LPCB on the laptop now, as it’s working on the desktop again - the laptop is inside near a heater rather than in a cold workshop. The intention is to use github to transfer data between the two. Am I right in thinking that at the moment the only way to do that is manually, by making the Workspace folder a git repo and manually pushing an update at the end of a session?

Thanks for your help!

OK nice it could be resolved. Actually this should not happen, but maybe the manual copying somehow messed up the SQLite database. In case it happens again, it would be nice if you could check the logging messages and post them here.

In any way, make sure these “cache_” files are not synced between different computers. If you use Git, add them to .gitignore (use glob for the number, as it changes some time).

Feel free to ask them :slight_smile: To be honest, I’m not a fan of such services since quality of such libraries are varying heavily (you never know if they are correct or not). But of course I wouldn’t mind if they add a LibrePCB export some day.

Actually I’d recommend to sync only projects & libraries (each with its own Git repo), not the whole workspace. The workspace contains lots of data which doesn’t make sense to sync (e.g. the cache files, but also all the installed remote libraries). And workspace settings may contain system-dependent things (e.g. path to external PDF reader may vary from one system to another). So it’s better to sync only projects and libraries (though in theory you can sync the whole workspace as long as the cache files are excluded).