在执行sentry-cli命令进行添加/删除分支时,报错:Invalid token(http status:401)

发布时间 2023-03-22 21:10:59作者: 蓝天fly

 

问题:

 

在执行sentry 创建(删除)某个项目的某个分支时

sentry-cli releases  --org lixiang --project bsp-omp-ui new staging@1.0.1

报错:

error: API request failed

caused by: sentry reported an error: Invalid token (http status: 401)

  意思是说token无效,但是我明明在上面先进行登陆了,而且登陆也成功了

 

解决办法:

上面执行登陆之后有个提示信息:Stored token in C:\Users\DELL\.sentryclirc,意思是:将token存储在了这个位置,需要将sentryclirc修改为:

 

[defaults]
url=https:/xxx.com
org=xxx
project=xxx
[auth]
token=xxx

 

执行命令,输出成功结果:

 

 

参考文献:

1.  sentry 命令_前端异常监控之 Sentry的部署和使用

----https://blog.csdn.net/weixin_39959236/article/details/111748948

 

2.  https://github.com/getsentry/sentry-cli/issues/1461