diff --git a/influxdb_client/client/exceptions.py b/influxdb_client/client/exceptions.py index bfa453e2..2910f040 100644 --- a/influxdb_client/client/exceptions.py +++ b/influxdb_client/client/exceptions.py @@ -34,7 +34,7 @@ def _get_message(self, response): try: return json.loads(response.data)["message"] except Exception as e: - logging.debug(f"Cannot parse error response to JSON: {response.data}, {e}") + logger.debug(f"Cannot parse error response to JSON: {response.data}, {e}") return response.data # Header diff --git a/scripts/influxdb-onboarding.sh b/scripts/influxdb-onboarding.sh index 85da2272..a2777359 100755 --- a/scripts/influxdb-onboarding.sh +++ b/scripts/influxdb-onboarding.sh @@ -24,7 +24,13 @@ set -e echo "Wait to start InfluxDB 2.0" -wget -S --spider --tries=20 --retry-connrefused --waitretry=5 http://localhost:8086/metrics +for i in $(seq 1 20); do + if curl -sf -o /dev/null http://localhost:8086/metrics; then + break + fi + echo "Attempt $i failed, retrying in 5 seconds..." + sleep 5 +done echo echo "Post onBoarding request, to setup initial user (my-user@my-password), org (my-org) and bucketSetup (my-bucket)"