sytone / obsidian-remote

Run Obsidian.md in a browser via a docker container.
MIT License
1.32k stars 126 forks source link

Can't restart obsidian #90

Open Anthony-Jhoiro opened 8 months ago

Anthony-Jhoiro commented 8 months ago

Describe the bug When running the latest version of obsidian, obsidian crashes when it re-starts without error logs.

I set obsidian-remote with the config and vaults as volumes like in the example docker-compose. It worked fine for a time, but in the past weeks, I have been unable to restart obsidian. It seems to be due to the obsidian config since it works when I remove it.

This is blocking for me since I can't synchronize the sync settings.

To restart obsidian, I used the method described at the bottom of the README and tried restarting the container. Both give the same result.

Edit: This seems to be due to the updated version. When removing the downloaded .asar file, it works fine again, but when it re-downloads, it breaks again.

To Reproduce Steps to reproduce the behavior:

  1. Start this docker-compose
    
    version: "3"

services: obsidian: image: 'ghcr.io/sytone/obsidian-remote:latest' container_name: obsidian-remote restart: unless-stopped pull_policy: always ports:

  1. Connect the right host and port in your browser, obsidian should open as normal
  2. Stop obsidian using the top-right icon
  3. right click and relaunch Obsidian
  4. Obsidian opens with a blank screen and no logs

Expected behavior Obsidian should restart without errors

Desktop (please complete the following information):

Additional context

After restart screenshot: image

Docker compose logs:

obsidian-remote  | xrdp-chansrv [0293284360]: sound_init:
obsidian-remote  | xrdp-chansrv [0293284361]: audin_init:
obsidian-remote  | xrdp-chansrv [0293284363]: sound_process_output_format:
obsidian-remote  | xrdp-chansrv [0293284363]:       wFormatTag      1
obsidian-remote  | xrdp-chansrv [0293284363]:       nChannels       2
obsidian-remote  | xrdp-chansrv [0293284363]:       nSamplesPerSec  44100
obsidian-remote  | xrdp-chansrv [0293284363]:       nAvgBytesPerSec 176400
obsidian-remote  | xrdp-chansrv [0293284363]:       nBlockAlign     4
obsidian-remote  | xrdp-chansrv [0293284363]:       wBitsPerSample  16
obsidian-remote  | xrdp-chansrv [0293284363]:       cbSize          0
obsidian-remote  | xrdp-chansrv [0293284363]: sound_process_output_format:
obsidian-remote  | xrdp-chansrv [0293284363]:       wFormatTag      1
obsidian-remote  | xrdp-chansrv [0293284363]:       nChannels       2
obsidian-remote  | xrdp-chansrv [0293284363]:       nSamplesPerSec  22050
obsidian-remote  | xrdp-chansrv [0293284363]:       nAvgBytesPerSec 88200
obsidian-remote  | xrdp-chansrv [0293284363]:       nBlockAlign     4
obsidian-remote  | xrdp-chansrv [0293284363]:       wBitsPerSample  16
obsidian-remote  | xrdp-chansrv [0293284363]:       cbSize          0
obsidian-remote  | xrdp-chansrv [0293284489]: sound_process_training: round trip time 126
obsidian-remote  | guacd[481]: INFO:    RDPDR user logged on
obsidian-remote  | [20240116-09:07:19] [INFO ] channel_thread_loop: trans_check_wait_objs error resetting
obsidian-remote  | xrdp-chansrv [0294023474]: scard_deinit:
obsidian-remote  | chansrv:smartcard_pcsc [0294023474]: scard_pcsc_deinit:
obsidian-remote  | [20240116-09:07:21] [INFO ] Socket 13: AF_UNIX connection received
obsidian-remote  | process_message_channel_setup: chan name 'cliprdr' id 0 flags 00000000
obsidian-remote  | process_message_channel_setup: chan name 'rdpdr' id 1 flags 00000000
obsidian-remote  | process_message_channel_setup: chan name 'rdpsnd' id 2 flags 00000000
obsidian-remote  | xrdp-chansrv [0294025245]: sound_init:
obsidian-remote  | xrdp-chansrv [0294025246]: audin_init:
obsidian-remote  | xrdp-chansrv [0294025251]: sound_process_output_format:
obsidian-remote  | xrdp-chansrv [0294025251]:       wFormatTag      1
obsidian-remote  | xrdp-chansrv [0294025251]:       nChannels       2
obsidian-remote  | xrdp-chansrv [0294025251]:       nSamplesPerSec  44100
obsidian-remote  | xrdp-chansrv [0294025251]:       nAvgBytesPerSec 176400
obsidian-remote  | xrdp-chansrv [0294025251]:       nBlockAlign     4
obsidian-remote  | xrdp-chansrv [0294025251]:       wBitsPerSample  16
obsidian-remote  | xrdp-chansrv [0294025251]:       cbSize          0
obsidian-remote  | xrdp-chansrv [029402525rdpInDeferredRepeatCallback:
obsidian-remote  | rdpkeybChangeKeyboardControl:
obsidian-remote  | rdpkeybChangeKeyboardControl: autoRepeat off
obsidian-remote  | rdpInDeferredRepeatCallback:
obsidian-remote  | rdpkeybChangeKeyboardControl:
obsidian-remote  | rdpkeybChangeKeyboardControl: autoRepeat off

Obsidian logs:

2024-01-16 08:53:26 Loading main app package /squashfs-root/resources/obsidian.asar
2024-01-16 08:53:27 Checking for update using Github
2024-01-16 08:53:27 Success.
2024-01-16 08:53:27 Latest version is 1.5.3
2024-01-16 08:53:27 Downloading update from https://github.com/obsidianmd/obsidian-releases/releases/download/v1.5.3/obsidian-1.5.3.asar.gz
2024-01-16 08:53:27 Verifying hash & signature. Size= 8515395
2024-01-16 08:53:28 Saving file
2024-01-16 08:53:28 Update complete.
2024-01-16 08:56:45 Loading updated app package /config/.config/obsidian/obsidian-1.5.3.asar
2024-01-16 08:56:46 Checking for update using Github
2024-01-16 08:56:46 Success.
2024-01-16 08:56:46 Latest version is 1.5.3
2024-01-16 08:56:46 App is up to date.
EyeOfIllu commented 6 months ago

Hi.

I had a same issue. First I thought the issue was by old version of Docker on my Synology server or lack of git was a problem. Next I used a LXC container using same methodology and Docker Compose file like others, but nothing work. Only white window.

Finally, I found a solution. I used a docker hub repo instead of Github Container Repository (ghcr.io). A few days ago, author push new release to this repository (Mar 18, 2024). This release doesn't have a new version of installer, but Obsidian will be updated to the newest version without any issue.

jtwhitlow commented 4 months ago

When I closed out the obsidian app, I now just get a blank screen. I have restarted the container and also even tried to point to a different obsidian repo with no luck. Any way to get it back up?

ironon commented 3 months ago

Still having this problem.

I believe, similarly to the original post here, that the obsidian.asar in the obsidian config directory is somehow related to the issue. By making sure this file does not exist prior to starting the docker container, everything will work perfectly fine. However, if it does exist, this error will be thrown.

(node:308) electron: Failed to load URL: app://obsidian.md/starter.html with error: ERR_BLOCKED_BY_CLIENT
(Use `obsidian --trace-warnings ...` to show where the warning was created)

This is accompanied by a white screen in the web interface, where the terminal and all other Guacamole actions work perfectly fine, it's just that Obsidian refuses to display anything under any circumstance. The error above suggests that the white screen is caused by Obsidian being unable to load a certain html file. I'm not skilled enough yet at Docker to figure out where the obsidian executable is being called, so that I can add the --trace-warnings flag, so I'm not entirely sure what already having Obsidian downloaded has to do with Obsidian refusing to load a certain html file.

See comment below for better solution than this.

As a jank, who-gave-me-this-much-power hacky solution, I've modified my container start command to delete that specific file whenever I boot up my container, and this fixes the problem whenever you reboot the container. This does not fix it when you close Obsidian and reopen it in the same instance of the container.

 rm /root/config/.config/obsidian/obsidian-1.6.3.asar ; docker run --rm -it -v /root/vaults:/vaults -v /root/config:/config -p 8080:8080 ghcr.io/sytone/obsidian-remote:latest

If you follow my terrible path and choose to do this, change /root/config/.config/obsidian/obsidian-1.6.3.asar for the actual file path of your .asar file, as the obsidian version and the place you have chosen to put it may be different.

ironon commented 3 months ago

https://forum.obsidian.md/t/can-not-load-obsidian-ui-err-blocked-by-client-upon-launch/74066 Issue is with obsidian itself.

ironon commented 3 months ago

Found a better workaround.

This issue was mentioned in the original README.md of obsidian-remote, where the screen goes all white, and you're supposed to be able to right click and click Obsidian when that happens, to fix it. That wasn't working for me, and would create a new white screen. I fixed this by overriding the /config/.config/openbox/menu.xml with a new Obsidian launch command that deletes the .asar file before every launch. Same principle as my workaround above, but now it works without having to restart the container.

My launch command for the container:

mkdir /root/config
mkdir /root/config/.config
mkdir /root/config/.config/openbox
cat patch.xml > /root/config/.config/openbox/menu.xml
rm /root/config/.config/obsidian/obsidian-1.6.3.asar ; docker run --rm -it -v /root/vaults:/vaults -v /root/config:/config -e PASSWORD="password" -e TITLE="best vault ever" -p 8080:8080 ghcr.io/sytone/obsidian-remote:latest

patch.xml (must be in same folder as start.sh)

<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/3.4/menu">
    <menu id="root-menu" label="MENU">
        <item label="NEW Obsidian" icon="/squashfs-root/usr/share/icons/hicolor/48x48/apps/obsidian.png">
            <action name="Execute">
                <command>/usr/bin/xterm -e "rm /config/.config/obsidian/obsidian-1.6.3.asar ; /squashfs-root/obsidian --no-sandbox --trace-warnings --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer"</command>
            </action>
        </item>
        <item label="xterm" icon="/usr/share/pixmaps/xterm-color_48x48.xpm">
            <action name="Execute">
                <command>/usr/bin/xterm</command>
            </action>
        </item>
        <item label="Reload OB">
            <action name="Reconfigure" />
        </item>
    </menu>
</openbox_menu>