oniony / TMSU

TMSU lets you tags your files and then access them through a nifty virtual filesystem from any other application.
Other
2.05k stars 119 forks source link

sqlite permissions issues "could not initialize database" #138

Open dessalines opened 6 years ago

dessalines commented 6 years ago

My use case is that I'm running a server, which I access via a gvfs mount. But when I try to initialize the DB, or add tags, or assign tags to files over this mount, I get the error above or related permissions errors.

I've tried using chmod 777 -R .tmsu to no avail.

I prefer using the GVFS mount, so that I can view pictures through my file manager, or ranger, but sqlite3 permissions which are attached to a user only on the host system makes tagging those files impossible.

Is tmsu really only limited to a single user?

oniony commented 6 years ago

On Wed, 16 May 2018, 19:15 Dessalines, notifications@github.com wrote:

My use case is that I'm running a server, which I access via a gvfs mount. But when I try to initialize the DB, or add tags, or assign tags to files over this mount, I get the error above or related permissions errors.

I've tried using chmod 777 -R .tmsu to no avail.

I prefer using the GVFS mount, so that I can view pictures through my file manager, or ranger, but sqlite3 permissions which are attached to a user only on the host system makes tagging those files impossible.

Is tmsu really only limited to a single system?

Hi, please see Allowing Other Users Access on https://github.com/oniony/TMSU/wiki/Virtual-Filesystem

You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/oniony/TMSU/issues/138, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAXBw5u-G_tLTMJODl1BObvFgWVQXTEks5tzGy8gaJpZM4UByyg .

dessalines commented 6 years ago

I would prefer to be able to use the tmsu commands from the command line, but even apart from that, I would have no problem with using VFS and just creating the directories like in the example, but it doesn't look like I can actually apply tags to files. My use case is really simple:

oniony commented 6 years ago

Is it not just a case then of getting the necessary permissions on the file for the user?

On Wed, 16 May 2018, 23:31 Dessalines, notifications@github.com wrote:

I would prefer to be able to use the tmsu commands from the command line, but even apart from that, I would have no problem with using VFS and just creating the directories like in the example, but it doesn't look like I can actually apply tags to files. My use case is really simple:

  • Server 1 has pictures on it, and a tmsu db for the Pictures folder initialized.
  • Computer 1 wants to view pictures (which I have using a GVFS / sftp mount), and tag them.
  • When doing this, I get a tmsu SQL error since Computer 1's user isn't allowed to insert rows to the sqlite3 DB created by Server 1's user.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/oniony/TMSU/issues/138#issuecomment-389686446, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAXB29ttvJLFoLGCvs1nB6O0D4x9APBks5tzKiygaJpZM4UByyg .

dessalines commented 6 years ago

Using chmod 777 -R .tmsu from original machine, and then trying to tag from the ssftp mount gives the error: tmsu: attempt to write a readonly database

oniony commented 6 years ago

I'm afraid I don't know how to help with this particular usage as I have not tried it myself.

The error suggests that your user does not have write permissions to the database, so it must be something that needs to be configured for sftp. Your above comment suggests you permissioned the directory .tmsu. Did you also permission the database file within?

dessalines commented 6 years ago

The -R of chmod makes it recursive. Its kind of a weird situation because although the sftp obviously requires me to login as my user correctly (and thus gives you permissions to create / edit files), I don't think your actually user changes on the command line. It kind of passes those file permissions to your local user. For whatever reason these perms aren't passed to the .tmsu DB (or maybe all sqlite dbs).

If you have a server anywhere you could test this bug out pretty quickly. Just do a sftp mount through macOS or Linux file browser, then try to create or tag something from a tmsu DB.