ondrejklejch / MT-ComparEval

Tool for comparison and evaluation of machine translation.
Apache License 2.0
56 stars 14 forks source link

Files created by watcher do not have g+w permission and prevent apache to read them #32

Closed lefterav closed 6 years ago

lefterav commented 9 years ago

I did a normal import of experiments. I included the precompute_ngrams: true in the config.neon of the task. The watcher reports N-grams precomputation done. Unfortunately when the user clicks on "Confirmed n-grams" they get

Unconfirmed n-grams can't be shown because they were not precomputed. If you really want to show unconfirmed n-grams, please, import these tasks with configuration option precompute_ngrams: true. 

I'm not sure if I am doing something wrong. Could you please instruct me on how to debug this?

ondrejklejch commented 9 years ago

I think that this is another problem with permissions as mentioned in #30. Please, check that the folder storage/precomputed_ngrams is not empty and change the persmissions of the files inside.

The problem is caused by running ./bin/watcher.sh with different user than www-data. Again, it should be solved by http://askubuntu.com/questions/365087/grant-a-user-permissions-on-www-data-owned-var-www.

lefterav commented 9 years ago

Indeed, this solved this issue. The contents and permissions of the directory are:

drwxrwxrwx 2 wizard www-data 4.0K Jul 30 16:49 .
-rw-r--r-- 1 wizard www-data  39K Jul 28 17:09 _%0043595d1637de676e1ea6f345ac8b1da6
drwxrwxrwx 3 wizard www-data 4.0K Jul 30 17:54 ..
-rw-r--r-- 1 wizard www-data  37K Jul 30 16:35 _%003a4b95a8a0ddc1d6147f8df23896512e
-rw-r--r-- 1 wizard www-data   71 Jul 30 14:54 .gitignore
-rw-r--r-- 1 wizard www-data  25K Jul 28 17:09 _%0057da418ec63ea9c75f89d628298f0876

after running chmod g+rwx

drwxrwxrwx 2 wizard www-data 4.0K Jul 30 16:49 .
-rw-rwxr-- 1 wizard www-data  39K Jul 28 17:09 _%0043595d1637de676e1ea6f345ac8b1da6
drwxrwxrwx 3 wizard www-data 4.0K Jul 30 17:54 ..
-rw-rwxr-- 1 wizard www-data  37K Jul 30 16:35 _%003a4b95a8a0ddc1d6147f8df23896512e
-rw-r--r-- 1 wizard www-data   71 Jul 30 14:54 .gitignore
-rw-rwxr-- 1 wizard www-data  25K Jul 28 17:09 _%0057da418ec63ea9c75f89d628298f0876

I am trying to understand where the advice form askubuntu applies, because in my case the directory has already the desired group ownership, the only problem is that there was no write access to the files. I used the command newgrp to make www-data the default group for my user wizard, but I don't know if this solves the problem. I will try to run a quick test and let you know if new data get the right chmod flag automatically, unless you know the answer already.

ondrejklejch commented 9 years ago

Because ./bin/watcher.sh should be run with the same user as is used by apache, or at least, they should be in the same group. So, I hope that it will work with your wizard user . If not, I will have to investigate it more.

lefterav commented 9 years ago

they are the same group. The problem is that when watcher writes files in the n_gram directory, they don't have the g+w permission.

lefterav commented 9 years ago

I created a cron job that runs manually g+rw in the directories temp/cache and storage/n_gram_precompute

ondrejklejch commented 9 years ago

Fixed in 1ea8b4bde30de4989fabfd6ec68abcee9caf564d. I'm sorry that I didn't know how to fix it immediately :)