"Step was canceled" with background: true server (Google Cloud Pub/Sub emulator)

circle.yml

#1

Trying to start the Gcloud Pub/Sub emulator that will be required for some of my tests, set up like this :

  - run:
      command: gcloud beta emulators pubsub start
      background: true 

Unfortunately I’m getting the infamous “Step was canceled” error and the step color is dark gray.
The emulator seems to start up just fine : I’m not sure if “step canceled” is a normal thing to see for backgrounded steps once the build has finished, or if there really is a problem (our tests are not using the emulator yet and I haven’t yet tried to connect to it, but I’d like to be ready for when we do need it)

#!/bin/bash -eo pipefail
gcloud beta emulators pubsub start
Executing: /usr/lib/google-cloud-sdk/platform/pubsub-emulator/bin/cloud-pubsub-emulator --host=localhost --port=8085
[pubsub] This is the Google Pub/Sub fake.
[pubsub] Implementation may be incomplete or differ from the real system.
[pubsub] Jan 23, 2018 1:35:23 PM com.google.cloud.pubsub.testing.v1.Main main
[pubsub] INFO: IAM integration is disabled. IAM policy methods and ACL checks are not supported
[pubsub] Jan 23, 2018 1:35:23 PM io.gapi.emulators.netty.NettyUtil applyJava7LongHostnameWorkaround
[pubsub] INFO: Applied Java 7 long hostname workaround.
[pubsub] Jan 23, 2018 1:35:23 PM com.google.cloud.pubsub.testing.v1.Main main
[pubsub] INFO: Server started, listening on 8085
Step was canceled

#2

I’m facing the same issue with the following step.
Have you found a solution?

  - run:
      name: Start API
      command: |
        . gql/bin/activate
        cd example
        python3 api.py
      background: true

Result in the build:

#!/bin/bash -eo pipefail
. gql/bin/activate
cd example
python3 api.py
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Step was canceled

#3

I have verified on another successful build using background: true and “Step was canceled” seems to be the normal behavior. The issue must come from somewhere else.


#4

Received this also on Node.js. Any ideas on how to debug?


#5

Do you mean the “cancelled” thing? As above, I think that’s normal.

Or are you getting another problem, such as tests not working?


#6

Eh, 6 hours later and running a selenium/standalone-chrome:3.0.1 image resolves the problem. Not overly impressed how the the background process aborts/cancels on any error message. It needs to be more resilient, like it used to be in v1.0. If we tell a web server to run in the background, it shouldn’t cancel if something blinks at it.


#7

I don’t think the “cancelled” message is necessarily evidence of that. If you want to dig into it, for the sake of investigating the reliability of your builds, spend some time on the earlier image, and see if you can get some syslogs or the web server logs to see why it failed. Can you paste something of that nature here?


#8

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.