Closed wtf-boy closed 5 months ago
Problem description 任务调度成功后,更新任务状态时302,不知道该怎么配置地址
报错日志:
2024-06-20 17:52:55.561 [MainThread] [30] INFO E:\Workspace\python\xxl-job\app.py(test_task:23) - get executor params: 2024-06-20 17:52:55.562 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 0 2024-06-20 17:52:55.562 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 1 2024-06-20 17:52:55.568 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 2 2024-06-20 17:52:55.568 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 3 2024-06-20 17:52:55.568 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 4 2024-06-20 17:52:55.568 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 5 2024-06-20 17:52:55.569 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 6 2024-06-20 17:52:55.569 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 7 2024-06-20 17:52:55.569 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 8 2024-06-20 17:52:55.569 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 9 2024-06-20 17:53:00.582 [MainThread] [30] INFO D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\executor.py(_run:227) - Job finished jobId=3 logId=30 2024-06-20 17:53:00.583 [MainThread] [30] DEBUG D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\xxl_client.py(_post:87) - post to xxl-job path=callback payload=[{'logId': 30, 'logDateTim': 1718877175560, 'handleCode': 200, 'handleMsg': '成功...', 'executeResult': {'code': 200, 'msg': '成功...'}}] 2024-06-20 17:53:00.813 [MainThread] [30] ERROR D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\executor.py(_run:241) - 0, message='Attempt to decode JSON with unexpected mimetype: text/html;charset=utf-8', url=URL('http://xxx.com/toLogin') Traceback (most recent call last): File "D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\executor.py", line 228, in _run await self.xxl_client.callback(data.logId, start_time, code=200, msg=result) File "D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\xxl_client.py", line 83, in callback await self._post("callback", payload) File "D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\xxl_client.py", line 94, in _post r = Response(*(await response.json())) File "D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\aiohttp\client_reqrep.py", line 1176, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html;charset=utf-8', url=URL('http://xxx.com/toLogin') 2024-06-20 17:53:00.815 [MainThread] [30] DEBUG D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\xxl_client.py(_post:87) - post to xxl-job path=callback payload=[{'logId': 30, 'logDateTim': 1718877175560, 'handleCode': 500, 'handleMsg': "0, message='Attempt to decode JSON with unexpected mimetype: text/html;charset=utf-8', url=URL('http://job.afuyy.com/toLogin')", 'executeResult': {'code': 500, 'msg': "0, message='Attempt to decode JSON with unexpected mimetype: text/html;charset=utf-8', url=URL('http://xxx.com/toLogin')"}}] 2024-06-20 17:53:00.949 [MainThread] [30] INFO D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\executor.py(_finish:254) - Finish task <XXLTask task=<Task pending name='Task-12' coro=<Executor._run() running at D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\executor.py:249>> data=RunData(jobId=3, logId=30, executorHandler='demoJobHandler', executorBlockStrategy='SERIAL_EXECUTION', executorParams='', executorTimeout=0, logDateTime=1718877176284, glueType='BEAN', glueSource='', glueUpdatetime=1718876503000, broadcastIndex=0, broadcastTotal=1)> Task exception was never retrieved future: <Task finished name='Task-12' coro=<Executor._run() done, defined at D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\executor.py:217> exception=ContentTypeError(RequestInfo(url=URL('http://xxx.com/toLogin'), method='GET', headers=<CIMultiDictProxy('Host': 'job.afuyy.com', 'XXL-JOB-ACCESS-TOKEN': 'default_token', 'Accept': '/', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Python/3.9 aiohttp/3.9.5')>, real_url=URL('http://xxx.com/toLogin')), (<ClientResponse(http://xxx.com/xxl-job-admin/api/callback) [302 None]> <CIMultiDictProxy('Server': 'nginx/1.20.2', 'Date': 'Thu, 20 Jun 2024 09:53:01 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location': '/toLogin', 'Access-Control-Allow-Methods': '', 'Access-Control-Allow-Headers': '')> ,), message='Attempt to decode JSON with unexpected mimetype: text/html;charset=utf-8', headers=<CIMultiDictProxy('Server': 'nginx/1.20.2', 'Date': 'Thu, 20 Jun 2024 09:53:01 GMT', 'Content-Type': 'text/html;charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Content-Language': 'en-US', 'Access-Control-Allow-Methods': '', 'Access-Control-Allow-Headers': '*')>)>
Steps to reproduce the problem
config = ExecutorConfig( xxl_admin_baseurl="http://xxx.com/xxl-job-admin/api/", executor_app_name="company-python", executor_host="127.0.0.1", executor_listen_port=9998, access_token="实际有配置了token", debug=True, ) app = PyxxlRunner(config) @app.register(name="demoJobHandler") async def test_task(): # you can get task params with "g" g.logger.info("get executor params: %s" % g.xxl_run_data.executorParams) for i in range(10): g.logger.warning("test logger %s" % i) await asyncio.sleep(5) return "成功..." if __name__ == "__main__": app.run_executor()
Specifications like the version of the project, operating system, or hardware
Problem description 任务调度成功后,更新任务状态时302,不知道该怎么配置地址
报错日志:
2024-06-20 17:52:55.561 [MainThread] [30] INFO E:\Workspace\python\xxl-job\app.py(test_task:23) - get executor params: 2024-06-20 17:52:55.562 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 0 2024-06-20 17:52:55.562 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 1 2024-06-20 17:52:55.568 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 2 2024-06-20 17:52:55.568 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 3 2024-06-20 17:52:55.568 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 4 2024-06-20 17:52:55.568 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 5 2024-06-20 17:52:55.569 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 6 2024-06-20 17:52:55.569 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 7 2024-06-20 17:52:55.569 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 8 2024-06-20 17:52:55.569 [MainThread] [30] WARNING E:\Workspace\python\xxl-job\app.py(test_task:25) - test logger 9 2024-06-20 17:53:00.582 [MainThread] [30] INFO D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\executor.py(_run:227) - Job finished jobId=3 logId=30 2024-06-20 17:53:00.583 [MainThread] [30] DEBUG D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\xxl_client.py(_post:87) - post to xxl-job path=callback payload=[{'logId': 30, 'logDateTim': 1718877175560, 'handleCode': 200, 'handleMsg': '成功...', 'executeResult': {'code': 200, 'msg': '成功...'}}] 2024-06-20 17:53:00.813 [MainThread] [30] ERROR D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\executor.py(_run:241) - 0, message='Attempt to decode JSON with unexpected mimetype: text/html;charset=utf-8', url=URL('http://xxx.com/toLogin') Traceback (most recent call last): File "D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\executor.py", line 228, in _run await self.xxl_client.callback(data.logId, start_time, code=200, msg=result) File "D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\xxl_client.py", line 83, in callback await self._post("callback", payload) File "D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\xxl_client.py", line 94, in _post r = Response(*(await response.json())) File "D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\aiohttp\client_reqrep.py", line 1176, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html;charset=utf-8', url=URL('http://xxx.com/toLogin') 2024-06-20 17:53:00.815 [MainThread] [30] DEBUG D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\xxl_client.py(_post:87) - post to xxl-job path=callback payload=[{'logId': 30, 'logDateTim': 1718877175560, 'handleCode': 500, 'handleMsg': "0, message='Attempt to decode JSON with unexpected mimetype: text/html;charset=utf-8', url=URL('http://job.afuyy.com/toLogin')", 'executeResult': {'code': 500, 'msg': "0, message='Attempt to decode JSON with unexpected mimetype: text/html;charset=utf-8', url=URL('http://xxx.com/toLogin')"}}] 2024-06-20 17:53:00.949 [MainThread] [30] INFO D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\executor.py(_finish:254) - Finish task <XXLTask task=<Task pending name='Task-12' coro=<Executor._run() running at D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\executor.py:249>> data=RunData(jobId=3, logId=30, executorHandler='demoJobHandler', executorBlockStrategy='SERIAL_EXECUTION', executorParams='', executorTimeout=0, logDateTime=1718877176284, glueType='BEAN', glueSource='', glueUpdatetime=1718876503000, broadcastIndex=0, broadcastTotal=1)> Task exception was never retrieved future: <Task finished name='Task-12' coro=<Executor._run() done, defined at D:\Software\pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pyxxl\executor.py:217> exception=ContentTypeError(RequestInfo(url=URL('http://xxx.com/toLogin'), method='GET', headers=<CIMultiDictProxy('Host': 'job.afuyy.com', 'XXL-JOB-ACCESS-TOKEN': 'default_token', 'Accept': '/', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Python/3.9 aiohttp/3.9.5')>, real_url=URL('http://xxx.com/toLogin')), (<ClientResponse(http://xxx.com/xxl-job-admin/api/callback) [302 None]> <CIMultiDictProxy('Server': 'nginx/1.20.2', 'Date': 'Thu, 20 Jun 2024 09:53:01 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location': '/toLogin', 'Access-Control-Allow-Methods': '', 'Access-Control-Allow-Headers': '')> ,), message='Attempt to decode JSON with unexpected mimetype: text/html;charset=utf-8', headers=<CIMultiDictProxy('Server': 'nginx/1.20.2', 'Date': 'Thu, 20 Jun 2024 09:53:01 GMT', 'Content-Type': 'text/html;charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Content-Language': 'en-US', 'Access-Control-Allow-Methods': '', 'Access-Control-Allow-Headers': '*')>)>
Steps to reproduce the problem
Specifications like the version of the project, operating system, or hardware