You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The migration worked without a hitch for me. Then, on restart, massCode was empty (0 snippets). On second restart of the app, however, the issue seems to have resolved itself. Hopefully others will find the same to be true.
On my 1st try to update from massCode v3 to v4 I was using winget in UnigetUI. So just to be sure that this is not a problem of winget, I went back to massCode 3.12.1; all my snippets were still there. The settings were like that:
After that I followed these steps:
download massCode installer from github ('massCode.Setup.4.0.0.exe')
started this installer
at the end of the installation process used the 'start massCode' option
massCode started; as expected; no automatic migration of the existing snippets happened; massCode contained no snippets.
went to preferences to start the manual migration
selected the db.json file (only json files can be selected although the text in the preferences says 'select a folder')
pressed select; file selection dialog closed; preferences were visible again; in the right bottom corner an error was displayed saying 'sqllite error: file is not a database'
The db.json file contains the snippets from massCode 3.12 and looks like this:
On my 1st try to update from massCode v3 to v4 I was using winget in UnigetUI. So just to be sure that this is not a problem of winget, I went back to massCode 3.12.1; all my snippets were still there. The settings were like that:
I have the exact same issue. I am on Windows 11 too.
I can't even create a new snippet.
When I open the Devtools, I can see these server errors :
For testing, I can only use Win 10, and the application launched correctly on my PC. I can assume that sqlite3 does not launch on some platforms, including Win 11, although there is confirmation that the application works correctly on Win 11. Try building the application locally with pnpm install, pnpm run build.
Hello there 👋
Same problem on my M4 macBook using Sequoia 15.7
I just downloaded the 4.0.1 version and when i try migrating i get an error, but not quite the same
@emoveo-design Judging by the error, you have a non-unique name tag in db.json.
I tried to get rid of non-unique tag names, but now I got a different error when trying to migrate from v3: Error invoking remote method 'db:migrate': SqliteError: NOT NULL constraint failed: snippets.createdAt.
The error is quite clear: NOT NULL constraint failed: snippets.createdAt.
This means some of your snippets don’t have a createdAt field, which causes the migration to fail.
I’m building this project alone, so please try to troubleshoot issues like this on your side first — often the error message already points to the root cause. If it still doesn’t work after checking, feel free to open an issue with more details.
@subfighter3
The error is quite clear: NOT NULL constraint failed: snippets.createdAt. This means some of your snippets don’t have a createdAt field, which causes the migration to fail.
Of course, you are right, I digged into the JSON and found some "createdAt": null, where I pasted the updatedAt value instead of null, then the migration was done successfully.
pnpm install; this recreated better-sqlite3 and electron
pnpm run dev
message saying something like 'db is not a database'; terminated program
moved files in my massCode data directory (C:\Users\Berni\massCode) to a temporary folder
pnpm run dev showed that a new database is created; in the preferences I could migrate the old snippets; in the app I could create folders and snippets.
switched back to node lts (v22) and ran installed version of massCode (v4) -> I could import my snippets from v3, create new snippets and folders -> everything is fine again.
What I was learning:
Deleting the masscode.db file in the massCode data directory solved my problems.
my problem was not that the sqlite server did not start, but that massCode v4 tried to use the database masscode.db that was present in my massCode v3 data directory (the file originated from 2022, so it cannot be a fragment of one of my updates to v4). Deleting this file solved my problems.
So thanks to @antonreshetov for the ultra fast responses and for this great tool. The problem is solved for me.
@BePo65 Wow, thanks for the research, now I understand what's going on. Actually, the masscode.db file is a database from https://github.com/louischatriot/nedb that was used in massCode v1. And now in v4, which uses sqlite3, the name coincides in case-insensitive OSes: masscode.db and massСode.db. This is a real jackpot 😄 It was so long ago that I forgot I even used nedb ) Going to fix it.
pnpm install; this recreated better-sqlite3 and electron
pnpm run dev
message saying something like 'db is not a database'; terminated program
moved files in my massCode data directory (C:\Users\Berni\massCode) to a temporary folder
pnpm run dev showed that a new database is created; in the preferences I could migrate the old snippets; in the app I could create folders and snippets.
switched back to node lts (v22) and ran installed version of massCode (v4) -> I could import my snippets from v3, create new snippets and folders -> everything is fine again.
What I was learning:
Deleting the masscode.db file in the massCode data directory solved my problems.
my problem was not that the sqlite server did not start, but that massCode v4 tried to use the database masscode.db that was present in my massCode v3 data directory (the file originated from 2022, so it cannot be a fragment of one of my updates to v4). Deleting this file solved my problems.
So thanks to @antonreshetov for the ultra fast responses and for this great tool. The problem is solved for me.
Activity
BePo65 commentedon Sep 28, 2025
Same with me on my windows 11 system. Shows the following error message for about 1s (at the right bottom corner of the window).
Perhaps it would also be a good idea to give a short hint on how to migrate from an older version in the github readme file and/or the documentation.
antonreshetov commentedon Sep 28, 2025
@BePo65 The migration should happen without any action on the user's part, so there's no point in giving any hints.
I can't reproduce the bug yet. Are you sure you are using the correct
.jsonfile from the old version of the application for migration?pa-0 commentedon Sep 28, 2025
The migration worked without a hitch for me. Then, on restart, massCode was empty (0 snippets). On second restart of the app, however, the issue seems to have resolved itself. Hopefully others will find the same to be true.
BePo65 commentedon Sep 28, 2025
On my 1st try to update from massCode v3 to v4 I was using winget in UnigetUI. So just to be sure that this is not a problem of winget, I went back to massCode 3.12.1; all my snippets were still there. The settings were like that:
After that I followed these steps:
The db.json file contains the snippets from massCode 3.12 and looks like this:
What am I doing wrong?
mikeingz commentedon Sep 29, 2025
I have the exact same issue. I am on Windows 11 too.
I can't even create a new snippet.
When I open the Devtools, I can see these server errors :
BePo65 commentedon Sep 29, 2025
The same happens on my system: I cqn neither add a folder nor a new snippet.
My configuration:
antonreshetov commentedon Sep 29, 2025
For testing, I can only use Win 10, and the application launched correctly on my PC. I can assume that sqlite3 does not launch on some platforms, including Win 11, although there is confirmation that the application works correctly on Win 11. Try building the application locally with
pnpm install, pnpm run build.antonreshetov commentedon Sep 29, 2025
Try 4.0.1 - https://github.com/massCodeIO/massCode/releases/tag/v4.0.1
BePo65 commentedon Sep 29, 2025
Which one: 'massCode-4.0.1.exe' or 'massCode.4.0.1.exe'
antonreshetov commentedon Sep 29, 2025
@BePo65 According to SHA256, these are identical files. For some reason, they were attached to the release in the workflow. So any of them can be run.
mikeingz commentedon Sep 29, 2025
still the same issue with 4.0.1
antonreshetov commentedon Sep 29, 2025
Unfortunately, I can't help you at the moment. It seems to be a specific problem.
emoveo-design commentedon Sep 29, 2025
Hello there 👋
Same problem on my M4 macBook using Sequoia 15.7
I just downloaded the 4.0.1 version and when i try migrating i get an error, but not quite the same
BePo65 commentedon Sep 29, 2025
Even on my system 4.0.1 didn't change anything. I cloned the repo and would try to track the problem down (if this would help you).
Before I spend to much time looking for the method that imports the v3 snippets: do you have a hint for me, where to look?
4 remaining items
antonreshetov commentedon Sep 29, 2025
@BePo65 the project uses
massCode/package.json
Line 136 in d2e1ee3
subfighter3 commentedon Sep 29, 2025
I tried to get rid of non-unique tag names, but now I got a different error when trying to migrate from v3:
Error invoking remote method 'db:migrate': SqliteError: NOT NULL constraint failed: snippets.createdAt.MassCode v4.0.1 on M4 Taohe
antonreshetov commentedon Sep 29, 2025
@subfighter3
The error is quite clear:
NOT NULL constraint failed: snippets.createdAt.This means some of your snippets don’t have a createdAt field, which causes the migration to fail.
I’m building this project alone, so please try to troubleshoot issues like this on your side first — often the error message already points to the root cause. If it still doesn’t work after checking, feel free to open an issue with more details.
subfighter3 commentedon Sep 29, 2025
Of course, you are right, I digged into the JSON and found some
"createdAt": null,where I pasted theupdatedAtvalue instead of null, then the migration was done successfully.Thanks a lot for the insight
antonreshetov commentedon Sep 29, 2025
@subfighter3 I will take such cases into account and make workarounds in migration.
BePo65 commentedon Sep 29, 2025
What I did:
pnpm install; this recreated better-sqlite3 and electronpnpm run devC:\Users\Berni\massCode) to a temporary folderpnpm run devshowed that a new database is created; in the preferences I could migrate the old snippets; in the app I could create folders and snippets.What I was learning:
Deleting the
masscode.dbfile in the massCode data directory solved my problems.masscode.dbthat was present in my massCode v3 data directory (the file originated from 2022, so it cannot be a fragment of one of my updates to v4). Deleting this file solved my problems.So thanks to @antonreshetov for the ultra fast responses and for this great tool. The problem is solved for me.
mikeingz commentedon Sep 30, 2025
I confirm that deleting masscode.db also solved it for me.
antonreshetov commentedon Sep 30, 2025
@BePo65 Wow, thanks for the research, now I understand what's going on. Actually, the
masscode.dbfile is a database from https://github.com/louischatriot/nedb that was used in massCode v1. And now in v4, which uses sqlite3, the name coincides in case-insensitive OSes:masscode.dbandmassСode.db. This is a real jackpot 😄 It was so long ago that I forgot I even used nedb ) Going to fix it.fix(db): add SQLite file validation and backup for non-SQLite file #592…
antonreshetov commentedon Sep 30, 2025
Fixed #601
MustCodeAl commentedon Oct 3, 2025
this worked, thank you
LadyNay commentedon Jun 20, 2026
A python script to fix the issue