Production install: ImportError: No module named fab.fabfile

53 views
Skip to first unread message

Eucalyptus D

unread,
Oct 12, 2016, 1:51:38 AM10/12/16
to CommCare Developers
Dear all,

This is my 5th attempt to setup commcare on a local server and no success. I am following https://github.com/dimagi/commcare-hq/blob/master/PRODUCTION-INSTALL.md for this attempt.

I have eddited fabfile.py with the task and when I run fab, I receive this error:

  File "/home/user/commcare-hq/fabfile.py", line 10, in <module>
    from fab.fabfile import *
ImportError: No module named fab.fabfile

Are more up to date instructions available anywhere? Please help. thanks.

Euc.

Ben Rudolph

unread,
Oct 12, 2016, 9:51:38 AM10/12/16
to commcare-...@googlegroups.com
Hi Eucalyptus,

You can try installing CommCareHQ with Docker. The instructions for that can be found here: https://github.com/dimagi/commcare-hq/tree/master/docker. Our Docker setup is maintained and used daily by our developers and continuous integration.

Ben

--

---
You received this message because you are subscribed to the Google Groups "CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commcare-developers+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eucalyptus D

unread,
Oct 12, 2016, 11:00:31 AM10/12/16
to CommCare Developers

Thanks Ben, this is helpful.

My concern was the caveats:


  • CloudCare is not currently part of this set up. It should probably be another docker image, different from CommCareHQ.
  • Celery, rabbitmq and other components not strictly necessary for a laptop install are not part of this setup.
This gives the impression that the docker setup is intended for demonstration purposes and not for more stable production runs.

Is there a tutorial to improve this setup? thanks for your help.

Euc.

Ben Rudolph

unread,
Oct 12, 2016, 12:11:56 PM10/12/16
to commcare-...@googlegroups.com
Correct, this isn't used in a production environment, so I can't guarantee it'll work perfectly in that situation. We use ansible to deploy our stack to our different environments: https://github.com/dimagi/commcarehq-ansible. It's complex and there are a fair number of moving parts, but it may be of some use for you. Unfortunately, the documentation for it isn't the best. I'm not sure the requirements of your setup, but you could use docker and then setup Cloudcare and celery independently.

Alternatively, you can always use our hosted version https://www.commcarehq.org/. The most basic plan is free. We also offer support and setup for environments that need to be hosted elsewhere.

Ben

To unsubscribe from this group and stop receiving emails from it, send an email to commcare-developers+unsubscribe...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Eucalyptus D

unread,
Oct 12, 2016, 12:32:18 PM10/12/16
to CommCare Developers
Thanks Ben, I will try the docker and ansible procedure and share feedback.
To unsubscribe from this group and stop receiving emails from it, send an email to commcare-developers+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eucalyptus D

unread,
Oct 13, 2016, 11:10:04 AM10/13/16
to CommCare Developers
Dear Ben,

Thanks for your guidance. I am now using docker and its running mostly well. Some issues came up:

1. User menu has disappeared so I can't add more users. How do I restore it? Please see attached a screengrab. The menu was previously complete. Also, I created a new project and it has complete menu.
2. The web pages load slowly. How do I improve the response time? I am running the docker image on 4 processor/64Gb RAM VM yet web pages take significant time to render.

Kindly assist. regards.

Euc
docker-Capture.JPG

Ben Rudolph

unread,
Oct 13, 2016, 11:50:40 AM10/13/16
to commcare-...@googlegroups.com
Hi Euc,

1. I'm not exactly sure why your tabs are missing without inspecting your setup, but I suspect it may be a permissions issue. Check https://github.com/dimagi/commcare-hq/blob/master/corehq/tabs/tabclasses.py file and check out the `_is_viewable` function to see the conditions for why certain tabs are available.

2. Great question, if I totally knew the answer than our website would be a lot faster! There are many places where the slow down can happen, especially in development. I would try excluding any unnecessary apps (such as djangoextensions). You also may want to try reworking the way staticfiles are parsed, you can read more about that here: https://github.com/dimagi/commcare-hq#option-2-let-django-do-it-as-changes-are-made-cache-results-in-redis. Otherwise I'm not sure if there's any magic bullet. You can always try profiling the app to see where the slowdowns are.

Ben

To unsubscribe from this group and stop receiving emails from it, send an email to commcare-developers+unsubscribe...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commcare-developers+unsubscribe...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Farid Rener

unread,
Oct 13, 2016, 12:01:19 PM10/13/16
to commcare-...@googlegroups.com
Hi Euc,

To add to what Ben said, if you are trying to run this as a production environment, you should set the DEBUG flags to False in your localsettings.py. Depending on how your static files are set up, you might want to follow the instructions to pre-compress and serve your static files here.

The users menu disappearing might be due to not having the proper web user roles on your web user. You can see here for more information on user roles. For other questions about how CommCare works, that wiki is a good source of knowledge.

Hope that helps,

Farid

Eucalyptus D

unread,
Oct 13, 2016, 12:25:49 PM10/13/16
to CommCare Developers

Thanks Ben and Farid, Its weird but the admin role is displayed as unknown (screenshot attached). This is the default account in docker setup and I did not change anything. I appreciate your assistance on this. regards.
To unsubscribe from this group and stop receiving emails from it, send an email to commcare-developers+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commcare-developers+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commcare-developers+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
admin-Capture.JPG

NWAWEL A IROUME

unread,
Aug 7, 2017, 5:58:46 AM8/7/17
to CommCare Developers
remove fabric from your system with sudo apt-get remove fabric
Reply all
Reply to author
Forward
0 new messages