Skip to content

There is no current event loop in thread 'Thread-2 (process_request_thread)'. #1387

Closed
@gwennlbh

Description

@gwennlbh
  • What is the current behavior?

A simple query fails with a cryptic, seemingly asyncIO-related error:

{
  "errors": [
    {
      "message": "There is no current event loop in thread 'Thread-2 (process_request_thread)'.",
      "locations": [
        {
          "line": 34,
          "column": 3
        }
      ],
      "path": [
        "tests"
      ]
    }
  ],
  "data": {
    "tests": null
  }
}
  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via

Link to reproduction repository: https://github.com/ewen-lbh/bug-report-django-graphene

Steps to reproduce:

  1. git clone https://github.com/ewen-lbh/bug-report-django-graphene

  2. cd bug-report-django-graphene

  3. poetry install (or pip install -r requirements.txt )

  4. cd repro

  5. poetry run python manage.py migrate && poetry run python manage.py runserver

  6. Navigate to 127.0.0.1:8000/graphql

  7. Try executing the following query:

     {
     	tests {
     		testing
     	}
     }
    
  • What is the expected behavior?

The query executes and returns its result

  • What is the motivation / use case for changing the behavior?

  • Please tell us about your environment:

    • Version: graphene-django 3.0.0, django 4.1.5, python 3.10.9
    • Platform: Manjaro Linux 5.19.17-2-MANJARO
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions