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.

fetch_archive_from_http: Permission Denied on Windows

See original GitHub issue

Describe the bug It throws a Permission Denied error after downloading zip file from provided url and tries to write it on temp directory.

Error message

  File "c:\Users\victo\UEA\PAIC\deepset-ai-haystack\abc.py", line 19, in <module>
    zip_archive = zipfile.ZipFile(temp_file.name, mode="w")
  File "C:\Users\victo\AppData\Local\Programs\Python\Python38\lib\zipfile.py", line 1251, in __init__
    self.fp = io.open(file, filemode)
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\victo\\AppData\\Local\\Temp\\tmpck_925zs'

Expected behavior Download the file and unzip it correctly

Additional context Following official guide

Dependencies

alembic==1.4.3
aniso8601==8.1.0
appdirs==1.4.4
astroid==2.4.2
attrs==20.3.0
autopep8==1.5.4
boto3==1.16.48
botocore==1.19.48
certifi==2020.12.5
chardet==4.0.0
click==7.1.2
cloudpickle==1.6.0
colorama==0.4.4
coverage==5.3.1
databricks-cli==0.14.1
decorator==4.4.2
dill==0.3.3
distlib==0.3.1
docker==4.4.1
dotmap==1.3.0
elastic-apm==5.10.0
elasticsearch==7.10.0
entrypoints==0.3
farm==0.5.0
farm-haystack==0.6.0
fastapi==0.63.0
filelock==3.0.12
Flask==1.1.2
Flask-Cors==3.0.9
flask-restplus==0.13.0
future==0.18.2
gitdb==4.0.5
GitPython==3.1.11
gunicorn==20.0.4
h11==0.12.0
h5py==3.1.0
httptools==0.1.1
idna==2.10
isort==5.7.0
itsdangerous==1.1.0
Jinja2==2.11.2
jmespath==0.10.0
joblib==1.0.0
jsonschema==3.2.0
Keras==2.4.3
langdetect==1.0.8
lazy-object-proxy==1.4.3
lxml==4.6.2
Mako==1.1.3
MarkupSafe==1.1.1
mccabe==0.6.1
mlflow==1.0.0
more-itertools==8.6.0
networkx==2.5
nltk==3.5
numpy==1.19.3
packaging==20.8
pandas==1.2.0
pluggy==0.13.1
protobuf==3.14.0
psutil==5.8.0
py==1.10.0
pycodestyle==2.6.0
pydantic==1.7.3
pylint==2.6.0
pyparsing==2.4.7
pyrsistent==0.17.3
python-dateutil==2.8.1
python-docx==0.8.10
python-editor==1.0.4
python-multipart==0.0.5
pytz==2020.5
pywin32==227
PyYAML==5.3.1
querystring-parser==1.2.4
regex==2020.11.13
requests==2.25.1
s3transfer==0.3.3
sacremoses==0.0.43
scikit-learn==0.24.0
scipy==1.6.0
sentencepiece==0.1.94
seqeval==0.0.12
simplejson==3.17.2
six==1.15.0
sklearn==0.0
smmap==3.0.4
SQLAlchemy==1.3.22
SQLAlchemy-Utils==0.36.8
sqlparse==0.4.1
starlette==0.13.6
tabulate==0.8.7
threadpoolctl==2.1.0
tika==1.24
tokenizers==0.8.1rc2
toml==0.10.2
torch==1.6.0+cu101
tox==3.20.1
tqdm==4.55.1
transformers==3.3.1
urllib3==1.26.2
uvicorn==0.13.3
virtualenv==20.2.2
websocket-client==0.57.0
Werkzeug==0.16.1
wrapt==1.12.1

To Reproduce

from haystack.retriever.sparse import ElasticsearchRetriever
from haystack.document_store.elasticsearch import ElasticsearchDocumentStore
from haystack import Finder
from haystack.preprocessor.cleaning import clean_wiki_text
from haystack.preprocessor.utils import convert_files_to_dicts, fetch_archive_from_http
from haystack.reader.farm import FARMReader
from haystack.reader.transformers import TransformersReader
from haystack.utils import print_answers

import os
import time
from subprocess import Popen, PIPE, STDOUT

# In Colab / No Docker environments: Start Elasticsearch from source
es_server = Popen(['./elasticsearch-7.10.1/bin/elasticsearch.bat'],
                  stdout=PIPE, stderr=STDOUT,
                  )

# wait until ES has started
time.sleep(0)

# Connect to Elasticsearch
document_store = ElasticsearchDocumentStore(
    host="localhost", username="", password="", index="document")

# Let's first fetch some documents that we want to query
# Here: 517 Wikipedia articles for Game of Thrones
doc_dir = "./data/article_txt_got"
s3_url = "https://s3.eu-central-1.amazonaws.com/deepset.ai-farm-qa/datasets/documents/wiki_gameofthrones_txt.zip"
fetch_archive_from_http(url=s3_url, output_dir=doc_dir)

System:

  • OS: WIndows 10 - Version 20H2
  • GPU/CPU: CPU: AMD Ryzen 7 3750H with Radeon Vega Mobile Gfx / GPU: Geforce GTX 1660 Ti
  • Haystack version (commit or version number): 0.6.0
  • DocumentStore: Elasticsearch
  • Reader: TransformersReader
  • Retriever: ElasticsearchRetriever

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
Rob192commented, Jan 11, 2021

Thank you very much for your help !

2reactions
julian-rischcommented, Jan 11, 2021

Great to hear that. 👍 Yes, I will update the tutorials accordingly and close the issue afterwards.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Access Denied" or other errors when you access or work with ...
Discusses how to troubleshoot problems that occur when you try to access or work with files and folders in Windows.
Read more >
Handle Permission Denied Error in windows Python
You need to provide the full path to the copy destination, not just to the destination directory
Read more >
Windows 10 "Access Denied" Folder Errors: 5 Easy Fixes
Seeing "access is denied" in Windows 10 or 11 when you try to access certain folders or files? Here are several ways to...
Read more >
Getting the Access denied Windows 11 error? Try these fixes!
Snap! Getting the Access denied Windows 11 error? Try these fixes!This small issue can be very annoying at times, but don't worry!
Read more >
How to Fix Folder "Access Denied" Errors in Windows - YouTube
Available in text form here: https://www.makeuseof.com/tag/fix- access - denied -folders- windows -10/It's always interesting when Windows tells ...
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