From 59b41e29f47f72b4e9e83d9cd4ad4ae00d26e427 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Thu, 3 Oct 2019 12:15:45 -0700 Subject: [PATCH 1/4] Call out DS DS logging critical for Lilypad --- domain-server/src/DomainServer.cpp | 5 +++-- libraries/networking/src/AccountManager.cpp | 2 +- libraries/networking/src/LimitedNodeList.cpp | 14 +++++++++----- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index d9c0a0a6b3..44ddf8373d 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -3450,8 +3450,9 @@ void DomainServer::randomizeICEServerAddress(bool shouldTriggerHostLookup) { // we ended up with an empty list since everything we've tried has failed // so clear the set of failed addresses and start going through them again - qCWarning(domain_server_ice) << "All current ice-server addresses have failed - re-attempting all current addresses for" - << _iceServerAddr; + qCWarning(domain_server_ice) << + "PAGE: All current ice-server addresses have failed - re-attempting all current addresses for" + << _iceServerAddr; _failedIceServerAddresses.clear(); candidateICEAddresses = _iceServerAddresses; diff --git a/libraries/networking/src/AccountManager.cpp b/libraries/networking/src/AccountManager.cpp index 7e76df7622..251ab819a4 100644 --- a/libraries/networking/src/AccountManager.cpp +++ b/libraries/networking/src/AccountManager.cpp @@ -1035,7 +1035,7 @@ void AccountManager::publicKeyUploadSucceeded(QNetworkReply* reply) { void AccountManager::publicKeyUploadFailed(QNetworkReply* reply) { // the public key upload has failed - qWarning() << "Public key upload failed from AccountManager" << reply->errorString(); + qWarning() << "PAGE: Public key upload failed from AccountManager to" << reply->url() << reply->errorString(); // we aren't waiting for a response any longer _isWaitingForKeypairResponse = false; diff --git a/libraries/networking/src/LimitedNodeList.cpp b/libraries/networking/src/LimitedNodeList.cpp index d92db8a5d4..e75fc07828 100644 --- a/libraries/networking/src/LimitedNodeList.cpp +++ b/libraries/networking/src/LimitedNodeList.cpp @@ -52,7 +52,7 @@ LimitedNodeList::LimitedNodeList(int socketListenPort, int dtlsListenPort) : _nodeSocket.bind(QHostAddress::AnyIPv4, port); quint16 assignedPort = _nodeSocket.localPort(); if (socketListenPort != INVALID_PORT && socketListenPort != 0 && socketListenPort != assignedPort) { - qCCritical(networking) << "NodeList is unable to assign requested port of" << socketListenPort; + qCCritical(networking) << "PAGE: NodeList is unable to assign requested port of" << socketListenPort; } qCDebug(networking) << "NodeList socket is listening on" << assignedPort; @@ -1155,6 +1155,7 @@ void LimitedNodeList::startSTUNPublicSocketUpdate() { void LimitedNodeList::possiblyTimeoutSTUNAddressLookup() { if (_stunSockAddr.getAddress().isNull()) { // our stun address is still NULL, but we've been waiting for long enough - time to force a fail + qCWarning(networking) << "PAGE: Failed to lookup address of STUN server" << STUN_SERVER_HOSTNAME; stopInitialSTUNUpdate(false); } } @@ -1170,7 +1171,7 @@ void LimitedNodeList::stopInitialSTUNUpdate(bool success) { if (!success) { // if we're here this was the last failed STUN request // use our DS as our stun server - qCDebug(networking, "Failed to lookup public address via STUN server at %s:%hu.", + qCWarning(networking, "PAGE: Failed to lookup public address via STUN server at %s:%hu.", STUN_SERVER_HOSTNAME, STUN_SERVER_PORT); qCDebug(networking) << "LimitedNodeList public socket will be set with local port and null QHostAddress."; @@ -1206,13 +1207,14 @@ void LimitedNodeList::updateLocalSocket() { } // attempt to use Google's DNS to confirm that local IP - static const QHostAddress RELIABLE_LOCAL_IP_CHECK_HOST = QHostAddress { "8.8.8.8" }; + static const QHostAddress RELIABLE_LOCAL_IP_CHECK_HOST = QHostAddress{ "8.8.8.8" }; static const int RELIABLE_LOCAL_IP_CHECK_PORT = 53; QTcpSocket* localIPTestSocket = new QTcpSocket; connect(localIPTestSocket, &QTcpSocket::connected, this, &LimitedNodeList::connectedForLocalSocketTest); - connect(localIPTestSocket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(errorTestingLocalSocket())); + connect(localIPTestSocket, static_cast(&QTcpSocket::error), + this, &LimitedNodeList::errorTestingLocalSocket); // attempt to connect to our reliable host localIPTestSocket->connectToHost(RELIABLE_LOCAL_IP_CHECK_HOST, RELIABLE_LOCAL_IP_CHECK_PORT); @@ -1242,6 +1244,8 @@ void LimitedNodeList::errorTestingLocalSocket() { // then use our possibly updated guessed local address as fallback if (!_hasTCPCheckedLocalSocket) { setLocalSocket(HifiSockAddr { getGuessedLocalAddress(), _nodeSocket.localPort() }); + qCWarning(networking) << "PAGE: Can't connect to Google DNS service, falling back to guessed local address" + << getLocalSockAddr(); } localIPTestSocket->deleteLater(); @@ -1325,7 +1329,7 @@ void LimitedNodeList::putLocalPortIntoSharedMemory(const QString key, QObject* p qCDebug(networking) << "Wrote local listening port" << localPort << "to shared memory at key" << key; } else { - qWarning() << "Failed to create and attach to shared memory to share local port with assignment-client children."; + qWarning() << "ALERT: Failed to create and attach to shared memory to share local port with assignment-client children."; } } From b45809840993ae6d3282abf587600509b38a3b4a Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Thu, 3 Oct 2019 12:38:29 -0700 Subject: [PATCH 2/4] Add case of failure to update ICE with metaverse --- domain-server/src/DomainServer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 44ddf8373d..223994c01b 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1635,8 +1635,8 @@ void DomainServer::handleFailedICEServerAddressUpdate(QNetworkReply* requestRepl } else { const int ICE_SERVER_UPDATE_RETRY_MS = 2 * 1000; - qCWarning(domain_server_ice) << "Failed to update ice-server address (" << _iceServerSocket << ") with High Fidelity Metaverse - error was" - << requestReply->errorString(); + qCWarning(domain_server_ice) << "PAGE: Failed to update ice-server address (" << _iceServerSocket << + ") with Metaverse (" << requestReply->url() << ") error:" << requestReply->errorString(); qCWarning(domain_server_ice) << "\tRe-attempting in" << ICE_SERVER_UPDATE_RETRY_MS / 1000 << "seconds"; QTimer::singleShot(ICE_SERVER_UPDATE_RETRY_MS, this, SLOT(sendICEServerAddressToMetaverseAPI())); From d5d1c08da0763e090d3bdcafcf450c4431e154f7 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Thu, 3 Oct 2019 16:50:24 -0700 Subject: [PATCH 3/4] Adjust some of the logging --- domain-server/src/DomainServer.cpp | 4 ++-- libraries/networking/src/LimitedNodeList.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 223994c01b..9cbfc0b991 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -385,7 +385,7 @@ void DomainServer::parseCommandLine(int argc, char* argv[]) { } if (_iceServerAddr.isEmpty()) { - qCWarning(domain_server_ice) << "Could not parse an IP address and port combination from" << hostnamePortString; + qCWarning(domain_server_ice) << "ALERT: Could not parse an IP address and port combination from" << hostnamePortString; ::exit(0); } } @@ -876,7 +876,7 @@ void DomainServer::setupAutomaticNetworking() { nodeList->startSTUNPublicSocketUpdate(); } } else { - qDebug() << "Cannot enable domain-server automatic networking without a domain ID." + qCCritical(domain_server) << "PAGE: Cannot enable domain-server automatic networking without a domain ID." << "Please add an ID to your config file or via the web interface."; return; } diff --git a/libraries/networking/src/LimitedNodeList.cpp b/libraries/networking/src/LimitedNodeList.cpp index e75fc07828..cdb52cf422 100644 --- a/libraries/networking/src/LimitedNodeList.cpp +++ b/libraries/networking/src/LimitedNodeList.cpp @@ -1155,7 +1155,7 @@ void LimitedNodeList::startSTUNPublicSocketUpdate() { void LimitedNodeList::possiblyTimeoutSTUNAddressLookup() { if (_stunSockAddr.getAddress().isNull()) { // our stun address is still NULL, but we've been waiting for long enough - time to force a fail - qCWarning(networking) << "PAGE: Failed to lookup address of STUN server" << STUN_SERVER_HOSTNAME; + qCCritical(networking) << "PAGE: Failed to lookup address of STUN server" << STUN_SERVER_HOSTNAME; stopInitialSTUNUpdate(false); } } @@ -1244,7 +1244,7 @@ void LimitedNodeList::errorTestingLocalSocket() { // then use our possibly updated guessed local address as fallback if (!_hasTCPCheckedLocalSocket) { setLocalSocket(HifiSockAddr { getGuessedLocalAddress(), _nodeSocket.localPort() }); - qCWarning(networking) << "PAGE: Can't connect to Google DNS service, falling back to guessed local address" + qCCritical(networking) << "PAGE: Can't connect to Google DNS service via TCP, falling back to guessed local address" << getLocalSockAddr(); } From db14cdbd223a02cb29231dc8c418db8cafc8b264 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Fri, 4 Oct 2019 09:56:35 -0700 Subject: [PATCH 4/4] Tweak 'critical' status for some logging --- domain-server/src/DomainServer.cpp | 3 ++- libraries/networking/src/AccountManager.cpp | 2 +- libraries/networking/src/LimitedNodeList.cpp | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 9cbfc0b991..ceb4679137 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1636,7 +1636,8 @@ void DomainServer::handleFailedICEServerAddressUpdate(QNetworkReply* requestRepl const int ICE_SERVER_UPDATE_RETRY_MS = 2 * 1000; qCWarning(domain_server_ice) << "PAGE: Failed to update ice-server address (" << _iceServerSocket << - ") with Metaverse (" << requestReply->url() << ") error:" << requestReply->errorString(); + ") with Metaverse (" << requestReply->url() << ") (critical error for auto-networking) error:" << + requestReply->errorString(); qCWarning(domain_server_ice) << "\tRe-attempting in" << ICE_SERVER_UPDATE_RETRY_MS / 1000 << "seconds"; QTimer::singleShot(ICE_SERVER_UPDATE_RETRY_MS, this, SLOT(sendICEServerAddressToMetaverseAPI())); diff --git a/libraries/networking/src/AccountManager.cpp b/libraries/networking/src/AccountManager.cpp index 251ab819a4..5edbc5261d 100644 --- a/libraries/networking/src/AccountManager.cpp +++ b/libraries/networking/src/AccountManager.cpp @@ -1035,7 +1035,7 @@ void AccountManager::publicKeyUploadSucceeded(QNetworkReply* reply) { void AccountManager::publicKeyUploadFailed(QNetworkReply* reply) { // the public key upload has failed - qWarning() << "PAGE: Public key upload failed from AccountManager to" << reply->url() << reply->errorString(); + qCritical() << "PAGE: Public key upload failed from AccountManager to" << reply->url() << reply->errorString(); // we aren't waiting for a response any longer _isWaitingForKeypairResponse = false; diff --git a/libraries/networking/src/LimitedNodeList.cpp b/libraries/networking/src/LimitedNodeList.cpp index cdb52cf422..ecf2218e2f 100644 --- a/libraries/networking/src/LimitedNodeList.cpp +++ b/libraries/networking/src/LimitedNodeList.cpp @@ -1171,7 +1171,7 @@ void LimitedNodeList::stopInitialSTUNUpdate(bool success) { if (!success) { // if we're here this was the last failed STUN request // use our DS as our stun server - qCWarning(networking, "PAGE: Failed to lookup public address via STUN server at %s:%hu.", + qCWarning(networking, "PAGE: Failed to lookup public address via STUN server at %s:%hu (likely a critical error for auto-networking).", STUN_SERVER_HOSTNAME, STUN_SERVER_PORT); qCDebug(networking) << "LimitedNodeList public socket will be set with local port and null QHostAddress."; @@ -1207,7 +1207,7 @@ void LimitedNodeList::updateLocalSocket() { } // attempt to use Google's DNS to confirm that local IP - static const QHostAddress RELIABLE_LOCAL_IP_CHECK_HOST = QHostAddress{ "8.8.8.8" }; + static const QHostAddress RELIABLE_LOCAL_IP_CHECK_HOST = QHostAddress { "8.8.8.8" }; static const int RELIABLE_LOCAL_IP_CHECK_PORT = 53; QTcpSocket* localIPTestSocket = new QTcpSocket;