how to check if gcloud backend service/url map are ready
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
Is there a way to determine if a backend service is ready? I ask because I run a script that creates a backend then a url map that uses this backend. The problem is I sometimes get errors saying the backend is not ready for use. I need to be able to pause until the backend is ready before I create a url map. I could check the error response for the phrase 'is not ready' but this isn't reliable for future versions of gcloud. This is somewhat related to another post I recently made on how to reliably check for gcloud errors.
I could also say the same for the url map. When i create a proxy that uses the url map, sometimes i get the error saying the url map is not ready.
Here's an example of what I'm experiencing:
gcloud compute url-maps add-path-matcher app-url-map
--path-matcher-name=web-path-matcher
--default-service=web-backend
--new-hosts="example.com"
--path-rules="/*=web-backend"
ERROR: (gcloud.compute.url-maps.add-path-matcher) Could not fetch resource:
- The resource 'projects/my-project/global/backendServices/web-backend' is not ready
gcloud compute target-https-proxies create app-https-proxy
--url-map app-url-map
--ssl-certificates app-ssl-cert
ERROR: (gcloud.compute.target-https-proxies.create) Could not fetch resource:
- The resource 'projects/my-project/global/urlMaps/app-url-map' is not ready
gcloud -v
Google Cloud SDK 225.0.0
beta 2018.11.09
bq 2.0.37
core 2018.11.09
gsutil 4.34
google-cloud-platform gcloud google-cloud-sdk
add a comment |
Is there a way to determine if a backend service is ready? I ask because I run a script that creates a backend then a url map that uses this backend. The problem is I sometimes get errors saying the backend is not ready for use. I need to be able to pause until the backend is ready before I create a url map. I could check the error response for the phrase 'is not ready' but this isn't reliable for future versions of gcloud. This is somewhat related to another post I recently made on how to reliably check for gcloud errors.
I could also say the same for the url map. When i create a proxy that uses the url map, sometimes i get the error saying the url map is not ready.
Here's an example of what I'm experiencing:
gcloud compute url-maps add-path-matcher app-url-map
--path-matcher-name=web-path-matcher
--default-service=web-backend
--new-hosts="example.com"
--path-rules="/*=web-backend"
ERROR: (gcloud.compute.url-maps.add-path-matcher) Could not fetch resource:
- The resource 'projects/my-project/global/backendServices/web-backend' is not ready
gcloud compute target-https-proxies create app-https-proxy
--url-map app-url-map
--ssl-certificates app-ssl-cert
ERROR: (gcloud.compute.target-https-proxies.create) Could not fetch resource:
- The resource 'projects/my-project/global/urlMaps/app-url-map' is not ready
gcloud -v
Google Cloud SDK 225.0.0
beta 2018.11.09
bq 2.0.37
core 2018.11.09
gsutil 4.34
google-cloud-platform gcloud google-cloud-sdk
add a comment |
Is there a way to determine if a backend service is ready? I ask because I run a script that creates a backend then a url map that uses this backend. The problem is I sometimes get errors saying the backend is not ready for use. I need to be able to pause until the backend is ready before I create a url map. I could check the error response for the phrase 'is not ready' but this isn't reliable for future versions of gcloud. This is somewhat related to another post I recently made on how to reliably check for gcloud errors.
I could also say the same for the url map. When i create a proxy that uses the url map, sometimes i get the error saying the url map is not ready.
Here's an example of what I'm experiencing:
gcloud compute url-maps add-path-matcher app-url-map
--path-matcher-name=web-path-matcher
--default-service=web-backend
--new-hosts="example.com"
--path-rules="/*=web-backend"
ERROR: (gcloud.compute.url-maps.add-path-matcher) Could not fetch resource:
- The resource 'projects/my-project/global/backendServices/web-backend' is not ready
gcloud compute target-https-proxies create app-https-proxy
--url-map app-url-map
--ssl-certificates app-ssl-cert
ERROR: (gcloud.compute.target-https-proxies.create) Could not fetch resource:
- The resource 'projects/my-project/global/urlMaps/app-url-map' is not ready
gcloud -v
Google Cloud SDK 225.0.0
beta 2018.11.09
bq 2.0.37
core 2018.11.09
gsutil 4.34
google-cloud-platform gcloud google-cloud-sdk
Is there a way to determine if a backend service is ready? I ask because I run a script that creates a backend then a url map that uses this backend. The problem is I sometimes get errors saying the backend is not ready for use. I need to be able to pause until the backend is ready before I create a url map. I could check the error response for the phrase 'is not ready' but this isn't reliable for future versions of gcloud. This is somewhat related to another post I recently made on how to reliably check for gcloud errors.
I could also say the same for the url map. When i create a proxy that uses the url map, sometimes i get the error saying the url map is not ready.
Here's an example of what I'm experiencing:
gcloud compute url-maps add-path-matcher app-url-map
--path-matcher-name=web-path-matcher
--default-service=web-backend
--new-hosts="example.com"
--path-rules="/*=web-backend"
ERROR: (gcloud.compute.url-maps.add-path-matcher) Could not fetch resource:
- The resource 'projects/my-project/global/backendServices/web-backend' is not ready
gcloud compute target-https-proxies create app-https-proxy
--url-map app-url-map
--ssl-certificates app-ssl-cert
ERROR: (gcloud.compute.target-https-proxies.create) Could not fetch resource:
- The resource 'projects/my-project/global/urlMaps/app-url-map' is not ready
gcloud -v
Google Cloud SDK 225.0.0
beta 2018.11.09
bq 2.0.37
core 2018.11.09
gsutil 4.34
google-cloud-platform gcloud google-cloud-sdk
google-cloud-platform gcloud google-cloud-sdk
edited Jan 27 at 14:08
Carles Anton Güell
343
343
asked Nov 17 '18 at 2:38
VincentVincent
7781216
7781216
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
would assume it's gcloud alpha resources list ...
see the Error Messages of the Resource Manager and scroll down to the bottom, there it reads:
notReady The API server is not ready to accept requests.
which equals HTTP 503, SERVICE_UNAVAILABLE.
adding the --verbosity option might provide some more details.
see the documentation.
ok thanks, ill play with this and get back to you.
– Vincent
Nov 17 '18 at 2:54
@Vincent you're missing one essential option on the command issued.
– Martin Zeitler
Nov 17 '18 at 2:55
i think i can provide either the bucket or the service.
– Vincent
Nov 17 '18 at 2:57
indeed.exactly one of --default-service or --default-backend-bucket is required.maybe trygcloud compute url-maps listto see if it even answers.
– Martin Zeitler
Nov 17 '18 at 2:58
I triedgcloud alpha resources list, but it doesn't look like it shows the state of the backend service/url map. For the backend service, it just shows @type/description/name fields. The status code however is exactly what I'm trying to get. The--log-httpoption includes the json response w/ the status code, but how am i supposed to parse it out of all the other text? In the post i referenced, the--log-httpoutput is shown.
– Vincent
Nov 17 '18 at 3:29
|
show 2 more comments
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53347699%2fhow-to-check-if-gcloud-backend-service-url-map-are-ready%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
would assume it's gcloud alpha resources list ...
see the Error Messages of the Resource Manager and scroll down to the bottom, there it reads:
notReady The API server is not ready to accept requests.
which equals HTTP 503, SERVICE_UNAVAILABLE.
adding the --verbosity option might provide some more details.
see the documentation.
ok thanks, ill play with this and get back to you.
– Vincent
Nov 17 '18 at 2:54
@Vincent you're missing one essential option on the command issued.
– Martin Zeitler
Nov 17 '18 at 2:55
i think i can provide either the bucket or the service.
– Vincent
Nov 17 '18 at 2:57
indeed.exactly one of --default-service or --default-backend-bucket is required.maybe trygcloud compute url-maps listto see if it even answers.
– Martin Zeitler
Nov 17 '18 at 2:58
I triedgcloud alpha resources list, but it doesn't look like it shows the state of the backend service/url map. For the backend service, it just shows @type/description/name fields. The status code however is exactly what I'm trying to get. The--log-httpoption includes the json response w/ the status code, but how am i supposed to parse it out of all the other text? In the post i referenced, the--log-httpoutput is shown.
– Vincent
Nov 17 '18 at 3:29
|
show 2 more comments
would assume it's gcloud alpha resources list ...
see the Error Messages of the Resource Manager and scroll down to the bottom, there it reads:
notReady The API server is not ready to accept requests.
which equals HTTP 503, SERVICE_UNAVAILABLE.
adding the --verbosity option might provide some more details.
see the documentation.
ok thanks, ill play with this and get back to you.
– Vincent
Nov 17 '18 at 2:54
@Vincent you're missing one essential option on the command issued.
– Martin Zeitler
Nov 17 '18 at 2:55
i think i can provide either the bucket or the service.
– Vincent
Nov 17 '18 at 2:57
indeed.exactly one of --default-service or --default-backend-bucket is required.maybe trygcloud compute url-maps listto see if it even answers.
– Martin Zeitler
Nov 17 '18 at 2:58
I triedgcloud alpha resources list, but it doesn't look like it shows the state of the backend service/url map. For the backend service, it just shows @type/description/name fields. The status code however is exactly what I'm trying to get. The--log-httpoption includes the json response w/ the status code, but how am i supposed to parse it out of all the other text? In the post i referenced, the--log-httpoutput is shown.
– Vincent
Nov 17 '18 at 3:29
|
show 2 more comments
would assume it's gcloud alpha resources list ...
see the Error Messages of the Resource Manager and scroll down to the bottom, there it reads:
notReady The API server is not ready to accept requests.
which equals HTTP 503, SERVICE_UNAVAILABLE.
adding the --verbosity option might provide some more details.
see the documentation.
would assume it's gcloud alpha resources list ...
see the Error Messages of the Resource Manager and scroll down to the bottom, there it reads:
notReady The API server is not ready to accept requests.
which equals HTTP 503, SERVICE_UNAVAILABLE.
adding the --verbosity option might provide some more details.
see the documentation.
edited Nov 17 '18 at 2:59
answered Nov 17 '18 at 2:50
Martin ZeitlerMartin Zeitler
20.6k34575
20.6k34575
ok thanks, ill play with this and get back to you.
– Vincent
Nov 17 '18 at 2:54
@Vincent you're missing one essential option on the command issued.
– Martin Zeitler
Nov 17 '18 at 2:55
i think i can provide either the bucket or the service.
– Vincent
Nov 17 '18 at 2:57
indeed.exactly one of --default-service or --default-backend-bucket is required.maybe trygcloud compute url-maps listto see if it even answers.
– Martin Zeitler
Nov 17 '18 at 2:58
I triedgcloud alpha resources list, but it doesn't look like it shows the state of the backend service/url map. For the backend service, it just shows @type/description/name fields. The status code however is exactly what I'm trying to get. The--log-httpoption includes the json response w/ the status code, but how am i supposed to parse it out of all the other text? In the post i referenced, the--log-httpoutput is shown.
– Vincent
Nov 17 '18 at 3:29
|
show 2 more comments
ok thanks, ill play with this and get back to you.
– Vincent
Nov 17 '18 at 2:54
@Vincent you're missing one essential option on the command issued.
– Martin Zeitler
Nov 17 '18 at 2:55
i think i can provide either the bucket or the service.
– Vincent
Nov 17 '18 at 2:57
indeed.exactly one of --default-service or --default-backend-bucket is required.maybe trygcloud compute url-maps listto see if it even answers.
– Martin Zeitler
Nov 17 '18 at 2:58
I triedgcloud alpha resources list, but it doesn't look like it shows the state of the backend service/url map. For the backend service, it just shows @type/description/name fields. The status code however is exactly what I'm trying to get. The--log-httpoption includes the json response w/ the status code, but how am i supposed to parse it out of all the other text? In the post i referenced, the--log-httpoutput is shown.
– Vincent
Nov 17 '18 at 3:29
ok thanks, ill play with this and get back to you.
– Vincent
Nov 17 '18 at 2:54
ok thanks, ill play with this and get back to you.
– Vincent
Nov 17 '18 at 2:54
@Vincent you're missing one essential option on the command issued.
– Martin Zeitler
Nov 17 '18 at 2:55
@Vincent you're missing one essential option on the command issued.
– Martin Zeitler
Nov 17 '18 at 2:55
i think i can provide either the bucket or the service.
– Vincent
Nov 17 '18 at 2:57
i think i can provide either the bucket or the service.
– Vincent
Nov 17 '18 at 2:57
indeed.
exactly one of --default-service or --default-backend-bucket is required. maybe try gcloud compute url-maps list to see if it even answers.– Martin Zeitler
Nov 17 '18 at 2:58
indeed.
exactly one of --default-service or --default-backend-bucket is required. maybe try gcloud compute url-maps list to see if it even answers.– Martin Zeitler
Nov 17 '18 at 2:58
I tried
gcloud alpha resources list, but it doesn't look like it shows the state of the backend service/url map. For the backend service, it just shows @type/description/name fields. The status code however is exactly what I'm trying to get. The --log-http option includes the json response w/ the status code, but how am i supposed to parse it out of all the other text? In the post i referenced, the --log-http output is shown.– Vincent
Nov 17 '18 at 3:29
I tried
gcloud alpha resources list, but it doesn't look like it shows the state of the backend service/url map. For the backend service, it just shows @type/description/name fields. The status code however is exactly what I'm trying to get. The --log-http option includes the json response w/ the status code, but how am i supposed to parse it out of all the other text? In the post i referenced, the --log-http output is shown.– Vincent
Nov 17 '18 at 3:29
|
show 2 more comments
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53347699%2fhow-to-check-if-gcloud-backend-service-url-map-are-ready%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown