0

We have signals for creating and deleting neomodel node instances based on creation and deletion of mysql instances.

On a hosted system, when calling functions through shell or custom management commands it's working perfectly fine and signals are called and nodes are created.

However, when calling our API endpoints, they return the following error:

Cannot resolve address 09f3562c.databases.neo4j.io:7687

Our code for signals:

@receiver(post_save,sender=settings.AUTH_USER_MODEL)
def create_personNode(sender,instance=None,created=None,**kwargs):
    if created:
        if not instance.is_internal:
            personNode = Person(did=instance.id,uid=instance.uid)
            # personNode.created_at = instance.created_at
            personNode.save()
            if instance.email:
                personNode.email = instance.email
                personNode.save()
            if instance.phone:
                personNode.phone = instance.phone
                personNode.save()
        else:
            pass
    else:
        if not instance.is_internal:
            personNode = Person.nodes.get(did=instance.id)
            if instance.email:
                personNode.email = instance.email
                personNode.save()
            if instance.phone:
                personNode.phone = instance.phone
                personNode.save()

@receiver(post_delete,sender=Users)
def deletePersonNode(sender,instance=None,**kwargs):
    if instance is not None: #and (not instance.is_superuser) and (not instance.is_staff):
        try:
            personNode = Person.nodes.get(did=instance.id)
        except:
            personNode = None
        if personNode is not None:
            personNode.total_delete()

I am using the latest versions of neomodel and neo4j:

  • neo4j 5.8.0
  • neobolt 1.7.17
  • neomodel 5.0.0
  • Django 4.0.2
  • djangorestframework 3.13.1
cybersam
  • 63,203
  • 6
  • 53
  • 76
salty-ivy
  • 1
  • 3

1 Answers1

0

Can you provide the way you set-up the connection with the Neo4j database ? I am specifically interested by the config.DATABASE_URL line.

  • although my issue is fixed by rewiring the gunicorn settings but here it is if you wanna see this url is proxy one here not original but actual implementation is quite same GRAPH_DATABASE_URL=neo4j+s://neo4j:G4Eps5fctnQqitlLanFTff6zRuHgw11HoHnS1VryCjs@09f3562c.databases.neo4j.io where GRAPH_DATABASE_URL is an env variable that would be called by config.DATABASE_URL in settings. – salty-ivy May 18 '23 at 14:15
  • OK. And how did you change the gunicorn settings ? That can help other people with the same probkem in the future. (Also, I think your password's in your comment) – Marius Conjeaud May 22 '23 at 06:30