Spring云配置框架:
我正在尝试将java项目中的spring cloud配置与后端存储库集成git这是位桶。基本上,我在不同场合更频繁地遇到两个错误。
2020-04-11 17:08:59.265 WARN 2792 --- [ main] .c.s.e.MultipleJGitEnvironmentRepository : Could not fetch remote for master remote: https://[email protected] /cdn-cgi/l/email-protection/workspace/config-repo.git
在上述情况下,它使用缓存版本并且tomcat/undertow服务器启动没有任何问题。
2020-04-11 17:09:03.774 INFO 2792 --- [ main] o.s.c.c.s.e.NativeEnvironmentRepository : Adding property source: file:/var/folders/6m/1cgw7zvn3rsb8j5kskflhvrr0000gn/T/config-repo-2822438633438126334/api-gateway.yml
2020-04-11 17:09:03.774 INFO 2792 --- [ main] o.s.c.c.s.e.NativeEnvironmentRepository : Adding property source: file:/var/folders/6m/1cgw7zvn3rsb8j5kskflhvrr0000gn/T/config-repo-2822438633438126334/discovery-service.yml
2020-04-11 17:09:03.775 INFO 2792 --- [ main] o.s.c.c.s.e.NativeEnvironmentRepository : Adding property source: file:/var/folders/6m/1cgw7zvn3rsb8j5kskflhvrr0000gn/T/config-repo-2822438633438126334/config-service.yml
git版本:
git version 2.24.0
错误1:git-upload-pack
2020-04-11 00:00:20 - 警告克隆到基本目录时发生错误。
org.eclipse.jgit.api.errors.TransportException: https://<username>@bitbucket.org/<workspace>/config-repo.git: git-upload-pack not permitted on 'https://[email protected] /cdn-cgi/l/email-protection/workspace/config-repo.git/'
启动 Spring Cloud 配置服务器,我随机收到此错误。深入研究这个问题后,我发现git 上传包位桶不支持。但2年前就有报道称here https://stackoverflow.com/questions/45563049/bitbucket-cannot-execute-git-upload-pack,并建议恢复GIT版本。
错误2:不支持身份验证
org.eclipse.jgit.api.errors.TransportException: https://bitbucket.org/user/repo.git: authentication not supported
当我点击时,我得到了上面的错误/refresh
在执行器上从远程配置存储库获取刷新的属性。有时它工作时没有任何错误,有时会抛出上述错误。
curl localhost:8060/refresh -d {} -H "Content-Type: application/json"
执行器刷新命令错误:
{"timestamp":"2020-04-10T16:35:41.144+0000","status":500,"error":"Internal Server Error","message":"Request processing failed; nested exception is org.springframework.cloud.config.server.environment.NoSuchRepositoryException: Cannot clone or checkout repository: https://[email protected] /cdn-cgi/l/email-protection/augmentedcloud/ac-config-repo.git","path":"/refresh"}
Note:作为旁注,我已单独克隆指定的存储库进行测试,并且它的工作没有任何身份验证问题。