Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lefterav opened this issue Jul 30, 2015 · 6 comments

Comments

@lefterav
Copy link
Collaborator

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?

@lefterav lefterav added the bug label Jul 30, 2015
@ondrejklejch
Copy link
Owner

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
Copy link
Collaborator Author

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
Copy link
Owner

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
Copy link
Collaborator Author

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 lefterav changed the title Cannot see pre-computed n-gram statistics Files created by watcher do not have g+w permission and prevent apache to read them Aug 3, 2015
@lefterav
Copy link
Collaborator Author

lefterav commented Aug 3, 2015

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

@ondrejklejch
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants