현상: 사내 망에서 Servicebus로 message를 보내려고 하는데 발생한 에러
에러
원인: 사내 네트워크 정책으로 AMQP 프로토콜 (TCP 포트 5671, 5672)이 막힘
해결: ServiceBusClient.from_connection_string()에 transport_type=TransportType.AmqpOverWebsocket 추가 → #16816 ServiceBus - AMQP client fails to connect
async def send_message(message, phase):
async with ServiceBusClient.from_connection_string(
conn_str=NAMESPACE_CONNECTION_STR,
logging_enable=True,
**transport_type=TransportType.AmqpOverWebsocket,**
) as servicebus_client:
logger.info("✅ Azure Service Bus 연결 성공")
sender = servicebus_client.get_topic_sender(topic_name=SERVICEBUS_TOPIC_NAME)
async with sender:
logger.info("메세지 전송 중")
msg = ServiceBusMessage(json.dumps(message), application_properties={"phase": phase})
await sender.send_messages(msg)
azureml sdk내부를 보면 아래와 같이 써있음: 5671포트가 막힐 경우, AmqpOverWebsocket를 사용하면 443 포트를 사용함
class ServiceBusClient(object): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
...
:keyword transport_type: The type of transport protocol that will be used for communicating with
the Service Bus service. Default is `TransportType.Amqp` in which case port 5671 is used.
If the port 5671 is unavailable/blocked in the network environment, `TransportType.AmqpOverWebsocket` could
be used instead which uses port 443 for communication.
현상: az cli로 로그인하려는데 발생한 에러
시도해본것들
az login, az login --use-device-code, az login --service-principal -u … -p … --tenant … 등 모든 종류의 login 명령어를 실행해봤지만 동일한 에러 발생
brew upgrade azure-cli 로 az cli 를 업그레이드 해도 안됨
cache 제거
az logout
rm -rf ~/.azure
az login
에러
The command failed with an unexpected error. Here is the traceback:
HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10bd61610>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
Traceback (most recent call last):
...
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10bd61610>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
해결
# DNS 설정을 Google Public DNS(8.8.8.8)로 변경
sudo networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4
# DNS 캐시를 플러시
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
# 그래고 안되면 재부팅
현상: 특정 리소스 그룹에 생성된 public ip를 AKS에 있는 로드밸런서에 연동하려다 발생한 에러
원인: Azure Kubernetes Service (AKS) 클러스터에서 LoadBalancer 서비스 타입을 사용할 때 발생하는 권한 문제. 클라이언트 ID(02551172-b5d8-473c-9c68-efc2695cf054)가 Microsoft.Network/publicIPAddresses/read 권한이 없어서 발생
에러
해결: Azure CLI를 사용하여 서비스 주체나 관리 ID에 권한을 부여
az role assignment create \
--assignee <ClientID> \
--role "Network Contributor" \
--scope /subscriptions/45ce2b10-9d87-4054-83a2-282d8d7e7188/resourceGroups/ml-prod
현상: argocd login --insecure <ArgoCD Server url>:443 --username admin --password ~ 명령어로 로그인하려고 하니 발생한 에러
FATA[0060] context deadline exceeded
해결: 각종 임시 파일들 제거 후 재부팅
sudo rm -rf /tmp/*
sudo rm -rf ~/.cache/*
sudo rm -rf /var/log/*
brew cleanup