question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Permission denied error on model upload

See original GitHub issue

Rasa version: 1.2.2 Rasa X version (if used & relevant): 0.20.1 Python version: 3.6 Operating system (windows, osx, …): Ubuntu 18.04 and CentOS 7.6

Issue: I am trying to upload a model via Rasa-x on two different installations, one on Ubuntu and the other on CentOS, both are throwing the same error of permission denied.

Error:

rasa-x_1           | Exception occurred while handling uri: 'http://localhost/api/projects/default/models?api_token=3518637d2fc37ac6eb504894e749e64105f5ca1e'
rasa-x_1           | Traceback (most recent call last):
rasa-x_1           |   File "/usr/local/lib/python3.6/shutil.py", line 550, in move
rasa-x_1           |     os.rename(src, real_dst)
rasa-x_1           | OSError: [Errno 18] Invalid cross-device link: '/tmp/tmpkpa18idb/model.tar.gz' -> '/app/models/model.tar.gz'
rasa-x_1           | 
rasa-x_1           | During handling of the above exception, another exception occurred:
rasa-x_1           | 
rasa-x_1           | Traceback (most recent call last):
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 917, in handle_request
rasa-x_1           |     response = await response
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/rasax/community/api/decorators.py", line 176, in decorated_function
rasa-x_1           |     return await await_and_return_response(args, kwargs, request)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/rasax/community/api/decorators.py", line 106, in await_and_return_response
rasa-x_1           |     response = await response
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/rasax/community/api/blueprints/models.py", line 55, in upload_model
rasa-x_1           |     saved = await model_service.save(project_id, model_name, tpath)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/rasax/community/services/model_service.py", line 164, in save
rasa-x_1           |     stored_path = self._store_zipped_model(model_name, path)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/rasax/community/services/model_service.py", line 264, in _store_zipped_model
rasa-x_1           |     shutil.move(file_path, zpath)
rasa-x_1           |   File "/usr/local/lib/python3.6/shutil.py", line 564, in move
rasa-x_1           |     copy_function(src, real_dst)
rasa-x_1           |   File "/usr/local/lib/python3.6/shutil.py", line 263, in copy2
rasa-x_1           |     copyfile(src, dst, follow_symlinks=follow_symlinks)
rasa-x_1           |   File "/usr/local/lib/python3.6/shutil.py", line 121, in copyfile
rasa-x_1           |     with open(dst, 'wb') as fdst:
rasa-x_1           | PermissionError: [Errno 13] Permission denied: '/app/models/model.tar.gz'

Command or request that led to error:

Rasa X - Model Upload UI

Content of configuration file (config.yml) (if relevant):

# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: "en"

pipeline:
- name: "SpacyNLP"
- name: "SpacyTokenizer"
- name: "SpacyFeaturizer"
- name: "RegexFeaturizer"
- name: "CRFEntityExtractor"
- name: "EntitySynonymMapper"
- name: "SklearnIntentClassifier"

# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
  - name: MemoizationPolicy
  - name: KerasPolicy
  - name: MappingPolicy
  - name: TwoStageFallbackPolicy
    nlu_threshold: 0.3
    core_threshold: 0.3
    fallback_core_action_name: "action_default_fallback"
    fallback_nlu_action_name: "action_default_fallback"
    deny_suggestion_intent_name: "out_of_scope"

Content of domain file (domain.yml) (if relevant):

intents:
- impact
- inform
- greet
entities:
- above_below
- operation
- period
templates:
...
slots:
...

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
erohmensingcommented, Sep 2, 2019

@dhwanils95 are you sure that you ran the permission commands in step 10 (also 11?)

So for e.g. the models folder, you would run

sudo chgrp -R root /etc/rasa/models && sudo chmod -R 770 /etc/rasa/models

Can you check the permissions of the directory and post them here?

1reaction
dhwanils95commented, Sep 6, 2019

Hey @erohmensing ,

So, I had changed the permission of the directory but the docker user which ran the containers was different and was not in the group with the same permissions and hence it was throwing that error. Your solution pointed me to the right direction to check out that and I was able to solve it.

Closing the issue. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Permission Denied error with Django while uploading a file
Try checking the permissions on each directory in the path starting at /. Just a thought.
Read more >
Troubleshoot AWS Glue job returning 403 access denied error
My AWS Glue job returns the 403 Access Denied error when the job tries to read/write into an Amazon Simple Storage Service (Amazon...
Read more >
Permission Denied error on uploading an image through a ...
Issue: Hitting the "Upload" button results in a permission denied error. We cannot convert the final CGI (that uploads it to TeamSite and...
Read more >
[Django] #32413: File upload permission denied error on ...
Hi, if an uploaded file exceeds the DATA_UPLOAD_MAX_MEMORY_SIZE of 2.5 mb, django starts streaming the file data to a file in /tmp. When ......
Read more >
"Access Denied" or other errors when you access or work with ...
The folder ownership has changed. You do not have the appropriate permissions. The file is encrypted. ... You may not have ownership of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found