Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Bookshelf on Kubernetes Engine Tutorial: Backend doesn't start #87

Closed
dhruvbhatia opened this issue Jan 4, 2018 · 9 comments
Closed
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@dhruvbhatia
Copy link

I'm trying to follow the Bookshelf on Kubernetes Engine tutorial, however get caught out when trying to deploy the bookshelf-worker backend, as per this step.

It looks like the bookshelf-worker pods fail to start and then backs off after too many failures:

> kubectl create -f bookshelf-worker.yaml
> kubectl get pods

NAME                                  READY     STATUS             RESTARTS   AGE
bookshelf-frontend-4221472564-czvth   1/1       Running            0          13m
bookshelf-frontend-4221472564-fwkbz   1/1       Running            0          13m
bookshelf-frontend-4221472564-vjmzg   1/1       Running            0          13m
bookshelf-worker-3385195378-xg9r5     0/1       CrashLoopBackOff   6          8m
bookshelf-worker-3385195378-zqwx9     0/1       CrashLoopBackOff   6          8m

I looked at the logs and a NoMethodError seems to be the culprit:

> kubectl logs -f bookshelf-worker-3385195378-xg9r5
12:26:22 worker.1 | started with pid 31
12:26:25 worker.1 | Running worker to lookup book details
12:26:26 worker.1 | rake aborted!
12:26:26 worker.1 | NoMethodError: undefined method `subscription' for nil:NilClass
12:26:26 worker.1 | /app/lib/active_job/queue_adapters/pub_sub_queue_adapter.rb:32:in `run_worker!'
12:26:26 worker.1 | /app/lib/tasks/run_worker.rake:4:in `block in <top (required)>'
12:26:26 worker.1 | /app/vendor/bundle/ruby/2.2.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
12:26:26 worker.1 | Tasks: TOP => run_worker
12:26:26 worker.1 | (See full trace by running task with --trace)
12:26:26 worker.1 | exited with code 1
12:26:26 system   | sending SIGTERM to all processes

Any ideas on how to resolve? Assistance appreciated.

@frankyn frankyn self-assigned this Jan 8, 2018
@frankyn
Copy link
Member

frankyn commented Jan 8, 2018

Hi @dhruvbhatia,

Thanks for filing an issue. Follow-up question, did you create a Pub/Sub topic named lookup_book_details_queue? This might be the issue given the error message.

@dhruvbhatia
Copy link
Author

Thanks @frankyn.
I tried creating the lookup_book_details_queue topic as per your advice, however I'm unfortunately still seeing the same error message. Any other ideas?

@frankyn
Copy link
Member

frankyn commented Jan 11, 2018

I missed the step of also creating a PULL subscription for lookup_book_details_queue topic named lookup_book_details. I'm hitting another bug in the frontend. I'll update this issue when I have a proper fix.

@frankyn
Copy link
Member

frankyn commented Jan 12, 2018

@dhruvbhatia I created a short patch to help fix the follow-up issue in fix.patch.

You can apply it to the cloned repo by using:

git apply fix.patch

It should allow you to start it successfully given the topic lookup_book_details_queue.

Please let me know if this unblocks you, thank you!

@frankyn
Copy link
Member

frankyn commented Jan 18, 2018

Friendly bump, @dhruvbhatia. Did this resolve your issue?

@dhruvbhatia
Copy link
Author

Hi @frankyn, thanks again. I saved that gist as fix.patch, however I'm getting the following error when trying trying to git apply fix.patch:

error: corrupt patch at line 200

@frankyn
Copy link
Member

frankyn commented Jan 18, 2018

@dhruvbhatia, ah I didn't modify something correctly. I updated the gist could you try again?

@dhruvbhatia
Copy link
Author

@frankyn thanks. Unfortunately still receiving the corrupt patch message when trying to apply it! Any other ideas?

@frankyn
Copy link
Member

frankyn commented Jan 31, 2018

I'm working on an update to the repo @dhruvbhatia, if you'd like the fix before I merge use:

git clone git@github.com:GoogleCloudPlatform/getting-started-ruby.git
git checkout fix-kubernetes-engine

We appreciate your patience. Apologies for the delays.

@frankyn frankyn closed this as completed Mar 2, 2018
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants