@Nikmoz

Ответ 500 ошибки при запросе requests.patch с контейнера в контейнер, но из вне проходит статус 200, как это решить?

Не могу отправить requests.patch(url, json=json_dto) внутри docker-compose, возвращает
Traceback (most recent call last):
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask/app.py", line 2095, in __call__
eye-web-api-1  |     return self.wsgi_app(environ, start_response)
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask/app.py", line 2080, in wsgi_app
eye-web-api-1  |     response = self.handle_exception(e)
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask_restx/api.py", line 671, in error_router
eye-web-api-1  |     return original_handler(f)
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask_restx/api.py", line 669, in error_router
eye-web-api-1  |     return self.handle_error(e)
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask/app.py", line 2077, in wsgi_app
eye-web-api-1  |     response = self.full_dispatch_request()
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask/app.py", line 1525, in full_dispatch_request
eye-web-api-1  |     rv = self.handle_user_exception(e)
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask_restx/api.py", line 671, in error_router
eye-web-api-1  |     return original_handler(f)
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask_restx/api.py", line 669, in error_router
eye-web-api-1  |     return self.handle_error(e)
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask/app.py", line 1523, in full_dispatch_request
eye-web-api-1  |     rv = self.dispatch_request()
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask/app.py", line 1509, in dispatch_request
eye-web-api-1  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask_restx/api.py", line 403, in wrapper
eye-web-api-1  |     resp = resource(*args, **kwargs)
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask/views.py", line 84, in view
eye-web-api-1  |     return current_app.ensure_sync(self.dispatch_request)(*args, **kwargs)
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask_restx/resource.py", line 49, in dispatch_request
eye-web-api-1  |     resp = meth(*args, **kwargs)
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask_restx/marshalling.py", line 248, in wrapper
eye-web-api-1  |     resp = f(*args, **kwargs)
eye-web-api-1  |   File "/usr/src/app/api/src/apis/jobs.py", line 161, in patch
eye-web-api-1  |     details = self.req_parser.parse_args()
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask_restx/reqparse.py", line 386, in parse_args
eye-web-api-1  |     value, found = arg.parse(req, self.bundle_errors)
eye-web-api-1  |   File "/root/.local/share/virtualenvs/api-5ZjVfCGH/lib/python3.9/site-packages/flask_restx/reqparse.py", line 230, in parse
eye-web-api-1  |     values = [source.get(name)]
eye-web-api-1  | AttributeError: 'str' object has no attribute 'get'
^CGracefully stopping... (press Ctrl+C again to force)

Но если отправлять с компютера на локалхост то статус 200
requests.patch(f"http://localhost:5001/api/v1/jobs/628e8ef4788149ca8d8f8aa0", json=json_dto)
  • Вопрос задан
  • 48 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
RUVENTS Москва
от 130 000 до 150 000 ₽
SpectrumData Екатеринбург
от 150 000 до 250 000 ₽
30 июн. 2022, в 14:33
20000 руб./за проект
30 июн. 2022, в 14:30
2000 руб./за проект
30 июн. 2022, в 14:21
10000 руб./за проект