-
Notifications
You must be signed in to change notification settings - Fork 53
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
cb-spider recognition failure error in docker-compose environment #1606
Comments
|
@yunkon-kim 예전에 wsl2 활용시 이슈가 있다고 언급해주신 적이 있는데, |
위 스크립트에 적용된 저는 컨테이너를 Host 네트워크에서 구동하는 것을 선호하지 않는 편이라 Tumblebug container 구동시에 이것이 문의주신 docker-compose.yaml과는 관련이 없는 것으로 생각됩니다. 추가로, 공유해주신 docker-compose.yaml을 간단히 테스트해 보았습니다. docker-compose 실행 이후에 Tumblebug conatiner에 접속하여 기존에 Spider, tumblebug을 각각 컨테이너로 띄울 때는 없었던 부분이라 확인이 필요해 보입니다. docker exec -it cb-tumblebug /bin/sh
# curl -v http://cb-spider:1024/spider/readyz
* Host cb-spider:1024 was resolved.
* IPv6: (none)
* IPv4: 172.24.0.2
* Trying 172.24.0.2:1024...
* Connected to cb-spider (172.24.0.2) port 1024
> GET /spider/readyz HTTP/1.1
> Host: cb-spider:1024
> User-Agent: curl/8.5.0
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Content-Type: application/json; charset=UTF-8
< Vary: Origin
< Www-Authenticate: basic realm=Restricted
< Date: Fri, 07 Jun 2024 06:30:20 GMT
< Content-Length: 27
<
{"message":"Unauthorized"}
* Connection #0 to host cb-spider left intact |
@dev4unet 안녕하세요. 현재 docker-compose로 구동하기 위해서는 Spider 환경 변수 부분을 아래와 같이 적용해 주셔야 할 것 같습니다.
사유: default로 적용할 경우, /readyz API도 인증이 적용되어 있어서 그렇습니다.
@powerkimhub Spider의 /readyz API에 인증을 적용하지 않도록 개선이 필요해 보입니다. |
@dev4unet @yunkon-kim @seokho-son
[참고: v0.8.19 관련 시험 결과]
|
답변 감사합니다.^^ 다만, 개인적으로 인증 정보와 상관없이 readyz가 동작하도록 변경된 경우 readyz 호출이 정상적인 응답을 리턴 한다면... 만약, cb-spider의 인증 정보는 test/test로 설정하고 cb-tumblebug의 인증 정보는 default/default를 사용한다고 가정할 경우 현재 임시 방변에서는 cb-tumblebug의 초기 환경을 체크하는 로직에서 cb-spider와의 연결에 이상이 없다고 판단되어서 정상 구동으로 통과되고 나중에 cb-tumblebug의 cb-spider를 이용하는 특정 로직에서 인증 정보가 틀려서 정상 동작하지 않는 경우도 발생할 수 있을 것으로 판단됩니다. cb-tumblebug의 시스템 구동전 연계 시스템의 환경 설정을 체크하는 용도의 경우 위 상황에 대해 둘 다 보장이 필요하다면 readyz가 정상적으로 호출되었다면 모든 상황이 보장될 수 있도록 readyz에 기존처럼 인증 정보를 부여하고 호출하는 쪽에서 올바른 인증 정보로 호출하거나, 새롭게 변경된 것처럼 인증 정보 없이 readyz가 호출되도록 동작한다면 readyz로 시스템 상태를 먼저 확인 후 다른 API를 호출해서 인증 정보가 올바른지 검증하는 추가 로직도 진행하면 좋지 않을까 싶습니다. 그 외 별도로 cb-tumblebug의 환경 설정을 보면 인증 정보가 하나만 보이네요. |
인증 정보는 설정해 놓고 readyz만 통과하도록 cb-spider v0.8.19 버전으로 잠깐 확인해 보니 현재는 cb-spider에 인증 정보를 설정하면 cb-tumblebug의 일부 로직에서 에러가 발생하는 것 같습니다. cb-tumblebug | 2:27AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/main.go:186 > CB-Spider is now ready. Initializing CB-Tumblebug... 위 요청 사항과 관련된 내용 같은데 혹시라도 제가 cb-tumblebug에 다른 추가 설정을 빼 먹은 것이 아니라면 cb-spider 버전과 상관없이 우선은 cb-spider 구동 시 인증 정보를 비활성화 시켜야겠네요. |
@dev4unet 네넵. 확인 감사합니다.
어떤식으로 대응할지는 사실 고민이 좀 되는 부분입니다. (현재는 CB-TB, CB-SP간 민감한 정보가 API를 타는 상황. 어짜피 basic auth는 보안이 지원되는 auth가 아님. CB-TB-SP의 인터렉션이 사용자에게 노출될 필요가 없을 가능성이 높음 등) 향후에 개선/결정이 필요할 것으로 보입니다. (cc @powerkimhub @yunkon-kim ) |
|
@powerkimhub 네, cb-spider만 별도의 네트워크에서 구동되도록 망을 분리하고 cb-tumbluebug에서만 해당 네트워크에 접근 가능한 방향으로 고려해 보겠습니다. |
|
What happened
: docker-compose 환경에서 cb-tumblebug이 cb-spider의 구동 상태를 확인 못해서 종료되는 이슈가 있습니다.
[에러 로그]
cb-tumblebug | 9:19AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/main.go:189 > CB-Spider at http://cb-spider:1024/spider is not ready. Attempt 57/60
cb-tumblebug | 9:19AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/main.go:189 > CB-Spider at http://cb-spider:1024/spider is not ready. Attempt 58/60
cb-tumblebug | 9:19AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/main.go:189 > CB-Spider at http://cb-spider:1024/spider is not ready. Attempt 59/60
cb-tumblebug | 9:19AM INF ../../go/src/github.com/cloud-barista/cb-tumblebug/src/main.go:189 > CB-Spider at http://cb-spider:1024/spider is not ready. Attempt 60/60
cb-tumblebug | panic: Failed to confirm CB-Spider readiness within the allowed time.
cb-tumblebug | Check the connection to CB-Spider.
cb-tumblebug |
cb-tumblebug | goroutine 1 [running]:
cb-tumblebug | main.setConfig()
cb-tumblebug | /go/src/github.com/cloud-barista/cb-tumblebug/src/main.go:195 +0xb25
cb-tumblebug | main.init.0()
cb-tumblebug | /go/src/github.com/cloud-barista/cb-tumblebug/src/main.go:118 +0x7ab
cb-tumblebug exited with code 2
What you expected to happen
:
How to reproduce it (as minimally and precisely as possible)
: 제 컴퓨터의 wsl2 환경의 docker-compose 환경에서 발생하고 있습니다.
[실행 명령]
$ cm-mayfly docker compose up
docker-compose.yaml.txt
[docker-compose.yaml]
services:
CB-Spider
cb-spider:
image: cloudbaristaorg/cb-spider:0.8.18
container_name: cb-spider
platform: linux/amd64
ports:
- "0.0.0.0:1024:1024"
- "0.0.0.0:2048:2048"
volumes:
- ./conf/cb-spider/:/root/go/src/github.com/cloud-barista/cb-spider/conf/
- ./data/cb-spider/meta_db/:/root/go/src/github.com/cloud-barista/cb-spider/meta_db/
- ./data/cb-spider/log/:/root/go/src/github.com/cloud-barista/cb-spider/log/
environment:
- PLUGIN_SW=OFF
- API_USERNAME=default
- API_PASSWORD=default
CB-Tumblebug
cb-tumblebug:
image: cloudbaristaorg/cb-tumblebug:0.8.13
container_name: cb-tumblebug
platform: linux/amd64
ports:
- "0.0.0.0:1323:1323"
links:
- cb-spider
depends_on:
- cb-spider
volumes:
- ./conf/cb-tumblebug/:/app/conf/
- ./data/cb-tumblebug/meta_db/:/app/meta_db/
- ./data/cb-tumblebug/log/:/app/log/
environment:
- SPIDER_REST_URL=http://cb-spider:1024/spider
- SELF_ENDPOINT=localhost:1323
- API_USERNAME=default
- API_PASSWORD=default
Anything else we need to know?
: 혹시나 해서 cm-mayfly를 docker 이미지로 만들어서 docker-compose와 같은 네트워크에서 실행되도록 하고 http://cb-spider:1024/spider/readyz 를 호출하면 정상 동작하고 있습니다.
cb-tumblebug에서만 http://cb-spider:1024/spider/를 인식 못하는 것 같네요.
Environment
Proposed solution
:
Any other context
:
The text was updated successfully, but these errors were encountered: