Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mkdir and recursive_move API always return 500 error #6891

Closed
4 tasks done
RedSTARO opened this issue Jul 26, 2024 · 2 comments
Closed
4 tasks done

mkdir and recursive_move API always return 500 error #6891

RedSTARO opened this issue Jul 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@RedSTARO
Copy link

RedSTARO commented Jul 26, 2024

Please make sure of the following things

  • I have read the documentation.
    我已经阅读了文档

  • I'm sure there are no duplicate issues or discussions.
    我确定没有重复的issue或讨论。

  • I'm sure it's due to AList and not something else(such as Network ,Dependencies or Operational).
    我确定是AList的问题,而不是其他原因(例如网络依赖操作)。

  • I'm sure this issue is not fixed in the latest version.
    我确定这个问题在最新版本中没有被修复。

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](https://github.com/user-attachments/assets/454e30bd-e567-4649-8db9-6003aacc5fbc)


### 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}
@RedSTARO RedSTARO added the bug Something isn't working label Jul 26, 2024
Copy link

welcome bot commented Jul 26, 2024

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

@RedSTARO
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant