Project

General

Profile

Actions

Question #7275

closed

Could not write technique 'create_dir'

Added by Francois BAYART about 7 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
N/A
Category:
Web - Technique editor
Target version:
Regression:

Description

I have an error with ncf editor and I don't know how to fix it or in which direction to check. I have this problem only on my production server and not on test (...) so I would like to find a solution.

When I click on techniques editor and create a simple techniques with 1 method like "create a directory" I get this message :

"An Error occured! Could not write technique 'create_dir' from path /var/rudder/configuration-repository/ncf, cause is: Error while running post-hook command [u'/var/rudder/configuration-repository/ncf/ncf-hooks.d/post.write_technique.rudderify.sh', u'/var/rudder/configuration-repository/ncf', u'create_dir']
Details: INFO: Alternative source path added: /var/rudder/configuration-repository/ncf Error: Unable to create Rudder Technique files related to ncf Technique create_dir ([Errno 13] Permission denied: '/var/rudder/configuration-repository/techniques/ncf_techniques/create_dir/1.0') Traceback (most recent call last): File "/usr/share/ncf/tools/ncf_rudder.py", line 46, in write_one_technique_for_rudder write_technique_for_rudder(destination_path, metadata) File "/usr/share/ncf/tools/ncf_rudder.py", line 120, in write_technique_for_rudder os.makedirs(path) File "/usr/lib/python2.7/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 13] Permission denied: '/var/rudder/configuration-repository/techniques/ncf_techniques/create_dir/1.0'"

I don't know if the problem is new or old, I have discovered this when I was importing a new NCF techniques over API. I have make an error during the import I wrote "techniques" instead of "technique" in JSON header { "path" : "/var/rudder/configuration-repository/ncf",
"*technique*": {

Could be the source of problem ?


Files

2015-10-13_16-03-08.png (222 KB) 2015-10-13_16-03-08.png Francois BAYART, 2015-10-13 16:12
Actions #1

Updated by Vincent MEMBRÉ about 7 years ago

  • Category set to Web - Technique editor
  • Status changed from New to Discussion
  • Assignee set to Francois BAYART
  • Target version set to 3.0.10

Thanks François for reporting your issue!

Maybe rights on your directory /var/rudder/configuration-repository/ncf_techniques are not ok

it should be 775 and be owned by group 'rudder'

besides user 'ncf-api-venv' should be in group 'rudder'

Actions #2

Updated by Francois BAYART about 7 years ago

Vincent MEMBRÉ wrote:

Thanks François for reporting your issue!

Maybe rights on your directory /var/rudder/configuration-repository/ncf_techniques are not ok

I suppose you talk about /var/rudder/configuration-repository/techniques/ncf_techniques

it should be 775 and be owned by group 'rudder'

On my production and test server the acl are not 775:
drwxrws--- 6 ncf-api-venv rudder 4096 Oct 13 16:02 /var/rudder/configuration-repository/techniques/ncf_techniques

besides user 'ncf-api-venv' should be in group 'rudder'

yes it is
groups ncf-api-venv
ncf-api-venv : ncf-api-venv rudder

Actions #3

Updated by Vincent MEMBRÉ about 7 years ago

Francois BAYART wrote:

Vincent MEMBRÉ wrote:

Maybe rights on your directory /var/rudder/configuration-repository/ncf_techniques are not ok

I suppose you talk about /var/rudder/configuration-repository/techniques/ncf_techniques

You are right :)

it should be 775 and be owned by group 'rudder'

On my production and test server the acl are not 775:
drwxrws--- 6 ncf-api-venv rudder 4096 Oct 13 16:02 /var/rudder/configuration-repository/techniques/ncf_techniques

Ok they seems ok (the 5 is not mandatory ...) Maybe another subdirectory of ncf_techniques don't have correct permissions

You can also run the following command as user ncf-api-venv, maybe you will have more insights:

/var/rudder/configuration-repository/ncf/ncf-hooks.d/post.write_technique.rudderify.sh /var/rudder/configuration-repository/ncf create_dir
Actions #4

Updated by Francois BAYART about 7 years ago

Vincent MEMBRÉ wrote:

You can also run the following command as user ncf-api-venv, maybe you will have more insights:

[...]

I have an error


ncf-api-venv@pm001:~$ /var/rudder/configuration-repository/ncf/ncf-hooks.d/post.write_technique.rudderify.sh /var/rudder/configuration-repository/ncf create_dir
INFO: The /var/rudder/configuration-repository/techniques/ncf_techniques/category.xml file already exists. Not updating.
INFO: Alternative source path added: /var/rudder/configuration-repository/ncf
Error: Unable to create Rudder Technique files related to ncf Technique create_dir ([Errno 13] Permission denied: '/var/rudder/configuration-repository/techniques/ncf_techniques/create_dir/1.0')
Traceback (most recent call last):
  File "/usr/share/ncf/tools/ncf_rudder.py", line 46, in write_one_technique_for_rudder
    write_technique_for_rudder(destination_path, metadata)
  File "/usr/share/ncf/tools/ncf_rudder.py", line 120, in write_technique_for_rudder
    os.makedirs(path)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/var/rudder/configuration-repository/techniques/ncf_techniques/create_dir/1.0'

ERROR: An error happened in /var/rudder/configuration-repository/ncf/ncf-hooks.d/post.write_technique.rudderify.sh during the step: Creating rudder technique "create_dir" from ncf technique

And the directory create_dir have strange rights:

d-w--wS--- 2 ncf-api-venv rudder 4096 Oct 13 16:02 /var/rudder/configuration-repository/techniques/ncf_techniques/create_dir/

My umask for ncf-api-venv is 0022 (in production and test)

Actions #5

Updated by Francois BAYART about 7 years ago

  • % Done changed from 0 to 100

problem come from an old test (before to have a test server) where I have played with umask in "ncf/ncf-hooks.d/post.write_technique.commit.sh" and "ncf/ncf-hooks.d/post.write_technique.rudderify.sh"

I have restored the umask and all is OK now.

thx

Actions #6

Updated by Vincent MEMBRÉ about 7 years ago

  • Tracker changed from Bug to Question
  • Status changed from Discussion to Resolved

Great! Thanks François for your feedback !

Actions

Also available in: Atom PDF