LibreOffice Writer "Write Error: The file could not be written"

After the most recent update, I can’t open any of my .odt documents anymore, with Writer showing the error in the title, and then immediately closing.

All other searches I’ve found online mostly refer to stuff involving antivirus software on Windows, which obviously isn’t a problem for me.

I would rather not lose access to all of my documents, what can I do to fix this?

Not sure what “this” is, yet :slight_smile:

  1. Can you just start libreoffice --writer?
  2. Can you just create a new odt file and save it?
  3. Could try, under the Help menu there is a menu item, “Restart in Safe Mode”.

  1. What is the specific “error in the title” that you mentioned?
  2. If you start libreoffice YourFile.odt from the XFCE terminal, are there any error messages?
  3. Check ~/.xsession-errors and the journalctl -b for any errors that may be applicable.
  1. This command worked to open the program. However…
  2. Trying to save once again brought up the same error
  3. It didn’t really want to do this for some reason and crashed

  1. As in the error in the title of the thread: “Write Error: the file could not be written”
  2. Negative, same error.
  3. I tried reading that .xsession errors log and that is way above my level, I can’t understand all the little codes and so on and can’t really decipher what it all means. I couldn’t find journalctl-b

The first thing that comes to my mind is, are you running out of disk space or is there a permission problem on the directory where you are trying to store the file.

journalctl is the command and -b is the option which says view the last boot (-b is the same as -b 0). The system log is called the journal. I tend to lean toward a permission problem, because you’d be having a lot more issues if it were space, but :person_shrugging:

# check directory permissions
ls -ld DirectoryWhereStoringOdtFile

# check disk space
1 Like

It’s definitely not a disk space thing, none of my drives are even close to full, I’m rather stingy with drive space.

OK, well I ran that command…And that feels even less readable than that log…I’m really not sure what I am looking for in either of these…

For a test, I copied the document to my laptop which also runs Manjaro, and it opens just fine, so the issue is clearly not a problem with the document itself, and is isolated to my desktop.

Which version of libreoffice?

Have you tried with a fresh libreoffice profile? Maybe the profile is corrupted? Backup the curent profile, then remove it and let libreoffice create a new one.

Other things to try:
Try turning off hardware acceleration in Tools- Options-View
Uncheck "Use OpenCL

Do you have any extensions installed that may be causing an issue?

1 Like

Try open with Onlyoffice. You probably already have Onlyoffice on your computer. I think it can open .odt files.

You did not lose access :wink: (you where able to copy them)

What libreoffice does, when you try to open a file, is:

  • It tries to create a backup of the file

As of an yet unknown reason libreoffice is not able to write to the directory you are using. Therefore it fails to “open” the file because it can´t create the backup-copy.

Some possible reasons:

  • permission-problem at the place where the file lies (create + write + modify)
  • path-problem (in libreoffice) where libreoffice thinks it wants to place the backups
  • permission-problem in the backup-path (create + write)

What you should test:

  • Are you able to create a (not empty) file next to your odt-files ?
  • Is the backup-path in libreoffice really correct (typo) ?
  • Are you able to create a (not empty) file where the backup-path points to ?
1 Like

According to the program itself:

Version: / LibreOffice Community
Build ID: 40(Build:2)
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.utf8); UI: en-US
Calc: threaded

How would I go about backing up the current profile and removing it? I’m not quite sure what a profile is in this context

I don’t think I use any extensions? When it comes to office software, I kinda just use it as is

This is a good insight, I understand a little better why it’s a “write” issue when trying to open something.

The file is saved in my documents folder, the one generated by Linux by default, and I use this folder all the time without issue.

…this is interesting…

So just for sanity’s sake, I tried saving a test document in my documents folder, and the error happened as it always does, and the program crashed, but then I checked my documents folder, and the file HAD saved successfully. I just can’t open it to verify if it actually saved anything into the document or not…

This is strange.

Your profile is located in your home folder /home/your_user_name/.config/libreoffice/4/

The more I think about it, I also think it is a permissions issue. Does the same issue occur in calc?
Can you save a file created with libreoffice to a usb drive?

I found a file in that folder called .lock dated April 6th, is that supposed to be there?

So I tried saving a test document to a USB drive, and it had the same behavior as I noted earlier, where the error came up, but the save did seem to go through anyway.

no .lock isn’t there in my LO profile.

When you open a file for editing, which is what happens unless you open a file for
viewing, lock files are created. One is created in the folder that the opened file is in and in the format .~lock.filename.odt# and one in the user profile as .lock.

These files are to prevent another instance of LO opening and editing the same file.
The lock files are automatically deleted when the file is closed.

It is possible that LO crashed on April 6th and the file in your configuration folder was not deleted. You can possibly check the crash folder in your config if that was the case.

I would troubleshoot by checking owner/permissions on your Documents folder and any others that you would save files in. I would also start with a clean, fresh config folder (profile) Just rename the current config folder and when you launch LO it will create a fresh one.

1 Like

OK, so this is strange…

I was about to try and rename that folder and delete the .lock file and all that, when I had this thought. I tried opening another random document in that folder, an older one that I hadn’t tried previously, rather then just trying to open the same exact one each time, and that one had very similar behavior, except the error was different, something about a .tmp folder or something? Then the screen flashed a bit…and now everything works…

I opened that document, then the one I wanted to open, and it all just works totally normally now…and I have not the faintest idea why…

I think the only thing more frustrating then having a problem I can’t solve is a problem solving itself and not knowing how or why it happened or how to fix it in the future…

Well this is anti climactic and a little embarrassing. Thank you to everyone who tried to help, I’ll definitely come back here if it starts acting up again.