Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

Failing to create service in heroku-type deployment #42

Open
blysik opened this issue Nov 9, 2015 · 18 comments
Open

Failing to create service in heroku-type deployment #42

blysik opened this issue Nov 9, 2015 · 18 comments

Comments

@blysik
Copy link

blysik commented Nov 9, 2015

I have it deployed in a Heroku-like system. (Uses Heroku buildpacks, generally behaves like Heroku.) Everything looks good.

However, when I try to save a new Service, I get this error:

DataError at /services/save
invalid input syntax for uuid: "0"
LINE 1: ... FROM "openduty_service" WHERE "openduty_service"."id" = '0'

In the Postgres log:

ERROR:  invalid input syntax for uuid: "0" at character 257
STATEMENT:  SELECT "openduty_service"."name", "openduty_service"."id", "openduty_service"."retry", "openduty_service"."policy_id", "openduty_service"."escalate_after", "openduty_service"."notifications_disabled" FROM "openduty_service" WHERE "openduty_service"."id" = '0'

Any ideas?

@blysik
Copy link
Author

blysik commented Nov 9, 2015

Perhaps related:
dcramer/django-uuidfield#46

@blysik
Copy link
Author

blysik commented Nov 9, 2015

It feels like openduty is trying to save the Service with an id of '0', but since postgres doesn't think '0' is a proper UUID, it fails?

@deathowl
Copy link
Contributor

deathowl commented Nov 9, 2015

Wow, amazing bugreport, looking right into the issue.

deathowl pushed a commit that referenced this issue Nov 10, 2015
@deathowl
Copy link
Contributor

The commit above should fix your issue, could you please confirm, that it did? If so, please close this issue @blysik

@deathowl
Copy link
Contributor

Also, if you use a heroku-like env to run openduty, don't forget to launch your workers also. You could add the required commands to launch celeryd to the procfile

@blysik
Copy link
Author

blysik commented Nov 10, 2015

Deploying the fix now. Here's what I've added to my Procfile for the worker stuff:

celery: celery worker -A openduty --loglevel=INFO -Ofair
scheduler: celery worker -B -A openduty --loglevel=INFO -Ofair

That look fine?

@deathowl
Copy link
Contributor

yeah, totally

@blysik
Copy link
Author

blysik commented Nov 10, 2015

Looks like a different error now. Here's the error from the postgres log side:

ERROR:  invalid input syntax for uuid: "" at character 175
STATEMENT:  UPDATE "openduty_service" SET "name" = 'SEO Standard', "retry" = 10, "policy_id" = 1, "escalate_after" = 30, "notifications_disabled" = false WHERE "openduty_service"."id" = ''

@blysik
Copy link
Author

blysik commented Nov 10, 2015

The error page is showing it to be line 90, at services.py. That service.save()

@deathowl
Copy link
Contributor

Thanks, will check that overnight.

@blysik
Copy link
Author

blysik commented Nov 16, 2015

Any other data I can provide to help troubleshoot this?

@deathowl
Copy link
Contributor

Thanks, data provided is enough, i think i'll find the time tomorrow to look into it, sorry for the delay of things, I'm pretty busy at the moment.

@deathowl
Copy link
Contributor

BTW i tested it on Heroku, and for me my patch DID work with postgres without any errors.

@blysik
Copy link
Author

blysik commented Nov 16, 2015

No problem at all! I appreciate you looking at it.

I wonder if it's a versioning issue of my postgres.

@deathowl
Copy link
Contributor

HI! I just got back to this, Is it still actual @blysik ? If yes dont hesitate to ask around

@blysik
Copy link
Author

blysik commented Mar 14, 2016

Yes, I just checked, and that error still happens when I try to save a service.

carxwol pushed a commit to HexACK/openduty that referenced this issue Nov 15, 2017
… Django 1.8, closes ustream#42

Conflicts:
	openduty/models.py
carxwol pushed a commit to HexACK/openduty that referenced this issue Nov 15, 2017
@carxwol
Copy link

carxwol commented Nov 15, 2017

It's not happening anymore without django-uuidfield requirement.
UUIDField is integrated into Django 1.8, so i just removed it :
https://docs.djangoproject.com/en/1.8/ref/models/fields/#uuidfield

  • I tested it in a new virtualenv, python manage.py goes fine (if you begin with migrate auth and migrate schedule first.
  • python manage.py makemigrations makes nothing, which is a good thing
  • maybe i should test it from an existing installation

forkwhilefork pushed a commit to forkwhilefork/openduty that referenced this issue Mar 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants