通过artalk面板上传图片时报错
按照文档方式配置,上传图片报错。 报错日志如下:
2024/10/16 20:16:29.074 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1
2024/10/16 20:16:29.075 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:
2024/10/16 20:16:29.075 ERROR [handler/upload.go:178] 通过 upgit 上传图片失败 {"id": "8f48eb2f-5bbf-4ef3-acbe-3233e0d251a3", "path": "/api/v2/upload", "method": "POST", "ip": "123.116.127.54", "remote_addr": "172.18.0.1:36248", "host": "artalk.dusays.com", "referer": "", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0", "status": 500}
2024/10/16 20:16:29.076 ERROR [HTTP] 20:16:28 | 500 | 17.198169ms | 123.116.127.54 | POST | /api/v2/upload | - | 8f48eb2f-5bbf-4ef3-acbe-3233e0d251a3
杜老师怎么解决的,我也遇到这个问题
杜老师怎么解决的,我也遇到这个问题
我是通过Hexo的主题脚本实现。
原来如此,使用Docker直接挂载进去是有效果的👍🏻
原来如此,使用Docker直接挂载进去是有效果的👍🏻
我也遇到这个问题,请问怎么解决
补充一些log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1
2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:
2025/07/06 11:11:34.271 ERROR [handler/upload.go:178] 通过 upgit 上传图片失败 {"id": "4042ab4b-768f-4d0a-aa96-5961f3da66ac", "path": "/api/v2/upload", "method": "POST", "ip": "240e:47c:600:f5a8:b884:e3e6:ddda:690c", "remote_addr": "172.27.0.1:34670", "host": "artalk.uptoz.cn", "referer": "", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0", "status": 500}
2025/07/06 11:11:34.271 ERROR [HTTP] 11:11:34 | 500 | 6.874036ms | 240e:47c:600:f5a8:b884:e3e6:ddda:690c | POST | /api/v2/upload | - | 4042ab4b-768f-4d0a-aa96-5961f3da66ac
我也遇到这个问题,请问怎么解决
你好,我分享一下我的配置,希望对你有帮助,确保能够上传成功的必要前提是在Docker容器中能够成功使用upgit,也就是说在docker容器命令行中应该有如下:
- 这是我的Artalk docker-compose文件
其中设置了目录映射如下:
容器目录为/usr/bin/upgit,本机目录为/mnt/data/artalk/data/tool,其中为upgit的配置以及所有文件
同时根据官方文档配置
补充一些log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1
2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:
2025/07/06 11:11:34.271 ERROR [handler/upload.go:178] 通过 upgit 上传图片失败 {"id": "4042ab4b-768f-4d0a-aa96-5961f3da66ac", "path": "/api/v2/upload", "method": "POST", "ip": "240e:47c:600:f5a8:b884:e3e6:ddda:690c", "remote_addr": "172.27.0.1:34670", "host": "artalk.uptoz.cn", "referer": "", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0", "status": 500}
2025/07/06 11:11:34.271 ERROR [HTTP] 11:11:34 | 500 | 6.874036ms | 240e:47c:600:f5a8:b884:e3e6:ddda:690c | POST | /api/v2/upload | - | 4042ab4b-768f-4d0a-aa96-5961f3da66ac
此外,补充设置: upgit -c /usr/bin/upgit/config.toml -t /artalk-img
补充一些log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:178] 通过 upgit 上传图片失败 {"id": "4042ab4b-768f-4d0a-aa96-5961f3da66ac", "path": "/api/v2/upload", "method": "POST", "ip": "240e:47c:600:f5a8:b884:e3e6:ddda:690c", "remote_addr": "172.27.0.1:34670", "host": "artalk.uptoz.cn", "referer": "", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0", "status": 500}2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [HTTP] 11:11:34 | 500 | 6.874036ms | 240e:47c:600:f5a8:b884:e3e6:ddda:690c | POST | /api/v2/upload | - | 4042ab4b-768f-4d0a-aa96-5961f3da66ac2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 da 66 ac
此外,补充设置: upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config . toml - t/artalk-img/文件 夹
![]()
非常感谢您的回复,请问一下环境变量这一步还需要配置吗?如果需要配置环境变量的话,可以提供一下您的环境变量的配置或者相关执行的命令,非常感谢!
补充一些log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:178] 通过 upgit 上传图片失败 {"id": "4042ab4b-768f-4d0a-aa96-5961f3da66ac", "path": "/api/v2/upload", "method": "POST", "ip": "240e:47c:600:f5a8:b884:e3e6:ddda:690c", "remote_addr": "172.27.0.1:34670", "host": "artalk.uptoz.cn", "referer": "", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0", "status": 500}2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [HTTP] 11:11:34 | 500 | 6.874036ms | 240e:47c:600:f5a8:b884:e3e6:ddda:690c | POST | /api/v2/upload | - | 4042ab4b-768f-4d0a-aa96-5961f3da66ac2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 da 66 ac
此外,补充设置: upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config . toml - t/artalk-img/文件 夹
非常感谢您的回复,请问一下环境变量这一步还需要配置吗?如果需要配置环境变量的话,可以提供一下您的环境变量的配置或者相关执行的命令,非常感谢!
不需要,在/usr/bin下就可以
补充一些log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1 补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:178] 通过 upgit 上传图片失败 {"id": "4042ab4b-768f-4d0a-aa96-5961f3da66ac", "path": "/api/v2/upload", "method": "POST", "ip": "240e:47c:600:f5a8:b884:e3e6:ddda:690c", "remote_addr": "172.27.0.1:34670", "host": "artalk.uptoz.cn", "referer": "", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0", "status": 500}2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{"id ":" 4042ab4b-768f-4d0a-aa96 - 5961f3da66ac "," path ":"/API/v2/upload","method":"POST","ip":"240 e:47 c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com","referer":"","user_agent":"Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com”,“状态”:500} 2025/07/06 11:11:34.271 ERROR [HTTP] 11:11:34 | 500 | 6.874036ms | 240e:47c:600:f5a8:b884:e3e6:ddda:690c | POST | /api/v2/upload | - | 4042ab4b-768f-4d0a-aa96-5961f3da66ac2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 da 66 ac 2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11 : 11 : 34.271 [ HTTP ] 11 : 11 : 34|被 冤 者 安娜| 6.874036ms |240 和 : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 ( 66 ac )
此外,补充设置: upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config . toml - t/artalk-img/文件 夹一个小男孩,一个小男孩:upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config。tml- t/artalk-img/culture 软件
非常感谢您的回复,请问一下环境变量这一步还需要配置吗?如果需要配置环境变量的话,可以提供一下您的环境变量的配置或者相关执行的命令,非常感谢!
不需要,在/usr/bin下就可以
按照您的配置,我上传图片出现了未找到环境变量的错误,但是我在容器中执行which upgit 是能够正常输出路径的
补充一些log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1 补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:178] 通过 upgit 上传图片失败 {"id": "4042ab4b-768f-4d0a-aa96-5961f3da66ac", "path": "/api/v2/upload", "method": "POST", "ip": "240e:47c:600:f5a8:b884:e3e6:ddda:690c", "remote_addr": "172.27.0.1:34670", "host": "artalk.uptoz.cn", "referer": "", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0", "status": 500}2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{"id ":" 4042ab4b-768f-4d0a-aa96 - 5961f3da66ac "," path ":"/API/v2/upload","method":"POST","ip":"240 e:47 c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com","referer":"","user_agent":"Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com”,“状态”:500} 2025/07/06 11:11:34.271 ERROR [HTTP] 11:11:34 | 500 | 6.874036ms | 240e:47c:600:f5a8:b884:e3e6:ddda:690c | POST | /api/v2/upload | - | 4042ab4b-768f-4d0a-aa96-5961f3da66ac2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 da 66 ac 2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11 : 11 : 34.271 [ HTTP ] 11 : 11 : 34|被 冤 者 安娜| 6.874036ms |240 和 : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 ( 66 ac )
此外,补充设置: upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config . toml - t/artalk-img/文件 夹一个小男孩,一个小男孩:upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config。tml- t/artalk-img/culture 软件
非常感谢您的回复,请问一下环境变量这一步还需要配置吗?如果需要配置环境变量的话,可以提供一下您的环境变量的配置或者相关执行的命令,非常感谢!
不需要,在/usr/bin下就可以
按照您的配置,我上传图片出现了未找到环境变量的错误,但是我在容器中执行which upgit 是能够正常输出路径的
![]()
抱歉,去我在主机的环境变量中加入了
请尝试是否有效
修改后source ~/.bashrc
补充一些log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1 补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1 补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1 补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1 补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出:2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:178] 通过 upgit 上传图片失败 {"id": "4042ab4b-768f-4d0a-aa96-5961f3da66ac", "path": "/api/v2/upload", "method": "POST", "ip": "240e:47c:600:f5a8:b884:e3e6:ddda:690c", "remote_addr": "172.27.0.1:34670", "host": "artalk.uptoz.cn", "referer": "", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0", "status": 500}2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{"id ":" 4042ab4b-768f-4d0a-aa96 - 5961f3da66ac "," path ":"/API/v2/upload","method":"POST","ip":"240 e:47 c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com","referer":"","user_agent":"Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com”,“状态”:500} 2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{"id ":" 4042ab4b-768f-4d0a-aa96 - 5961f3da66ac "," path ":"/API/v2/upload","method":"POST","ip":"240 e:47 c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com","referer":"","user_agent":"Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload. 去:178]通过 upgit 上传图片丢失{“id”:“4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac”,“路径”:"/API/v2/upload "," method ":" POST "," ip ":" 240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c "," remote_addr ":"172.27.0.1:34670","host":"www.example.com","referer":"","user_agent":"Mozilla/5.0(Windows NT 10.0; Win 64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com"," status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{" id":" 4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac","路径":"/API/v2/upload"," method":" POST"," ip":" 240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c"," remote_addr":" 172.27.0.1:34670"," host":" www.example.com"," referer":""," user_agent":" Mozilla/5.0www.example.com 2025/07/06 11:11:34.271 ERROR [HTTP] 11:11:34 | 500 | 6.874036ms | 240e:47c:600:f5a8:b884:e3e6:ddda:690c | POST | /api/v2/upload | - | 4042ab4b-768f-4d0a-aa96-5961f3da66ac2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 da 66 ac 2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11 : 11 : 34.271 [ HTTP ] 11 : 11 : 34|被 冤 者 安娜| 6.874036ms |240 和 : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 ( 66 ac ) 2025/07/06 11:11:34.271 错误[HTTP] 11:11:34| 500 | 6.874036ms |240e:47c:600:f5a8:b884:e3e6:ddda:690c|邮政|/API/v2/upload| - |4042ab4B-768f-4d0a-aa96-5961f3da66ac2025/07/06 11:11:34.271 错误[ HTTP ] 11:11:34|五百 名| 6.874036ms |240 e:47 c:600:f5 a8:b884:e3 e6:dda:690 c|邮政|/API/v2 上传| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3 da 66 ac 2025/07/06 11:11:34.271 错误 [ HTTP ] 11:11:34|五百 名| 6.874036ms |240 e:47 c:600:f5 a8:b884:e3 e6:dda:690 c|邮政|/API/v2 上传| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11:11:34.271 [ HTTP ] 11:11:34|被 冤 者 安娜| 6.874036ms |240 和:47 c:600:f5 a8:b884:e3 e6:dda:690 c|邮政|/API/v2| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3(66 ac)
此外,补充设置: upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config . toml - t/artalk-img/文件 夹一个小男孩,一个小男孩:upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config。tml- t/artalk-img/culture 软件此外,补充设置:upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config . toml - t/artalk-img/文件 夹一个小男孩,一个小男孩:upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config. tml- t/artalk-img/culture 软件
非常感谢您的回复,请问一下环境变量这一步还需要配置吗?如果需要配置环境变量的话,可以提供一下您的环境变量的配置或者相关执行的命令,非常感谢!
不需要,在/usr/bin下就可以
按照您的配置,我上传图片出现了未找到环境变量的错误,但是我在容器中执行which upgit 是能够正常输出路径的
抱歉,去我在主机的环境变量中加入了
请尝试是否有效
修改后source ~/.bashrc 修改后 source ~/.bashrc
很遗憾,并未起到效果
补充一些log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1 补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1 补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1 补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1 补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出:2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:178] 通过 upgit 上传图片失败 {"id": "4042ab4b-768f-4d0a-aa96-5961f3da66ac", "path": "/api/v2/upload", "method": "POST", "ip": "240e:47c:600:f5a8:b884:e3e6:ddda:690c", "remote_addr": "172.27.0.1:34670", "host": "artalk.uptoz.cn", "referer": "", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0", "status": 500}2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{"id ":" 4042ab4b-768f-4d0a-aa96 - 5961f3da66ac "," path ":"/API/v2/upload","method":"POST","ip":"240 e:47 c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com","referer":"","user_agent":"Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com”,“状态”:500} 2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{"id ":" 4042ab4b-768f-4d0a-aa96 - 5961f3da66ac "," path ":"/API/v2/upload","method":"POST","ip":"240 e:47 c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com","referer":"","user_agent":"Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload. 去:178]通过 upgit 上传图片丢失{“id”:“4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac”,“路径”:"/API/v2/upload "," method ":" POST "," ip ":" 240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c "," remote_addr ":"172.27.0.1:34670","host":"www.example.com","referer":"","user_agent":"Mozilla/5.0(Windows NT 10.0; Win 64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com"," status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{" id":" 4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac","路径":"/API/v2/upload"," method":" POST"," ip":" 240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c"," remote_addr":" 172.27.0.1:34670"," host":" www.example.com"," referer":""," user_agent":" Mozilla/5.0www.example.com 2025/07/06 11:11:34.271 ERROR [HTTP] 11:11:34 | 500 | 6.874036ms | 240e:47c:600:f5a8:b884:e3e6:ddda:690c | POST | /api/v2/upload | - | 4042ab4b-768f-4d0a-aa96-5961f3da66ac2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 da 66 ac 2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11 : 11 : 34.271 [ HTTP ] 11 : 11 : 34|被 冤 者 安娜| 6.874036ms |240 和 : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 ( 66 ac ) 2025/07/06 11:11:34.271 错误[HTTP] 11:11:34| 500 | 6.874036ms |240e:47c:600:f5a8:b884:e3e6:ddda:690c|邮政|/API/v2/upload| - |4042ab4B-768f-4d0a-aa96-5961f3da66ac2025/07/06 11:11:34.271 错误[ HTTP ] 11:11:34|五百 名| 6.874036ms |240 e:47 c:600:f5 a8:b884:e3 e6:dda:690 c|邮政|/API/v2 上传| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3 da 66 ac 2025/07/06 11:11:34.271 错误 [ HTTP ] 11:11:34|五百 名| 6.874036ms |240 e:47 c:600:f5 a8:b884:e3 e6:dda:690 c|邮政|/API/v2 上传| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11:11:34.271 [ HTTP ] 11:11:34|被 冤 者 安娜| 6.874036ms |240 和:47 c:600:f5 a8:b884:e3 e6:dda:690 c|邮政|/API/v2| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3(66 ac)
此外,补充设置: upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config . toml - t/artalk-img/文件 夹一个小男孩,一个小男孩:upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config。tml- t/artalk-img/culture 软件此外,补充设置:upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config . toml - t/artalk-img/文件 夹一个小男孩,一个小男孩:upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config. tml- t/artalk-img/culture 软件
非常感谢您的回复,请问一下环境变量这一步还需要配置吗?如果需要配置环境变量的话,可以提供一下您的环境变量的配置或者相关执行的命令,非常感谢!
不需要,在/usr/bin下就可以
按照您的配置,我上传图片出现了未找到环境变量的错误,但是我在容器中执行which upgit 是能够正常输出路径的
抱歉,去我在主机的环境变量中加入了
请尝试是否有效 修改后source ~/.bashrc 修改后 source ~/.bashrc
很遗憾,并未起到效果
好的,感谢您提供的信息。这张截图非常关键!
您说得对,upgit 确实已经安装了。这张图揭示了问题的根本原因:
upgit 被安装在了一个不标准的路径下。
根据您的截图,which upgit 命令的输出是:
/usr/bin/upgit/upgit
这意味着 upgit 这个可执行文件本身,被放在了 /usr/bin/upgit/ 这个目录里面。
然而,系统的 $PATH 环境变量通常只包含 /usr/bin,而不包含它的子目录 /usr/bin/upgit。因此,当您的程序尝试简单地执行 upgit 命令时,系统在 /usr/bin 目录下找不到它,就报错了。
解决方案
既然这是在容器环境里,我们有几种清晰的解决办法。
方案一(推荐):移动文件到标准路径
这是最干净、最符合规范的做法。将 upgit 文件移动到已经在 $PATH 里的目录中,比如 /usr/bin。
在容器的终端里执行以下命令:
# 1. 将 upgit 可执行文件移动到 /usr/bin 目录
mv /usr/bin/upgit/upgit /usr/bin/
# 2. (可选) 删除现在已经为空的目录
rmdir /usr/bin/upgit
# 3. 验证是否成功
which upgit
执行后,which upgit 的输出应该会变成 /usr/bin/upgit。
完成这个操作后,重启您的应用程序(或者如果方便的话,重启整个容器),它现在应该就能正确找到并执行 upgit 了。
方案二(备选):修改环境变量
如果您因为某些原因不能移动那个文件,另一个方法就是把 /usr/bin/upgit 这个目录也加入到环境变量 $PATH 中。
这通常需要在构建容器镜像的 Dockerfile 中完成,这样修改才是永久的。
在您的 Dockerfile 中加入下面这行:
ENV PATH="/usr/bin/upgit:${PATH}"
然后,您需要重新构建 (build) 并运行您的容器镜像。
如果您只是想在当前正在运行的容器里临时测试一下,可以执行:
# 这只在当前的终端会话中生效
export PATH="/usr/bin/upgit:$PATH"
执行后,在这个终端里启动您的应用,应该就可以成功了。但这不是一个永久的解决方案。
总结:
强烈推荐您使用方案一,因为它修正了文件位置不当的根本问题,让环境配置更标准。
补充一些log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1 补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1 补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1 补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1 补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1上一个↓ ↓日志:2025/07/06 11:11:34.271 ERROR [handler/upload.go:229][IMG_UPLOAD][upgit] Exit 状态:1 log:2025/07/06 11:11:34.271 ERROR [handler/upload. go:229][IMG_UPLOAD][upgit]退出状态:1:2025/07/06 11:11:34.271 [handler/upload. go:229][IMG_UPLOAD][upgit]:1:2019—11—25 00:00:00 |分类:|标签:|字号:大中小|标签:|字号:大中小|字号:大中小|标签:2025/07/06 11:11:34.271 ERROR [handler/upload.go:229][IMG_UPLOAD][upgit] Exit 状态:1 log:2019—11—25 00:00:00 |分类:|标签:|举报|字号:大中小|标签:|字号:大中小|标签:|标签:|字号:大中小|标签:大中小|字号:大中小|标签:大中小|标签:大中小|字号:大|标签:大中小|字号:大中字号:大|标签:大中小字体|字号:大中小字体|字号:大|字号:大中小字体大|标签:大中小字体|字号:大中小字体大中小|字号:大|标签:大中小字体大|字号:大|字号:大中小字体大中小|字号:大中小字体大|字号:大中字|标签:大|字号:大中小字体大 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出:2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出:2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出:2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出:2025/07/06 11:11:34.271 错误[handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit 输出:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:178] 通过 upgit 上传图片失败 {"id": "4042ab4b-768f-4d0a-aa96-5961f3da66ac", "path": "/api/v2/upload", "method": "POST", "ip": "240e:47c:600:f5a8:b884:e3e6:ddda:690c", "remote_addr": "172.27.0.1:34670", "host": "artalk.uptoz.cn", "referer": "", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0", "status": 500}2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{"id ":" 4042ab4b-768f-4d0a-aa96 - 5961f3da66ac "," path ":"/API/v2/upload","method":"POST","ip":"240 e:47 c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com","referer":"","user_agent":"Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com”,“状态”:500} 2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{"id ":" 4042ab4b-768f-4d0a-aa96 - 5961f3da66ac "," path ":"/API/v2/upload","method":"POST","ip":"240 e:47 c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com","referer":"","user_agent":"Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload. 去:178]通过 upgit 上传图片丢失{“id”:“4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac”,“路径”:"/API/v2/upload "," method ":" POST "," ip ":" 240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c "," remote_addr ":"172.27.0.1:34670","host":"www.example.com","referer":"","user_agent":"Mozilla/5.0(Windows NT 10.0; Win 64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com"," status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{" id":" 4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac","路径":"/API/v2/upload"," method":" POST"," ip":" 240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c"," remote_addr":" 172.27.0.1:34670"," host":" www.example.com"," referer":""," user_agent":" Mozilla/5.0www.example.com2025/07/06 11:11:34.271 ERROR [handler/upload.go:178] 通过 upgit 上传图片失败 {"id": "4042ab4b-768f-4d0a-aa96-5961f3da66ac", "path": "/api/v2/upload", "method": "POST", "ip": "240e:47c:600:f5a8:b884:e3e6:ddda:690c", "remote_addr": "172.27.0.1:34670", "host": "artalk.uptoz.cn", "referer": "", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0", "status": 500}2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload. 去:通过 upgit 上传图片丢失{"id ":" 4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac "," path ":"/API/v2/upload","method":"POST","ip":"240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c","remote_addr":"172.27.0.1:34670 "," host ":" www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win 64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com "," status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{" id":" 4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac","路径":"/API/v2/upload"," method":" POST"," ip":" 240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c"," remote_addr":" 172.27.0.1:34670"," host":" www.example.com"," referer":""," user_agent":" Mozilla/5.0www.example.com 去:通过 upgit 上传图片丢失{"id ":" 4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac "," path ":"/API/v2/upload","method":"POST","ip":"240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c","remote_addr":"172.27.0.1:34670 "," host ":" www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win 64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com "," status ":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{" id":" 4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac","路径":"/API/v2/upload"," method":" POST"," ip":" 240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c"," remote_addr":" 172.27.0.1:34670"," host":" www.example.com"," referer":""," user_agent":" Mozilla/5.0www.example.com 去:通过 upgit 上传图片丢失{“id”:“4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac”,"path":“/API/v2/upload“,”method“:“POST“,”ip“:“240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c“,”remote_addr“:“172.27.0.1:34670”,“host”:“www.example.com“,“referer”:“",“user_agent”:“Mozilla/5.0(Windows NT 10.0; Win 64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com”,”status”:500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{”id”:“4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac”,"路径“:“/API/v2/upload”,”方法”:“POST”,”ip”:“240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c”,”remote_addr”:“172.27.0.1:34670”,”host”:“www.example.com“,“referer”:“",”user_agent”:“Mozilla/5.0www.example.com 2025/07/06 11:11:34.271 ERROR [HTTP] 11:11:34 | 500 | 6.874036ms | 240e:47c:600:f5a8:b884:e3e6:ddda:690c | POST | /api/v2/upload | - | 4042ab4b-768f-4d0a-aa96-5961f3da66ac2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 da 66 ac 2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11 : 11 : 34.271 [ HTTP ] 11 : 11 : 34|被 冤 者 安娜| 6.874036ms |240 和 : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 ( 66 ac ) 2025/07/06 11:11:34.271 错误[HTTP] 11:11:34| 500 | 6.874036ms |240e:47c:600:f5a8:b884:e3e6:ddda:690c|邮政|/API/v2/upload| - |4042ab4B-768f-4d0a-aa96-5961f3da66ac2025/07/06 11:11:34.271 错误[ HTTP ] 11:11:34|五百 名| 6.874036ms |240 e:47 c:600:f5 a8:b884:e3 e6:dda:690 c|邮政|/API/v2 上传| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3 da 66 ac 2025/07/06 11:11:34.271 错误 [ HTTP ] 11:11:34|五百 名| 6.874036ms |240 e:47 c:600:f5 a8:b884:e3 e6:dda:690 c|邮政|/API/v2 上传| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11:11:34.271 [ HTTP ] 11:11:34|被 冤 者 安娜| 6.874036ms |240 和:47 c:600:f5 a8:b884:e3 e6:dda:690 c|邮政|/API/v2| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3(66 ac) 2025/07/06 11:11:34.271 ERROR [HTTP] 11:11:34 | 500 | 6.874036ms | 240e:47c:600:f5a8:b884:e3e6:ddda:690c | POST | /api/v2/upload | - | 4042ab4b-768f-4d0a-aa96-5961f3da66ac2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 da 66 ac 2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11 : 11 : 34.271 [ HTTP ] 11 : 11 : 34|被 冤 者 安娜| 6.874036ms |240 和 : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 ( 66 ac ) 2025/07/06 11:11:34.271 错误[HTTP] 11:11:34| 500 | 6.874036ms |240e:47c:600:f5a8:b884:e3e6:ddda:690c|邮政|/API/v2/upload| - |4042ab4B-768f-4d0a-aa96-5961f3da66ac2025/07/06 11:11:34.271 错误[ HTTP ] 11:11:34|五百 名| 6.874036ms |240 和 : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c|邮政|/API/v2| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11 : 11 : 34.271 [ HTTP ] 11 : 11 : 34|受 浸 者| 6.874036ms |240 和 : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c|邮政|/API/V2| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11 : 11 : 34.271 [ HTTP ] 11 : 11 : 34|英文 名 : Churchel Churcht| 6.874036ms |240 和 : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c|邮政|API/v2| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3 ( 66 ac )
此外,补充设置: upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config . toml - t/artalk-img/文件 夹一个小男孩,一个小男孩:upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config。tml- t/artalk-img/culture 软件此外,补充设置:upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config . toml - t/artalk-img/文件 夹一个小男孩,一个小男孩:upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config. tml- t/artalk-img/culture 软件今日 ,6.toml - t/artalk-img/,// tml - t/artalk-img/文化
非常感谢您的回复,请问一下环境变量这一步还需要配置吗?如果需要配置环境变量的话,可以提供一下您的环境变量的配置或者相关执行的命令,非常感谢!
不需要,在/usr/bin下就可以
按照您的配置,我上传图片出现了未找到环境变量的错误,但是我在容器中执行which upgit 是能够正常输出路径的
抱歉,去我在主机的环境变量中加入了
请尝试是否有效 修改后source ~/.bashrc 修改后 source ~/.bashrc 修改后 source ~/.bashrc 修改后 source ~/.bashrc
很遗憾,并未起到效果
好的,感谢您提供的信息。这张截图非常关键!
您说得对,
upgit确实已经安装了。这张图揭示了问题的根本原因:
upgit被安装在了一个不标准的路径下。根据您的截图,
which upgit命令的输出是:/usr/bin/upgit/upgit这意味着
upgit这个可执行文件本身,被放在了/usr/bin/upgit/这个目录里面。然而,系统的
$PATH环境变量通常只包含/usr/bin,而不包含它的子目录/usr/bin/upgit。因此,当您的程序尝试简单地执行upgit命令时,系统在/usr/bin目录下找不到它,就报错了。解决方案
既然这是在容器环境里,我们有几种清晰的解决办法。
方案一(推荐):移动文件到标准路径
这是最干净、最符合规范的做法。将
upgit文件移动到已经在$PATH里的目录中,比如/usr/bin。在容器的终端里执行以下命令:
1. 将 upgit 可执行文件移动到 /usr/bin 目录
mv /usr/bin/upgit/upgit /usr/bin/
2. (可选) 删除现在已经为空的目录
rmdir /usr/bin/upgit
3. 验证是否成功
which upgit 执行后,
which upgit的输出应该会变成/usr/bin/upgit。完成这个操作后,重启您的应用程序(或者如果方便的话,重启整个容器),它现在应该就能正确找到并执行
upgit了。方案二(备选):修改环境变量
如果您因为某些原因不能移动那个文件,另一个方法就是把
/usr/bin/upgit这个目录也加入到环境变量$PATH中。这通常需要在构建容器镜像的
Dockerfile中完成,这样修改才是永久的。在您的
Dockerfile中加入下面这行:ENV PATH="/usr/bin/upgit:${PATH}" 然后,您需要重新构建 (build) 并运行您的容器镜像。
如果您只是想在当前正在运行的容器里临时测试一下,可以执行:
这只在当前的终端会话中生效
export PATH="/usr/bin/upgit:$PATH" 执行后,在这个终端里启动您的应用,应该就可以成功了。但这不是一个永久的解决方案。
总结:
强烈推荐您使用方案一,因为它修正了文件位置不当的根本问题,让环境配置更标准。
再次感谢您的帮助,目前使用兰空图床开源版V2已经可以成功上传图片,但是使用兰空图床付费版V2,上传图片失败,这个我可能需要和兰空图床作者做进一步的沟通。非常感谢您的帮助。
补充一些log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1 补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1 补充一些 log: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:229] [IMG_UPLOAD] [upgit] Exit Status: 1 补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1 补充一些日志:2025/07/06 11:11:34.271 错误[handler/upload.go:229] [IMG_UPLOAD] [upgit]退出状态:1上一个↓ ↓日志:2025/07/06 11:11:34.271 ERROR [handler/upload.go:229][IMG_UPLOAD][upgit] Exit 状态:1 log:2025/07/06 11:11:34.271 ERROR [handler/upload. go:229][IMG_UPLOAD][upgit]退出状态:1:2025/07/06 11:11:34.271 [handler/upload. go:229][IMG_UPLOAD][upgit]:1:2019—11—25 00:00:00 |分类:|标签:|字号:大中小|标签:|字号:大中小|字号:大中小|标签:2025/07/06 11:11:34.271 ERROR [handler/upload.go:229][IMG_UPLOAD][upgit] Exit 状态:1 log:2019—11—25 00:00:00 |分类:|标签:|举报|字号:大中小|标签:|字号:大中小|标签:|标签:|字号:大中小|标签:大中小|字号:大中小|标签:大中小|标签:大中小|字号:大|标签:大中小|字号:大中字号:大|标签:大中小字体|字号:大中小字体|字号:大|字号:大中小字体大|标签:大中小字体|字号:大中小字体大中小|字号:大|标签:大中小字体大|字号:大|字号:大中小字体大中小|字号:大中小字体大|字号:大中字|标签:大|字号:大中小字体大 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出:2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出:2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出:2025/07/06 11:11:34.271 ERROR [handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出:2025/07/06 11:11:34.271 错误[handler/upload.go:177] [IMG_UPLOAD] [upgit] upgit 输出:2025/07/06 11:11:34.271 错误[handler/upload. go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177] [IMG_UPLOAD] [upgit] upgit output:2025/07/06 11:11:34.271 错误[handler/upload. go:177] go:177][IMG_UPLOAD][upgit] upgit 输出: 2025/07/06 11:11:34.271 ERROR [handler/upload.go:178] 通过 upgit 上传图片失败 {"id": "4042ab4b-768f-4d0a-aa96-5961f3da66ac", "path": "/api/v2/upload", "method": "POST", "ip": "240e:47c:600:f5a8:b884:e3e6:ddda:690c", "remote_addr": "172.27.0.1:34670", "host": "artalk.uptoz.cn", "referer": "", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0", "status": 500}2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{"id ":" 4042ab4b-768f-4d0a-aa96 - 5961f3da66ac "," path ":"/API/v2/upload","method":"POST","ip":"240 e:47 c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com","referer":"","user_agent":"Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com”,“状态”:500} 2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{"id ":" 4042ab4b-768f-4d0a-aa96 - 5961f3da66ac "," path ":"/API/v2/upload","method":"POST","ip":"240 e:47 c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com","referer":"","user_agent":"Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload. 去:178]通过 upgit 上传图片丢失{“id”:“4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac”,“路径”:"/API/v2/upload "," method ":" POST "," ip ":" 240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c "," remote_addr ":"172.27.0.1:34670","host":"www.example.com","referer":"","user_agent":"Mozilla/5.0(Windows NT 10.0; Win 64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com"," status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{" id":" 4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac","路径":"/API/v2/upload"," method":" POST"," ip":" 240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c"," remote_addr":" 172.27.0.1:34670"," host":" www.example.com"," referer":""," user_agent":" Mozilla/5.0www.example.com2025/07/06 11:11:34.271 ERROR [handler/upload.go:178] 通过 upgit 上传图片失败 {"id": "4042ab4b-768f-4d0a-aa96-5961f3da66ac", "path": "/api/v2/upload", "method": "POST", "ip": "240e:47c:600:f5a8:b884:e3e6:ddda:690c", "remote_addr": "172.27.0.1:34670", "host": "artalk.uptoz.cn", "referer": "", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0", "status": 500}2025/07/06 11:11:34.271 ERROR [handler/upload. go:178]通过 upgit 上传图片丢失{"id ":"4042ab4b-768f-4d0a-aa96 - 5961f3da66ac","path":"/API/v2/upload "," method ":" POST","ip":"240e:47c:600:f5a8:b884:e3e6:ddda:690c","remote_addr":"172.27.0.1:34670","host":"www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/138.0.0.0 ","status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload. 去:通过 upgit 上传图片丢失{"id ":" 4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac "," path ":"/API/v2/upload","method":"POST","ip":"240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c","remote_addr":"172.27.0.1:34670 "," host ":" www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win 64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com "," status":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{" id":" 4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac","路径":"/API/v2/upload"," method":" POST"," ip":" 240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c"," remote_addr":" 172.27.0.1:34670"," host":" www.example.com"," referer":""," user_agent":" Mozilla/5.0www.example.com 去:通过 upgit 上传图片丢失{"id ":" 4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac "," path ":"/API/v2/upload","method":"POST","ip":"240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c","remote_addr":"172.27.0.1:34670 "," host ":" www.example.com "," referer ":""," user_agent ":" Mozilla/5.0(Windows NT 10.0; Win 64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com "," status ":500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{" id":" 4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac","路径":"/API/v2/upload"," method":" POST"," ip":" 240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c"," remote_addr":" 172.27.0.1:34670"," host":" www.example.com"," referer":""," user_agent":" Mozilla/5.0www.example.com 去:通过 upgit 上传图片丢失{“id”:“4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac”,"path":“/API/v2/upload“,”method“:“POST“,”ip“:“240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c“,”remote_addr“:“172.27.0.1:34670”,“host”:“www.example.com“,“referer”:“",“user_agent”:“Mozilla/5.0(Windows NT 10.0; Win 64; x64)AppleWebKit/537.36(KHTML,比如 Gecko)Chrome/www.example.com Safari/537.36 Edg/www.example.com”,”status”:500} 2025/07/06 11:11:34.271 ERROR [handler/upload.去:178]通过 upgit 上传图片丢失{”id”:“4042 ab 4 B-768 f-4d 0a-aa 96 - 5961 f3 da 66 ac”,"路径“:“/API/v2/upload”,”方法”:“POST”,”ip”:“240 e:47 c:600:f5 a8:b884:e3 e6:ddda:690 c”,”remote_addr”:“172.27.0.1:34670”,”host”:“www.example.com“,“referer”:“",”user_agent”:“Mozilla/5.0www.example.com 2025/07/06 11:11:34.271 ERROR [HTTP] 11:11:34 | 500 | 6.874036ms | 240e:47c:600:f5a8:b884:e3e6:ddda:690c | POST | /api/v2/upload | - | 4042ab4b-768f-4d0a-aa96-5961f3da66ac2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 da 66 ac 2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11 : 11 : 34.271 [ HTTP ] 11 : 11 : 34|被 冤 者 安娜| 6.874036ms |240 和 : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 ( 66 ac ) 2025/07/06 11:11:34.271 错误[HTTP] 11:11:34| 500 | 6.874036ms |240e:47c:600:f5a8:b884:e3e6:ddda:690c|邮政|/API/v2/upload| - |4042ab4B-768f-4d0a-aa96-5961f3da66ac2025/07/06 11:11:34.271 错误[ HTTP ] 11:11:34|五百 名| 6.874036ms |240 e:47 c:600:f5 a8:b884:e3 e6:dda:690 c|邮政|/API/v2 上传| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3 da 66 ac 2025/07/06 11:11:34.271 错误 [ HTTP ] 11:11:34|五百 名| 6.874036ms |240 e:47 c:600:f5 a8:b884:e3 e6:dda:690 c|邮政|/API/v2 上传| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11:11:34.271 [ HTTP ] 11:11:34|被 冤 者 安娜| 6.874036ms |240 和:47 c:600:f5 a8:b884:e3 e6:dda:690 c|邮政|/API/v2| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3(66 ac) 2025/07/06 11:11:34.271 ERROR [HTTP] 11:11:34 | 500 | 6.874036ms | 240e:47c:600:f5a8:b884:e3e6:ddda:690c | POST | /api/v2/upload | - | 4042ab4b-768f-4d0a-aa96-5961f3da66ac2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 da 66 ac 2025/07/06 11 : 11 : 34.271 错误 [ HTTP ] 11 : 11 : 34|五百 名| 6.874036ms |240 e : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2 上传| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11 : 11 : 34.271 [ HTTP ] 11 : 11 : 34|被 冤 者 安娜| 6.874036ms |240 和 : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c| POST|/api/v2| - |4042 ab 4 b - 768 f - 4d 0 a-aa 96 - 5961 f3 ( 66 ac ) 2025/07/06 11:11:34.271 错误[HTTP] 11:11:34| 500 | 6.874036ms |240e:47c:600:f5a8:b884:e3e6:ddda:690c|邮政|/API/v2/upload| - |4042ab4B-768f-4d0a-aa96-5961f3da66ac2025/07/06 11:11:34.271 错误[ HTTP ] 11:11:34|五百 名| 6.874036ms |240 和 : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c|邮政|/API/v2| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11 : 11 : 34.271 [ HTTP ] 11 : 11 : 34|受 浸 者| 6.874036ms |240 和 : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c|邮政|/API/V2| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3 from 66 ac 2025/07/06 11 : 11 : 34.271 [ HTTP ] 11 : 11 : 34|英文 名 : Churchel Churcht| 6.874036ms |240 和 : 47 c : 600 : f5 a8 : b884 : e3 e6 : dda : 690 c|邮政|API/v2| - |4042 ab 4 B - 768 f - 4d 0 a-aa 96 - 5961 f3 ( 66 ac )
此外,补充设置: upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config . toml - t/artalk-img/文件 夹一个小男孩,一个小男孩:upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config。tml- t/artalk-img/culture 软件此外,补充设置:upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config . toml - t/artalk-img/文件 夹一个小男孩,一个小男孩:upgit -c /usr/bin/upgit/config.toml -t /artalk-img upgit - c/usr/bin/upgit/config. tml- t/artalk-img/culture 软件今日 ,6.toml - t/artalk-img/,// tml - t/artalk-img/文化
非常感谢您的回复,请问一下环境变量这一步还需要配置吗?如果需要配置环境变量的话,可以提供一下您的环境变量的配置或者相关执行的命令,非常感谢!
不需要,在/usr/bin下就可以
按照您的配置,我上传图片出现了未找到环境变量的错误,但是我在容器中执行which upgit 是能够正常输出路径的
抱歉,去我在主机的环境变量中加入了
请尝试是否有效 修改后source ~/.bashrc 修改后 source ~/.bashrc 修改后 source ~/.bashrc 修改后 source ~/.bashrc
很遗憾,并未起到效果
好的,感谢您提供的信息。这张截图非常关键! 您说得对,
upgit确实已经安装了。这张图揭示了问题的根本原因:upgit被安装在了一个不标准的路径下。 根据您的截图,which upgit命令的输出是:/usr/bin/upgit/upgit这意味着upgit这个可执行文件本身,被放在了/usr/bin/upgit/这个目录里面。 然而,系统的$PATH环境变量通常只包含/usr/bin,而不包含它的子目录/usr/bin/upgit。因此,当您的程序尝试简单地执行upgit命令时,系统在/usr/bin目录下找不到它,就报错了。解决方案
既然这是在容器环境里,我们有几种清晰的解决办法。
方案一(推荐):移动文件到标准路径
这是最干净、最符合规范的做法。将
upgit文件移动到已经在$PATH里的目录中,比如/usr/bin。 在容器的终端里执行以下命令:1. 将 upgit 可执行文件移动到 /usr/bin 目录
mv /usr/bin/upgit/upgit /usr/bin/
2. (可选) 删除现在已经为空的目录
rmdir /usr/bin/upgit
3. 验证是否成功
which upgit 执行后,
which upgit的输出应该会变成/usr/bin/upgit。 完成这个操作后,重启您的应用程序(或者如果方便的话,重启整个容器),它现在应该就能正确找到并执行upgit了。方案二(备选):修改环境变量
如果您因为某些原因不能移动那个文件,另一个方法就是把
/usr/bin/upgit这个目录也加入到环境变量$PATH中。 这通常需要在构建容器镜像的Dockerfile中完成,这样修改才是永久的。 在您的Dockerfile中加入下面这行: ENV PATH="/usr/bin/upgit:${PATH}" 然后,您需要重新构建 (build) 并运行您的容器镜像。 如果您只是想在当前正在运行的容器里临时测试一下,可以执行:这只在当前的终端会话中生效
export PATH="/usr/bin/upgit:$PATH" 执行后,在这个终端里启动您的应用,应该就可以成功了。但这不是一个永久的解决方案。 总结: 强烈推荐您使用方案一,因为它修正了文件位置不当的根本问题,让环境配置更标准。
再次感谢您的帮助,目前使用兰空图床开源版V2已经可以成功上传图片,但是使用兰空图床付费版V2,上传图片失败,这个我可能需要和兰空图床作者做进一步的沟通。非常感谢您的帮助。
是的,这可能是兰空图床和upgit的对接问题或相关配置问题,我的上传依旧失败
按照您的配置,我上传图片出现了未找到环境变量的错误,但是我在容器中执行which upgit 是能够正常输出路径的
请尝试是否有效