AlistGo / alist

🗂️A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs. / 一个支持多存储的文件列表/WebDAV程序,使用 Gin 和 Solidjs。
https://alist.nn.ci
GNU Affero General Public License v3.0
43.79k stars 5.67k forks source link

mkdir and recursive_move API always return 500 error #6891

Closed RedSTARO closed 3 months ago

RedSTARO commented 3 months ago

Please make sure of the following things

AList Version / AList 版本

v3.35.0

Driver used / 使用的存储驱动

123Pan

Describe the bug / 问题描述

Using API mkdir and recursive_move will always says storage not found but it is exsits and can be access by other API like list

import api
alistUrl = "http://127.0.0.1:5244/alist" # Alist access address
alistKey = ""  # Alist access key

alist = api.Alist(alistUrl, alistKey)

alist.mkdir(f"/EmbyStorage/test")
alist.recursiveMove(f"/test/Ani/p3/", f"/test/Ani/p3/S1")

# def mkdir(self, path):
#     data = {
#         "src_dir": path
#     }
#     print(requests.post(f"{self.alistUrl}/api/fs/mkdir", headers=self.headers, json=data).json())
#     return requests.post(f"{self.alistUrl}/api/fs/mkdir", headers=self.headers, json=data).json() 

# def recursiveMove(self, src_dir, dst_dir):
#     data = {
#         "src_dir": src_dir,
#         "dst_dir": dst_dir
#             }
#     print(requests.post(f"{self.alistUrl}/api/fs/recursive_move", headers=self.headers, json=data).json())
#     return requests.post(f"{self.alistUrl}/api/fs/recursive_move", headers=self.headers, json=data).json() 

Then error like this.

# r@redstar-server:~/embyOrganizer$ python3 test.py
# {'code': 500, 'message': 'failed get storage: storage not found; please add a storage first', 'data': None}
# {'code': 500, 'message': 'failed to get dst dir: object not found', 'data': None}

Status of storage: image

Reproduction / 复现链接

Depolyed on local network so no link can be provide, sorry for that.

Config / 配置

config.json:

/opt/alist/data # cat config.json 
{
  "force": false,
  "site_url": "/alist",
  "cdn": "",
  "jwt_secret": "nIDHhv7QbWCdjcTr",
  "token_expires_in": 48,
  "database": {
    "type": "sqlite3",
    "host": "",
    "port": 0,
    "user": "",
    "password": "",
    "name": "",
    "db_file": "data/data.db",
    "table_prefix": "x_",
    "ssl_mode": "",
    "dsn": ""
  },
  "meilisearch": {
    "host": "http://localhost:7700",
    "api_key": "",
    "index_prefix": ""
  },
  "scheme": {
    "address": "0.0.0.0",
    "http_port": 5244,
    "https_port": -1,
    "force_https": false,
    "cert_file": "",
    "key_file": "",
    "unix_file": "",
    "unix_file_perm": ""
  },
  "temp_dir": "data/temp",
  "bleve_dir": "data/bleve",
  "dist_dir": "",
  "log": {
    "enable": true,
    "name": "data/log/log.log",
    "max_size": 50,
    "max_backups": 30,
    "max_age": 28,
    "compress": false
  },
  "delayed_start": 0,
  "max_connections": 0,
  "tls_insecure_skip_verify": true,
  "tasks": {
    "download": {
      "workers": 5,
      "max_retry": 1
    },
    "transfer": {
      "workers": 5,
      "max_retry": 2
    },
    "upload": {
      "workers": 5,
      "max_retry": 0
    },
    "copy": {
      "workers": 5,
      "max_retry": 2
    }
  },
  "cors": {
    "allow_origins": [
      "*"
    ],
    "allow_methods": [
      "*"
    ],
    "allow_headers": [
      "*"
    ]
  },
  "s3": {
    "enable": false,
    "port": 5246,
    "ssl": false
  }
/opt/alist/data # 

StorageConfig:

Logs / 日志

{'code': 500, 'message': 'failed get storage: storage not found; please add a storage first', 'data': None}

{'code': 500, 'message': 'failed to get dst dir: object not found', 'data': None}

welcome[bot] commented 3 months ago

Thanks for opening your first issue here! Be sure to follow the issue template!

RedSTARO commented 3 months ago

Closing it now due do posted wrong data.Sorry for bothering.