+1 vote
805 views

Hello,

I installed Collaboration Server 1.2.1 on Ubuntu 20.04 successfully.
However, I get a 500 error after a user, team, or group creation command.

The error message indicates that access to the database is read-only.

extract of the error message:
Caused by: java.sql.SQLException: An SQL data change is not permitted for a read-only connection, user or database.

How to check the database access rights?
How to change access rights?

Thank you for your help.

Sincerely

Christophe

Installed versions:

  • Ubuntu Server 20.04 LTS
  • open-jdk8
  • Tomcat9
  • elasticsearch 6
in LCA Collaboration Server by (370 points)

2 Answers

0 votes
by (7.5k points)
 
Best answer

For users wanting to set it up with tomcat9:

Tomcat9 is sandboxed and has no access to the filesystem, to enable access to /opt/collab you need to create a file /etc/systemd/system/tomcat9.service.d/override.conf containing:

[Service]

ReadWritePaths=/opt/collab

and then run

systemctl daemon-reload

systemctl restart tomcat9

0 votes
by (7.5k points)
The tomcat user must own the collaboration server directory (e.g. /opt/collab) and all its child directories. Maybe that is the issue?
by (370 points)
Hello,

I know, it's stated in your documentation. http://www.openlca.org/collaboration-server-installation-guide
I executed the command sudo chown tomcat:tomcat /opt/collab/ -R and increased the read and write permissions on the folder.
I always get the same mistake.

Christophe
by (7.5k points)
I did not yet install on Ubuntu 20 with tomcat 9 - but when I ran into issues with read-only database it was always a problem about permissions with the directories - can you run "cut -d: -f1 /etc/passwd" to see if the user is correct? with tomcat 8 the user was "tomcat8" instead of "tomcat"
by (370 points)
With Tomcat9 on Ubuntu 20.4, there is not tomcat8 user but tomcat only.
So, I created tomcat8 uerr,  added it to tomcat group, and added good rights (rwx) to /opt/collab directory.

drwxrwxrwx  5 tomcat tomcat     4096 Jun 18 11:19 collab/

But i get same error "An SQL data change is not permitted for a read-only connection, user or database."
by (7.5k points)
I don't really have another idea right now, why you can't access the data, maybe it has something to do with tomcat9 differences in access rights, as I mentioned, we have developed the CS to work with tomcat8 so far and did not yet test (and possibly migrate) to tomcat9.

If you are able to use the specified version in the documentation I'd recommend that for now, until we had the chance to test the CS with the newer version available.
by (370 points)
The problem comes from the Ubuntu and Tomcat versions.
I retested with Ubuntu 18.04 and Tomcat8, everything is OK.
Thanks for everything
by (7.5k points)
Meanwhile I also had this issue with tomcat9, there is a change in tomcat, it is now sandboxed and has no default access to the filesystem. I will create an updated documentation for tomcat9

https://stackoverflow.com/questions/56827735/how-to-allow-tomcat-war-app-to-write-in-folder
...