Hello everyone, I’ve had an issue with discord on Arch Linux for a long time, but only now had the time to document the error (had to photograph it with phone and transcribe it).

Its a weird one, buckle up.

At random times, discord crashes which causes my polybar to crash, as well as my sxhkd, which obviously means my computer is practically useless until I hard shutdown using the power button on my case. Whats weird is that sometimes it will go weeks without crashing, and other times it will crash frequently in a short time span (e.g. it crashed a couple times yesterday, and once today).

Here is the error as I photographed it:

And here it is after I manually copied it into a text editor (keep in mind I might have missed a character here or there because of this).

A JavaScript Error occurred in the main process

Uncaught exception:
Error: EROFS: read-only file system, write
	at writeSync (node:fs:923:3)
	at SyncWriteStream._write (node:internal/fs/sync._write_stream:275)
	at writeOrBuffer (node:internal/streams/writable:572:12)
	at _write (node:internal/streams/writable:501:10)
	at Writeable.write (node:internal/streams/writable:510:10)
	at console.value (node:internal/console/constructor:298:16)
	at console.warn (node:internal/console/constructor:405:26)
	at transport.writeFn (/opt/discord/resources/app.asar/node_modules/electron-log/src/node/transports/console.js:45:7)
	at transport (/opt/discord/resources/app.asar/node_modules/electron-log/src/node/transports/console.js:51:15)
	at Logger.processMessage (/opt/discord/resources/app.asar/node_modules/electron-log/src/core/Logger.js:175:11)

Anyone have any idea how I can troubleshoot this?

I also tried checking the following directory but it doesn’t exist on my PC:

/opt/discord/resources/app.asar/node_modules/electron-log/src/core/

I only have the file /opt/discord/resources/app.asar So obviously something is going on there that shouldn’t be happening.

I’ve got no idea how to troubleshoot node apps, so would appreciate any help from those of you who have those skills.

Thanks in advance! Please let me know if you need more info or need me to run commands and show you the output, and Ill do so.

  • gabmus@retrolemmy.com
    link
    fedilink
    arrow-up
    1
    ·
    31 minutes ago

    Could be drive failure, or maybe your package for discord is broken? I’d try discord flatpak even just as a troubleshooting step, but honestly that’s the preferred way to install these kinds of applications anyway

  • just_another_person@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    4 hours ago

    Read only filesystem is the problem, but we need more info to figure out what that means.

    Run ls -lh /opt and ls -lh /opt/discord and post the output of both here.

    Would also be good to check your drive for SMART errors in case it’s on its way out.

    • promitheas@programming.devOP
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      60 minutes ago
      $ ls -lh /opt
      total 36K
      drwxr-xr-x 7 root root 4.0K Nov 24 15:04 app1
      drwx--x--x 4 root root 4.0K Aug 15 16:43 containerd
      drwxr-xr-x 4 root root 4.0K Nov 25 17:00 discord
      drwxr-xr-x 5 root root 4.0K Nov 24 15:04 app2
      drwxr-xr-x 4 root root 4.0K Feb 25  2025 app3
      drwxr-xr-x 6 root root 4.0K Nov 24 15:04 app4
      drwxrwxrwx 6 root root 4.0K Nov 25 17:00 app5
      drwxr-xr-x 4 root root 4.0K Mar 20  2025 texlive
      drwxr-xr-x 4 root root 4.0K Jun  4 00:59 app6
      
      $ ls -lh /opt/discord
      total 216M
      -rw-r--r-- 1 root root 164K Nov 25 00:11 chrome_100_percent.pak
      -rw-r--r-- 1 root root 254K Nov 25 00:11 chrome_200_percent.pak
      -rwxr-xr-x 1 root root 1.5M Nov 25 00:11 chrome_crashpad_handler
      -rwsr-xr-x 1 root root  15K Nov 25 00:11 chrome-sandbox
      -rwxr-xr-x 1 root root 182M Nov 25 00:11 Discord
      -rw-r--r-- 1 root root  299 Nov 25 00:11 discord.desktop
      -rw-r--r-- 1 root root 6.9K Nov 25 00:11 discord.png
      -rw-r--r-- 1 root root  10M Nov 25 00:11 icudtl.dat
      -rw-r--r-- 1 root root 247K Nov 25 00:11 libEGL.so
      -rw-r--r-- 1 root root 3.9M Nov 25 00:11 libffmpeg.so
      -rw-r--r-- 1 root root 6.2M Nov 25 00:11 libGLESv2.so
      -rw-r--r-- 1 root root 4.6M Nov 25 00:11 libvk_swiftshader.so
      -rw-r--r-- 1 root root 600K Nov 25 00:11 libvulkan.so.1
      drwxr-xr-x 2 root root 4.0K Nov 25 17:00 locales
      drwxr-xr-x 3 root root 4.0K Nov 25 17:00 resources
      -rw-r--r-- 1 root root 5.8M Nov 25 00:11 resources.pak
      -rw-r--r-- 1 root root 333K Nov 25 00:11 snapshot_blob.bin
      -rw-r--r-- 1 root root 702K Nov 25 00:11 v8_context_snapshot.bin
      -rw-r--r-- 1 root root  107 Nov 25 00:11 vk_swiftshader_icd.json
      

      As for the drive, my root partition is on an NVME drive which should be fine considering its not even 3 years old.

      What info does this give you? As someone more experienced, what jumps out at you when looking at this (trying to improve my knowledge while troubleshooting - 2 for the price of 1 xD)

  • chrash0@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    4 hours ago

    error is right here:

    EROFS: read-only file system
    

    this line is concerning:

    At random times

    this sounds like a drive failure. Discord’s logger can’t write to the filesystem; it’s reporting as read-only.

    what’s the drive like where /opt lives?

    • promitheas@programming.devOP
      link
      fedilink
      arrow-up
      1
      ·
      1 hour ago

      As I mentioned replying to @[email protected], my root partition is on an NVME which is not even 3 years old yet, and I have not had any other problems with it apart from discord, so I don’t think its a drive failure issue, but better safe rather than sorry, so if you’d be so kind as to let me know how you’d like me to test/verify its health I’d appreciate it :)

      Is it possible that the read-only error occurs because the directory its trying to write to doesn’t exist (/opt/discord/resources/app.asar/node_modules/electron-log/src/core/ doesnt exist)? It may be a stupid question but as I said I’ve no idea how node works so consider me as having the intelligence of a rock when it comes to it

      • chrash0@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        26 minutes ago

        weird. i’d probably good around for drive checks personally, any test should be pretty definitive. how did you install Discord? the AUR? maybe a reinstall is in order.

        i don’t think this is Node specific. if i were writing logs, i’d want to be pretty sure they get written, either by creating the directories necessary, putting them in a place i was pretty dang sure existed, and/or crashing as early as possible if the location didn’t exist, which makes me think it’s a weird Discord config error.