11

I am maintaining a project, with Travis CI implemented, and from one day. All my builds start failing without me touching anything or any dependence update ...

I guess that Travis changed something, I tried to investigate, but honestly I have no clue.

If I run a previous build which perfectly worked, now it fails with this everytime I call python manage.py ##whatever##

$ python manage.py collectstatic --noinput
Traceback (most recent call last):
  File "manage.py", line 35, in <module>
    execute_from_command_line(sys.argv)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/core/management/__init__.py", line 357, in execute
    django.setup()
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/apps/registry.py", line 81, in populate
    raise RuntimeError("populate() isn't reentrant")
RuntimeError: populate() isn't reentrant

By the way, I obtain the exact same error with Python 3.6 and 3.5.

$ python manage.py collectstatic --noinput
Traceback (most recent call last):
  File "manage.py", line 35, in <module>
    execute_from_command_line(sys.argv)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/django/core/management/__init__.py", line 357, in execute
    django.setup()
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/django/apps/registry.py", line 81, in populate
    raise RuntimeError("populate() isn't reentrant")
RuntimeError: populate() isn't reentrant

And naturally, this issue is impossible to reproduce on my own machine ... It's running just fine locally.


Additional Information:

If I take a former build which already passed without any issue:

Link: Travis Build #1336

enter image description here

And I decide to relaunch the build, as you can see the builds are now failing for an obscure reason...

enter image description here

Any idea how to solve this issue ?

Jonathan DEKHTIAR
  • 3,456
  • 1
  • 21
  • 42
  • What are the differences between local and travis? For example, are you using a different type of database on each? – Cole Oct 13 '18 at 21:55
  • To me, they looks really similar. Same package versions, same python version... Also same database version... Somehow Django fails for an unknown reason... – Jonathan DEKHTIAR Oct 13 '18 at 21:56
  • Do you have separate settings files for each environment? – Cole Oct 13 '18 at 21:58
  • Absolutely not, the code base is the same. By the way if you want to have a look https://github.com/DEKHTIARJonathan/FeedCrunch.IO – Jonathan DEKHTIAR Oct 13 '18 at 21:59
  • I am pretty sure the error is on Travis side, previous build which worked perfectly are now failing if I relaunch them... That makes no sense to me – Jonathan DEKHTIAR Oct 13 '18 at 22:00
  • It started failing after [this](https://github.com/DEKHTIARJonathan/FeedCrunch.IO/compare/7b299eece404...e7b1df74a8b3). Have you looked at that dependency? – Cole Oct 13 '18 at 22:03
  • @Cole I updated my post with screenshot to show you that my code is not the problem. If I rebuild a perfectly working commit, the build will fail ;) I just relaunched one to show a minute ago: https://travis-ci.org/DEKHTIARJonathan/FeedCrunch.IO/builds/427397085 – Jonathan DEKHTIAR Oct 13 '18 at 22:13
  • it looks like an environmental variables issue :/ i believe that somehow you didnt create a project yet you updated your django version thus you use a django without any settings, you can compare your settings file :/ – Lumenified Oct 13 '18 at 22:27
  • One think that I have noticed is that "Travis CI" upgrade. Your successful build has the below version version: " v4.1.2 https://github.com/travis-ci/worker/tree/91246b057ccd93649046771f29221f839c19a7d3" whereas build started failing with the version "version: v4.2.0 https://github.com/travis-ci/worker/tree/7d17a81b8afc19da6842f1153f37371e859f4ccd" – vijayalakshmi d Oct 13 '18 at 22:29
  • I'm not sure to follow you... How shall I correct it? I mean my code was perfectly working until something changed beyond my control... And I have no idea how to fix it – Jonathan DEKHTIAR Oct 13 '18 at 22:29
  • when you add your "application" to the installed apps, does it not run ? – Lumenified Oct 13 '18 at 22:36
  • It perfectly works on all the machines I have... The only environnement where it is failing is Travis... And it did it suddenly for no obvious reason... – Jonathan DEKHTIAR Oct 13 '18 at 22:39
  • there are some solutions about populate() but it looks like every solution is different than other, but the common problem is about apache and aws lambda, i suggest you to take a look at them :/ i hope you fix it :( – Lumenified Oct 13 '18 at 22:55
  • This seems like a Travis problem. Check out the worker information between the failed runs and the successful ones. @vijayalakshmid pointed it out at first, but there is a pretty big discrepancy between the failing and passing builds. – Julian Oct 18 '18 at 20:17
  • @JonathanDEKHTIAR were you able to solve this? We started having this issue seemingly randomly yesterday. – schillingt Dec 05 '18 at 15:36
  • I have solved it. However unfortunately I have no idea which combination of changes I applied fixed the issue on Travis side... Sorry – Jonathan DEKHTIAR Dec 05 '18 at 15:39
  • Fair enough, thanks anyway! – schillingt Dec 05 '18 at 15:54
  • is anything here useful? https://stackoverflow.com/questions/27093746/django-stops-working-with-runtimeerror-populate-isnt-reentrant – Anentropic Aug 07 '19 at 16:44
  • I guess `pip install -r requirements.txt --upgrade` is upgrading your packages, meaning you'll go to latests Django versions. A _lot_ of packages do not support latest dajngo versions. I'd remove the `--upgrade` inside your travis.yml – Julien Kieffer Aug 24 '19 at 17:10

0 Answers0