Closed JrtPec closed 8 years ago
I'll try a have look somewhere in the coming days.
@JrtPec module=website
is indeed what needs changing. However, the file in the repository is only a template/example. The real config file is in /etc/uwsgi/apps-available/opengrid.ini. I changed it there too.
Now when I do service uswgi restart opengrid
, I get the following in the logs (/var/log/uwsgi/app/opengrid.log
):
Fri Jan 15 18:55:08 2016 - added /usr/local/src/website/ to pythonpath.
Traceback (most recent call last):
File "/usr/local/src/website/website.py", line 11, in <module>
from opengrid.library import houseprint
File "/usr/local/src/website/opengrid.py", line 18, in <module>
File "/usr/local/src/website/cache_anonymous_houseprint.py", line 19, in cache
File "/usr/local/src/opengrid/scripts/../../opengrid/library/houseprint.py", line 40, in __init__
File "/usr/lib/python2.7/ConfigParser.py", line 618, in get
raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'json' in section: 'houseprint'
Something wrong with the configuration?
It is fixed.
There were two problems:
The file /usr/local/src/website/opengrid.py
was renamed to website.py
, so opengrid.py
didn't exist anymore. the .pyc
files however did, so whenever I called from opengrid import ...
it would try and import from that file instead of from the 'real' opengrid.
After that I got this:
Traceback (most recent call last):
File "/usr/local/src/website/website.py", line 17, in <module>
hp = houseprint.Houseprint()
File "/usr/local/lib/python2.7/dist-packages/opengrid/library/houseprint/houseprint.py", line 48, in __init__
gjson = config.get('houseprint','json')
File "/usr/lib/python2.7/ConfigParser.py", line 618, in get
raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'json' in section: 'houseprint'
Which was weird because it should be importing opengrid from the folder where we have it cloned from github, this is where the config files etc. are correct. So I guess that when you install opengrid via pip it takes it from there and this causes issues. (Ideally, an opengrid developer shouldn't have opengrid installed via pip). I ran `pip uninstall opengrid' and now everything works.
@saroele I hope I haven't broken anything else by deinstalling opengrid via pip...
Well done jan and wouter. I'm still struggling with the diff between pip install and developer install, ideally they should not mess-up each other. I'll check if other things on the droplet are broken by the pip uninstall opengrid.
On Sat, Jan 16, 2016 at 6:08 PM, Jan Pecinovsky notifications@github.com wrote:
@saroele https://github.com/saroele I hope I haven't broken anything else by deinstalling opengrid via pip...
— Reply to this email directly or view it on GitHub https://github.com/opengridcc/website/issues/12#issuecomment-172228912.
@saroele @wouterh I need some help
Yesterday we made the website up to date with the new structure. In order to get this working, we needed to rename the website executable from
opengrid.py
towebsite.py
, because we had to include imports such asfrom opengrid.library import houseprint
and this resulted in some naming conflicts if the executable was also namedopengrid
.I have altered
opengrid.uwsgi.ini
, changedmodule=opengrid
tomodule=website
, in the hope that this setting pointed uwsgi to the executable. Apparently there is more to it, because since I ransudo service uwsgi restart opengrid
the website is effectively down. @wouterh Can you perhaps help out?