sql: Scan error on column index 2, name "source_path": converting NULL to string is unsupported
Check if applicable
- [x] I have searched the existing issues (required)
- [x] I'm willing to help fix the problem and contribute a pull request
Describe the bug
The following output is produced when running zk:
zk: warning: sql: Scan error on column index 2, name "source_path": converting NULL to string is unsupported
zk: warning: sql: Scan error on column index 2, name "source_path": converting NULL to string is unsupported
zk: warning: sql: Scan error on column index 2, name "source_path": converting NULL to string is unsupported
zk: warning: sql: Scan error on column index 2, name "source_path": converting NULL to string is unsupported
zk: warning: sql: Scan error on column index 2, name "source_path": converting NULL to string is unsupported
How to reproduce?
This happens when I create new notes on another host and sync them over. I need to narrow down the exact sequence, but generally, I:
- Sync notes between two hosts using syncthing.
- Edit and create notes on host B.
- Let notes sync.
- Run
zkon host B
zk configuration
[notebook]
dir = "~/zk"
[note]
filename = "{{id}}"
[format.markdown]
hashtags = true
link-format = "[{{title}}]({{rel-path}})"
[lsp.diagnostics]
dead-link = "error"
[alias]
n = "zk new"
nj = "zk new ~/zk/journal/"
e = "zk edit --interactive --exclude journal"
ea = "zk edit --interactive"
ej = "zk edit --interactive journal --sort path-"
[group.journal]
paths = ["journal"]
[group.journal.note]
filename = "{{format-date now '%Y-%m-%d_%H%M'}}"
template = "journal.md"
[tool]
# pandoc wraps even if told not to; --columns works around this
fzf-preview = "pandoc {-1} --wrap none --columns=8000 -t ansi"
Environment
zk
system: Linux 6.15.0-0-edge x86_64 Linux
zk is 0.15.1-r1 from Alpine packages
What happens if you delete notebook.db and index again?
I get this error when the frontmatter is somehow broken, because of an unquoted title with : in it for example
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in the next 5 days.
Kkooppp
On Mon, 4 Aug 2025, at 03:46, github-actions[bot] wrote:
github-actions[bot] left a comment (zk-org/zk#554) https://github.com/zk-org/zk/issues/554#issuecomment-3148892227 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in the next 5 days.
— Reply to this email directly, view it on GitHub https://github.com/zk-org/zk/issues/554#issuecomment-3148892227, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFSNO5OQGSIW55OJOSLEZ33L23NVAVCNFSM6AAAAACAX5OIISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCNBYHA4TEMRSG4. You are receiving this because you authored the thread.Message ID: @.***>
-- Hugo
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in the next 5 days.
asfasdfsdf
On Fri, 5 Sep 2025, at 01:03, github-actions[bot] wrote:
github-actions[bot] left a comment (zk-org/zk#554) https://github.com/zk-org/zk/issues/554#issuecomment-3256176225 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in the next 5 days.
— Reply to this email directly, view it on GitHub https://github.com/zk-org/zk/issues/554#issuecomment-3256176225, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFSNO5FBPX6MYAKYAQSJJD3RDANNAVCNFSM6AAAAACAX5OIISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTENJWGE3TMMRSGU. You are receiving this because you authored the thread.Message ID: @.***>
-- Hugo
What happens if you delete notebook.db and index again? I get this error when the frontmatter is somehow broken, because of an unquoted title with
:in it for example
@WhyNotHugo
And so this error only crops up on the destination machine, in terms of a synced notebook?
So I been getting this issue as well. deleting the sqlite db and creating again doesn't really do much it as the issue show up again
This error has only ever occured to me when I have broken frontmatter. eg commonly,
---
title: A title like this: will break
---
when what we want is
---
title: "A title like this: will break"
---
I use a template that already has the title wrapped as a string so that shouldn't happened. That said both of does a valid YAML so in theory it should accept both no? Ether with " or without is valid so not sure why it won't accept it
This error could well be thrown on any other yaml field though. Not just the title. Not sure how to progress with this one. I guess it would be a good first step to try and print the file paths that are being read as zk index goes through them. The problem file in question should then be the last before the error.
This error could well be thrown on any other yaml field though. Not just the title. Not sure how to progress with this one. I guess it would be a good first step to try and print the file paths that are being read as
zk indexgoes through them. The problem file in question should then be the last before the error.
That would definitely be helpful. If possible it would be good, depending on the context available when the error is thrown, to maybe suggest what maybe wrong so I can try and fix the file then running zk index again to confirm that the file is now fix
looks like it's already supported: zk index --verbose