我在python中开发了每日邮件脚本。如果我手动进入机器然后它工作正常,但如果我通过Jenkins运行它失败了。我在脚本中使用plotly graph,错误也来自plotly library.Here是我的失败jenkins的堆栈跟踪。
+ /home/ubuntu/rest_api/venv/bin/python /home/ubuntu/rest_api/scripts/daily_analysis_report.py
Traceback (most recent call last):
File "/home/ubuntu/rest_api/scripts/daily_analysis_report.py", line 132, in <module>
main()
File "/home/ubuntu/rest_api/scripts/daily_analysis_report.py", line 105, in main
table_summary = pcharts.analytics_table_chart(past_days_metrics, report_params, table_title)
File "/home/ubuntu/rest_api/scripts/plotly_charts/charts.py", line 82, in analytics_table_chart
py.image.save_as(table, filename=file_path)
File "/home/ubuntu/rest_api/venv/local/lib/python2.7/site-packages/plotly/plotly/plotly.py", line 787, in save_as
img = cls.get(figure_or_data, format, width, height, scale)
File "/home/ubuntu/rest_api/venv/local/lib/python2.7/site-packages/plotly/plotly/plotly.py", line 710, in get
raise exceptions.PlotlyError(return_data['error'])
KeyError: 'error'
Build step 'Execute shell' marked build as failure
我无法找到这种行为背后的解决方案和原因,提前谢谢。