2017-10-11 52 views
0

我試圖上傳一些文件到ADLS中的特定文件夾。下面是我用來上傳文件的az上傳腳本。az dls fs上傳到ADLS文件夾拋出提高FileExistsError(rpath)錯誤

az dls fs upload --account $adls_account --source-path $src_dir --destination-path $dest_dir --thread-count $thread_count --debug 

目標文件夾已經存在於ADLS中,並且正在嘗試向其添加更多文件。但是,運行此腳本時,它拋出的錯誤:使用

$ az --version 
azure-cli (2.0.9) 

一些可以幫我如何解決這個錯誤

Traceback (most recent call last): 
    File "/mnt/resource/apps/azure-cli/lib/python2.7/site-packages/azure/cli/main.py", line 36, in main 
cmd_result = APPLICATION.execute(args) 
    File "/mnt/resource/apps/azure-cli/lib/python2.7/site-packages/azure/cli/core/application.py", line 211, in execute 
result = expanded_arg.func(params) 
    File "/mnt/resource/apps/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 346, in __call__ 
return self.handler(*args, **kwargs) 
    File "/mnt/resource/apps/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 545, in _execute_command 
reraise(*sys.exc_info()) 
    File "/mnt/resource/apps/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 522, in _execute_command 
result = op(client, **kwargs) if client else op(**kwargs) 
    File "/mnt/resource/apps/azure-cli/lib/python2.7/site-packages/azure/cli/command_modules/dls/custom.py", line 174, in upload_to_adls 
    ADLUploader(client, destination_path, source_path, thread_count, overwrite=overwrite) 
     File "/mnt/resource/apps/azure-cli/lib/python2.7/site-packages/azure/datalake/store/multithread.py", line 347, in __init__ 
    raise FileExistsError(rpath) 
FileExistsError: /folder1/folder2/folder3/ 

上午?基本上我想在上傳到ADLS時關閉覆蓋功能。

謝謝,

阿爾瓊

回答

1

錯誤返回包括提及的「FileExistsError:/ folder1中/文件夾2/folder3 /」。這表明該文件夾已經存在。

根據command reference,由於您未使用-overwrite參數,因此如果目標已存在,則操作將失敗。 我看不到爲$ src_dir設置了什麼值,但是如果設置爲「/ folder1/folder2/folder3」,則會導致錯誤。

相關問題