[SOLVED] Unable to run SilverBullet with authentication

Hi, I’m running SilverBullet on Apache (Ubuntu server 24.04) on a subdomain under my own domain. This is to make SB accessible from anywhere for me. I run it according to this tutorial I wrote here on the forum: Set up SilverBullet on Apache server with reverse proxy - Guides - SilverBullet Community

The thing is, I obviously need to password-protect my SB instance, for which I used --user name:password switch. This worked well until some time ago when I encountered an error every time I try to start SB like this.

I wrote an issue about this on GH but it doesn’t seem to get much visibility so I’m turning to this friendly forum as I have the experience of you all being very helpful.

The error I’m getting is:

$ silverbullet --user pete:123 .
Using KV as a database backend (/path/to/SB/.silverbullet.db).
Going to start SilverBullet binding to 127.0.0.1:3000
SilverBullet will only be available locally, to allow outside connections, pass -L0.0.0.0 as a flag, and put a TLS terminator on top.
Using local disk as a storage backend: /path/to/SB
Unhandled rejection: PromiseRejectionEvent {
  bubbles: false,
  cancelable: true,
  composed: false,
  currentTarget: Window {},
  defaultPrevented: false,
  eventPhase: 2,
  srcElement: null,
  target: Window {},
  returnValue: true,
  timeStamp: 0,
  type: "unhandledrejection",
  promise: Promise {
    <rejected> ReferenceError: window is not defined
    at IV.hashSHA256 (https://get.silverbullet.md/:87:33860)
    at IV.init (https://get.silverbullet.md/:87:33272)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async zX.init (https://get.silverbullet.md/:2384:18073)
    at async rX.start (https://get.silverbullet.md/:2385:7437)
    at async F.gj [as actionHandler] (https://get.silverbullet.md/:2385:13469244)
    at async F.execute (https://get.silverbullet.md/:24:8601)
    at async F.parseCommand (https://get.silverbullet.md/:24:6314)
    at async https://get.silverbullet.md/:2418:6541
  },
  reason: ReferenceError: window is not defined
    at IV.hashSHA256 (https://get.silverbullet.md/:87:33860)
    at IV.init (https://get.silverbullet.md/:87:33272)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async zX.init (https://get.silverbullet.md/:2384:18073)
    at async rX.start (https://get.silverbullet.md/:2385:7437)
    at async F.gj [as actionHandler] (https://get.silverbullet.md/:2385:13469244)
    at async F.execute (https://get.silverbullet.md/:24:8601)
    at async F.parseCommand (https://get.silverbullet.md/:24:6314)
    at async https://get.silverbullet.md/:2418:6541
}
^C # killed SB here

Here’s my deno version:

$ deno --version
deno 2.1.4 (stable, release, x86_64-unknown-linux-gnu)
v8 13.0.245.12-rusty
typescript 5.6.2

I recently upgraded Deno from 2.0.x (don’t remember exactly) to the newest available 2.1.4 version but that didn’t resolve the issue, sadly, the situation stays exactly the same.

Would anyone here know what could I do to resolve this? Thanks a lot in advance!

Do you have any plugs installed? Try removing/renaming your _plug folder and restarting. It may be you’re running a plug that hasn’t been updated recently. If things boot fine with the folder removed, try running the Plugs: Update command again to redownload the plugs, perhaps in newer versions.

@zef : Thanks for your suggestion. I’m very sorry for being confused, but I can’t find the directory. I even tried

$ cd /
$ sudo find -type d -name _plug

which yields 0 results. Yet, when I ran the command Plugs: Update in my SB instance (it didn’t fix the issue BTW), I found in the instance’s log this:

Requested file _plug/plug-manager.plug.js
Requested file PLUGS.md
Error GETting file PLUGS.md Not found

… which makes me feel very stupid because it’s talking about a directory I can’t find…
However, the last line makes me think - could it be that I have something severely broken in my SB instance and I should just try to reinstall it from scratch? I though things like /today or automatic tables of contents were also plugins and these work fine…

Thank you very much for your help again.

Ok, then you probably don’t have any plugs installed. What version of silverbullet are you running? Maybe try to upgrade via silverbullet upgrade? It’s only recent versions (0.10.x) that work with Deno 2+

Aaaah, that was it! So I was just running an obsolete version of SB and doing silverbullet upgrade solved the whole problem. Thank you very much!

1 Like