Overleaf will not let me edit documents

My YunoHost server

Hardware: Serveur KS-7 - Intel i3-2130 - 8GB DDR3 1333 MHz - 2To SATA
YunoHost version: 11.2.14.1 (stable)
I have access to my server : Through SSH
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
If your request is related to an app, specify its name and version: Overleaf 2024.06.02~ynh1

Description of my issue

I installed Overleaf through the Yunohost applications catalogue. I added an admin user. I made a domain overleaf.my-domain.tld and set the correct DNS records.
I start Overleaf by going to overleaf.my-domain.tld. I create a New Project. This gives an error:

Something went wrong. Please try again.

but refreshing the page shows that the project was created anyway. I try to open main.tex. This opens the document editing window, but then this error appears:

Sorry, something went wrong opening this document. Please try again.

The tex code side of the screen shows “loading”, but I’m stuck there.

I run the diagnosis tool of Yunohost. The Services status check reports one problem:

Service overleaf-document-updater is auto-restart :(

I click on Details, and then on the link to the service logs in the webadmin. The section journalctl shows this pattern:

Jun 12 14:39:08 systemd[1]: overleaf-document-updater.service: Main process exited, code=exited, status=1/FAILURE
Jun 12 14:39:08 systemd[1]: overleaf-document-updater.service: Failed with result 'exit-code'.
Jun 12 14:39:13 systemd[1]: overleaf-document-updater.service: Scheduled restart job, restart counter is at 33.
Jun 12 14:39:13 systemd[1]: Stopped overleaf document-updater.
Jun 12 14:39:13 systemd[1]: Started overleaf document-updater.
Jun 12 14:39:13 systemd[1]: overleaf-document-updater.service: Main process exited, code=exited, status=1/FAILURE
Jun 12 14:39:13 systemd[1]: overleaf-document-updater.service: Failed with result 'exit-code'.
Jun 12 14:39:18 systemd[1]: overleaf-document-updater.service: Scheduled restart job, restart counter is at 34.
Jun 12 14:39:18 systemd[1]: Stopped overleaf document-updater.
Jun 12 14:39:18 systemd[1]: Started overleaf document-updater.

and so on, in an infinite looop: the process fails, restarts after 5 seconds fails immediately, restarts 5 seconds later, etc.

The section /var/log/overleaf/document-updater.log shows this pattern (also repeatedly):

Node.js v18.20.2
Initializing metrics
Set UV_THREADPOOL_SIZE=16
Using default settings from /var/www/overleaf/live/services/document-updater/config/settings.defaults.js
Using settings from /var/www/overleaf/settings.js
node:events:495
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use 127.0.0.1:3003
    at Server.setupListenHandle [as _listen2] (node:net:1817:16)
    at listenInCluster (node:net:1865:12)
    at doListen (node:net:2014:7)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1844:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EADDRINUSE',
  errno: -98,
  syscall: 'listen',
  address: '127.0.0.1',
  port: 3003
}

I google the error EADDRINUSE; it’s supposedly caused by multiple processes listening to port 3003. I list the processes using the port using the command line:

lsof -i :3003

This reports nothing. I also try:

ps aux | grep 3003

This reports a process, which I try to kill with

kill <PID>

but this results in

No such process

At this point I run out of ideas, thinking that I need to invoke the help of more experienced hands than my own!

I knew this issue would arise one day :sweat_smile:
It will be difficult maintainance wise to prevent this.

What are your other installed apps?

Other apps installed: Nextcloud, Jellyfin, Webmin, Listmonk, Grav, Immich, Wordpress.

Okay, I think it’s because of Immich.

Try disabling its services and see if Overleaf can run?

Yes, that works! Great!
Is there a way to have both Immich and Overleaf running?

If you install first overleaf then Immich I think it should work.

Does that mean I first have to uninstall both, and then reinstall Overleaf, then Immich?

No just uninstalling immich and then reinstalling it should be enough

So stopping Immich made Overleaf work. Then I restarted Immich: overleaf kept working, but Immich was wholly unaccessible. Then yesterday diagnosis told me there was an update to overleaf, so I updated Overleaf to v 2024.06.10~ynh1. After doing that, Immich started working again, but now Overleaf no longer works. That would be consistent with the requirement that Overleaf has to be installed prior to Immich.

So my question is this: will I have to reinstall Immich each time there is an Overleaf update, since the update installs Overleaf after Immich?

Ah indeed, I think I have to register the ports in the package to make sure Yunohost will remember that Overleaf need it.

Instead of removing Immich, you may try something like:

yunohost app setting immich immich_machinelearning
It will output 3003 normally.

Then you do

yunohost app setting immich immich_machinelearning --value 3011 or some other value which is not yet attributed.

And finally yunohost app upgrade immich --force.

And this should fix the issue at each upgrade.

This didn’t output anything.
The other steps went well, but the final upgrade generated quite a few errors:

root@cloud:/home/guido# yunohost app upgrade immich --force
Info: Now upgrading immich…
Info: Creating a safety backup prior to the upgrade
Info: Collecting files to be backed up for immich…
Info: Declaring files to be backed up...
Info: /home/yunohost.app/immich will not be saved, because 'BACKUP_CORE_ONLY' is set.
Info: Backing up a PostgreSQL database...
Info: Backup script completed for immich. (YunoHost will then actually copy those files to the archive).
Info: Creating a backup archive from the collected files…
Info: The archive will contain about 3.1GB of data.
Success! Backup created: immich-pre-upgrade1
Success! Backup deleted: immich-pre-upgrade2
Info: Updating sources...
Info: Updating ports...
Info: Updating system_user...
Info: Updating install_dir...
Info: Updating data_dir...
Info: Updating permissions...
Info: Updating apt...
Info: Updating database...
Info: [+...................] > Stopping a systemd service...
Info: [#++.................] > Upgrading source files...
Info: '/var/www/immich/source' wasn't deleted because it doesn't exist.
Info: [###+................] > Check Python version & compile the required one if needed...
Info: Using already used python3 built version...
Info: [####++..............] > Installing nodejs...
Info: [######+++++++.......] > Making install...
Info: [#############++.....] > Updating immich's configuration files...
Info: [###############+....] > Upgrading system configurations related to immich...
Info: The service fail2ban has correctly executed the action reload-or-restart.
Info: [################++..] > Starting a systemd service...
Warning: (this may take some time)
Info: The service immich-microservices has correctly executed the action start.
Warning: (this may take some time)
Warning: The service immich-machine-learning didn't fully executed the action start before the timeout.
Warning: Please find here an extract of the end of the log of the service immich-machine-learning:
Warning: Jun 15 11:09:28 systemd[1]: immich-machine-learning.service: Main process exited, code=exited, status=1/FAILURE
Warning: Jun 15 11:09:28 systemd[1]: immich-machine-learning.service: Failed with result 'exit-code'.
Warning: Jun 15 11:09:28 systemd[1]: immich-machine-learning.service: Scheduled restart job, restart counter is at 48.
Warning: Jun 15 11:09:28 systemd[1]: Stopped Immich machine-learning.
Warning: Jun 15 11:09:28 systemd[1]: Started Immich machine-learning.
Warning: Jun 15 11:09:34 systemd[1]: immich-machine-learning.service: Main process exited, code=exited, status=1/FAILURE
Warning: Jun 15 11:09:34 systemd[1]: immich-machine-learning.service: Failed with result 'exit-code'.
Warning: Jun 15 11:09:34 systemd[1]: immich-machine-learning.service: Scheduled restart job, restart counter is at 49.
Warning: Jun 15 11:09:34 systemd[1]: Stopped Immich machine-learning.
Warning: Jun 15 11:09:34 systemd[1]: Started Immich machine-learning.
Warning: Jun 15 11:09:40 systemd[1]: immich-machine-learning.service: Main process exited, code=exited, status=1/FAILURE
Warning: Jun 15 11:09:40 systemd[1]: immich-machine-learning.service: Failed with result 'exit-code'.
Warning: Jun 15 11:09:40 systemd[1]: immich-machine-learning.service: Scheduled restart job, restart counter is at 50.
Warning: Jun 15 11:09:40 systemd[1]: Stopped Immich machine-learning.
Warning: Jun 15 11:09:40 systemd[1]: Started Immich machine-learning.
Warning: Jun 15 11:09:46 systemd[1]: immich-machine-learning.service: Main process exited, code=exited, status=1/FAILURE
Warning: Jun 15 11:09:46 systemd[1]: immich-machine-learning.service: Failed with result 'exit-code'.
Warning: Jun 15 11:09:46 systemd[1]: immich-machine-learning.service: Scheduled restart job, restart counter is at 51.
Warning: Jun 15 11:09:46 systemd[1]: Stopped Immich machine-learning.
Warning: Jun 15 11:09:46 systemd[1]: Started Immich machine-learning.
Warning: \-\-\-
Warning: [2024-06-15 11:09:44 +0000] [767685] [ERROR] Connection in use: ('127.0.0.1', 3003)
Warning: [2024-06-15 11:09:44 +0000] [767685] [ERROR] Retrying in 1 second.
Warning: [2024-06-15 11:09:45 +0000] [767685] [ERROR] Connection in use: ('127.0.0.1', 3003)
Warning: [2024-06-15 11:09:45 +0000] [767685] [ERROR] Retrying in 1 second.
Warning: [2024-06-15 11:09:46 +0000] [767685] [ERROR] Can't connect to ('127.0.0.1', 3003)
Warning: [2024-06-15 11:09:46 +0000] [767709] [INFO] Starting gunicorn 22.0.0
Warning: [2024-06-15 11:09:46 +0000] [767709] [ERROR] Connection in use: ('127.0.0.1', 3003)
Warning: [2024-06-15 11:09:46 +0000] [767709] [ERROR] Retrying in 1 second.
Warning: [2024-06-15 11:09:47 +0000] [767709] [ERROR] Connection in use: ('127.0.0.1', 3003)
Warning: [2024-06-15 11:09:47 +0000] [767709] [ERROR] Retrying in 1 second.
Warning: [2024-06-15 11:09:48 +0000] [767709] [ERROR] Connection in use: ('127.0.0.1', 3003)
Warning: [2024-06-15 11:09:48 +0000] [767709] [ERROR] Retrying in 1 second.
Warning: [2024-06-15 11:09:49 +0000] [767709] [ERROR] Connection in use: ('127.0.0.1', 3003)
Warning: [2024-06-15 11:09:49 +0000] [767709] [ERROR] Retrying in 1 second.
Warning: [2024-06-15 11:09:50 +0000] [767709] [ERROR] Connection in use: ('127.0.0.1', 3003)
Warning: [2024-06-15 11:09:50 +0000] [767709] [ERROR] Retrying in 1 second.
Warning: [2024-06-15 11:09:51 +0000] [767709] [ERROR] Can't connect to ('127.0.0.1', 3003)
Warning: [2024-06-15 11:09:52 +0000] [767744] [INFO] Starting gunicorn 22.0.0
Warning: [2024-06-15 11:09:52 +0000] [767744] [ERROR] Connection in use: ('127.0.0.1', 3003)
Warning: [2024-06-15 11:09:52 +0000] [767744] [ERROR] Retrying in 1 second.
Info: The service immich-server has correctly executed the action start.
Info: [####################] > Upgrade of immich completed
Success! immich upgraded
Success! Upgrade complete

my bad, I wanted to say yunohost app setting immich port_machinelearning

1 Like

Ok, this time it worked without any errors—and both Immich and Overleaf appear to be working fine. Thanks so much!

Since a few days, Overleaf has stopped working again. When opening a project, the tex code loads, but it doesn’t compile. There is a generic error that “something went wrong” and a suggestion to “try again”, but nothing useful beyond that.

Please share your logs

What logs exactly, and where do I find them? If I go into the Yunohost administration web interface > Tools > Services, I see 12 services running that are related to Overleaf. I just checked them all quickly but the journalctl section of those reveals no entries more recent than June 15, and nothing that seems to point to an error.

Okay, could you then please try an upgrade:

yunohost app upgrade overleaf --force

Do you have an idea of something you have done which leads to this error?

I installed Navidrome and Airsonic-advanced on my server, and removed those again, since they didn’t suit my needs.

Reinistalling Overleaf seems to have done the trick, though, thank you so much!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.