Azure / azure-data-lake-store-python

Microsoft Azure Data Lake Store Filesystem Library for Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue when reading and writing to ADLS with correct SPN credentials

alxdru opened this issue · comments

Description

Outline the issue here:
Whenever I try to list contents of the folder for which I've received SPN credentials or store a file on it. I receive below output by the logger:

Request done on listing
"GET /mypath?OP=LISTSTATUS&api-version=2018-09-01&listSize=4000 HTTP/1.1" 401 None

Request done on storing
"GET /mypath/file.csv?OP=GETFILESTATUS&api-version=2018-09-01 HTTP/1.1" 401 None

Also api exception is thrown:
File "C:\Python3\lib\site-packages\azure\datalake\store\core.py", line 168, in ls
files = self._ls(path, invalidate_cache)
File "C:\Python3\lib\site-packages\azure\datalake\store\core.py", line 145, in _ls
self.dirs[key] = self._ls_batched(key, batch_size=batch_size)
File "C:\Python3\lib\site-packages\azure\datalake\store\core.py", line 126, in _ls_batched
ls_call_result = self.azure.call('LISTSTATUS', path, **parms)
File "C:\Python3\lib\site-packages\azure\datalake\store\lib.py", line 454, in call
self.log_response_and_raise(response, err, level=exception_log_level)
File "C:\Python3\lib\site-packages\azure\datalake\store\lib.py", line 349, in log_response_and_raise
raise exception
azure.datalake.store.exceptions.DatalakeRESTException: Data-lake REST exception: LISTSTATUS, mypath


Reproduction Steps

** Enumerate the steps to reproduce the issue here:**
In my Python script I get the token using lib.auth.
With this token I create the client.
With the client I execute an ls and a put.

Environment summary

SDK Version: What version of the SDK are you using? (pip show azure-datalake-store)
Answer here: 0.0.51

Python Version: What Python version are you using? Is it 64-bit or 32-bit?
Answer here: 64bit Python 3.8.2

OS Version: What OS and version are you using?
Answer here: Tested on both SUSE Enterprise 12.3 and Windows 10

Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: Tested on bash and cmd as well

It seems that issue was not so complex. Just missed a '/' in the resource name.
Will close this.