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

upgit配置问题 #859

Closed
HeLongaa opened this issue May 8, 2024 · 3 comments
Closed

upgit配置问题 #859

HeLongaa opened this issue May 8, 2024 · 3 comments

Comments

@HeLongaa
Copy link

HeLongaa commented May 8, 2024

已配置upgit,并将upgit执行文件放置在服务器/usr/bin/目录下,且在服务器可以正常上传图片,Artalk上传失败,如下

image

log:
{"level":"ERROR","ts":"2024-05-08T16:04:58.971+0800","caller":"[handler/upload.go:221]","msg":"[IMG_UPLOAD] [upgit] cmd.Start: exec: \"upgit\": executable file not found in $PATH"} {"level":"ERROR","ts":"2024-05-08T16:04:58.971+0800","caller":"[handler/upload.go:177]","msg":"[IMG_UPLOAD] [upgit] upgit output: "} {"level":"ERROR","ts":"2024-05-08T16:04:58.971+0800","caller":"[handler/upload.go:178]","msg":"通过 upgit 上传图片失败","id":"7f5f467f-60ad-4c83-bbea-10b09bc0356f","path":"/api/v2/upload","method":"POST","ip":"117.136.73.145","remote_addr":"111.6.43.106:38794","host":"artalk.duolaa.asia","referer":"","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0","status":500} {"level":"ERROR","ts":"2024-05-08T16:04:58.971+0800","msg":"[HTTP] 16:04:58 | 500 | 4.682093ms | 117.136.73.145 | POST | /api/v2/upload | - | 7f5f467f-60ad-4c83-bbea-10b09bc0356f"}
配置

image

upgit配置文件路径正确。

@jiayan586
Copy link

试试删除命令行参数后面的 -t /artalk-img
代码里已经拼接了

@monsterxcn
Copy link
Member

monsterxcn commented May 12, 2024

是 Docker 部署的吗?是的话润一下看看,估计没挂载吧

docker exec artalk bash -c "which upgit"

输出 /usr/bin/upgit 就对,没输出就不对。

我的 compose.yaml

version: '3.5'
services:
  artalk:
    container_name: artalk
    image: artalk/artalk-go:nightly
    restart: always
    ports:
      - 23366:23366
    volumes:
      - ./data:/data
      - ./upgit/upgit:/usr/bin/upgit

再不行就把 upgit 权限给高点,777!

sudo chmod -R 777 ./upgit/upgit

@HeLongaa
Copy link
Author

是 Docker 部署的吗?是的话润一下看看,估计没挂载吧

docker exec artalk bash -c "which upgit"

输出 就对,没输出就不对。/usr/bin/upgit

我的 :compose.yaml

version: '3.5'
services:
  artalk:
    container_name: artalk
    image: artalk/artalk-go:nightly
    restart: always
    ports:
      - 23366:23366
    volumes:
      - ./data:/data
      - ./upgit/upgit:/usr/bin/upgit

再不行就把 upgit 权限给高点,777!

sudo chmod -R 777 ./upgit/upgit

果然是没挂载,感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants