ODM2 / WOFpy

A server-side implementation of CUAHSI's Water One Flow service stack in Python.
http://odm2.github.io/WOFpy/
9 stars 9 forks source link

installation error #195

Closed miguelcleon closed 7 years ago

miguelcleon commented 7 years ago

@lsetiawan

I'm trying to install WOFpy on the production server and I'm getting an error, it seems like it should work, the dev part worked from your documentation but when I try to set it up for production I'm getting an apache error.

[Fri Oct 06 19:39:19.136206 2017] [core:notice] [pid 1652:tid 140229002598272] AH00094: Command line: '/usr/sbin/apache2' [Fri Oct 06 19:39:25.815143 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] mod_wsgi (pid=61627): Target WSGI script '/home/azureadmin/webapps/wofpyserverprod/odm2/timeseries/wsgi.py' cannot be loaded as Python module. [Fri Oct 06 19:39:25.815176 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] mod_wsgi (pid=61627): Exception occurred processing WSGI script '/home/azureadmin/webapps/wofpyserverprod/odm2/timeseries/wsgi.py'. [Fri Oct 06 19:39:25.815194 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] Traceback (most recent call last): [Fri Oct 06 19:39:25.815207 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] File "/home/azureadmin/webapps/wofpyserverprod/odm2/timeseries/wsgi.py", line 3, in [Fri Oct 06 19:39:25.815226 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] from runserver import app as application [Fri Oct 06 19:39:25.815233 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] File "/home/azureadmin/webapps/wofpyserverprod/odm2/timeseries/runserver.py", line 44, in [Fri Oct 06 19:39:25.815242 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] app = wof.flask.create_wof_flask_app(dao, args.config) [Fri Oct 06 19:39:25.815248 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] File "/home/azureadmin/miniconda2/envs/wofpy/lib/python2.7/site-packages/wof/flask/init.py", line 198, in create_wof_flask_app [Fri Oct 06 19:39:25.815311 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] app = create_wof_flask_multiple({wConf},templates=templates) [Fri Oct 06 19:39:25.815319 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] File "/home/azureadmin/miniconda2/envs/wofpy/lib/python2.7/site-packages/wof/flask/init.py", line 209, in create_wof_flask_multiple [Fri Oct 06 19:39:25.815330 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] wof_obj_1_0 = wof_1_0.WOF(wConf.dao, wConf.config, templates) [Fri Oct 06 19:39:25.815335 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] File "/home/azureadmin/miniconda2/envs/wofpy/lib/python2.7/site-packages/wof/core_1_0.py", line 38, in init [Fri Oct 06 19:39:25.815482 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] self.config_from_file(config_file) [Fri Oct 06 19:39:25.815497 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] File "/home/azureadmin/miniconda2/envs/wofpy/lib/python2.7/site-packages/wof/core_1_0.py", line 44, in config_from_file [Fri Oct 06 19:39:25.815509 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] config = core.WOFConfig(file_name) [Fri Oct 06 19:39:25.815513 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] File "/home/azureadmin/miniconda2/envs/wofpy/lib/python2.7/site-packages/wof/core.py", line 114, in init [Fri Oct 06 19:39:25.815521 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] self.network = config.get('WOF', 'Network') [Fri Oct 06 19:39:25.815526 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] File "/home/azureadmin/miniconda2/envs/wofpy/lib/python2.7/site-packages/backports/configparser/init.py", line 792, in get [Fri Oct 06 19:39:25.815744 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] d = self._unify_values(section, vars) [Fri Oct 06 19:39:25.815761 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] File "/home/azureadmin/miniconda2/envs/wofpy/lib/python2.7/site-packages/backports/configparser/init.py", line 1162, in _unify_values [Fri Oct 06 19:39:25.815785 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] raise NoSectionError(section) [Fri Oct 06 19:39:25.815804 2017] [wsgi:error] [pid 61627:tid 140228907034368] [remote 165.123.20.27:44942] NoSectionError: No section: 'WOF'

lsetiawan commented 7 years ago

@miguelcleon That looks like a problem in your .cfg file https://github.com/ODM2/WOFpy/blob/master/wof/examples/flask/odm2/timeseries/odm2_config_timeseries.cfg#L1 ... is it missing [WOF]?

miguelcleon commented 7 years ago

it does have [WOF]

[WOF]
Network: ODM2Timeseries
Vocabulary: ODM2Timeseries
Menu_Group_Name: ODM2
Service_WSDL: http://127.0.0.1:8080/soap/wateroneflow.wsdl
Timezone: 00:00
TimezoneAbbreviation: GMT

[Default_Params]
Site: Rio Icacos Trib-IO
Variable: DO Concentration
StartDate: 2016-12-01T12:00:00
EndDate: 2016-12-01T14:30:00

[WOF_1_1]
Service_WSDL: http://127.0.0.1:8080/soap/wateroneflow_1_1.wsdl

[Default_Params_1_1]
West: -114
South: 40
East: -110
North: 42

[WOFPY]
Templates: ../../../../../wof/flask/templates
...
emiliom commented 7 years ago

Also, if I remember correctly you never deployed a "production" (ie, publicly accessible) WOFpy with Apache, did you? All the testing and deployments we're aware of (including Don's) have been with NGINX. So there's still the possibility that there's some Apache quirks that we haven't encountered and will need to figure out, right @lsetiawan?

miguelcleon commented 7 years ago

I did have them running on a development server, and the web services were being served via apache. However I installed an SSL certificate on the development server and now it is not working so I thought I'd try installing it on the production server with a fresh installation of wofpy.

miguelcleon commented 7 years ago

Actually CUAHSI installed the SSL cert, so they are going to look at it otherwise I would try to fix that.

lsetiawan commented 7 years ago

Also, if I remember correctly you never deployed a "production" (ie, publicly accessible) WOFpy with Apache, did you? All the testing and deployments we're aware of (including Don's) have been with NGINX. So there's still the possibility that there's some Apache quirks that we haven't encountered and will need to figure out, right @lsetiawan?

Yea, I've never done WOFpy installation on Apache... Not sure what's going on. From the errors, it looks like the problem is somehow WOFpy is not reading the .cfg file correctly. Sorry 😞

emiliom commented 7 years ago

... and of course, it's Friday afternoon! @lsetiawan is actually a bit sick right now, so I suggest he take a break and get back to helping @miguelcleon with this problem on Monday, all refreshed and ready to trouble shoot.

miguelcleon commented 7 years ago

Ok, no problem @lsetiawan feel better!

lsetiawan commented 7 years ago

@miguelcleon Thanks! 👍

miguelcleon commented 7 years ago

@emiliom @lsetiawan and I figured it out. My dao wasn't setup right in runserver.py. I'm seeing more things here but that can wait for next week.

miguelcleon commented 7 years ago

the confusion came here, this did not work: https://github.com/ODM2/WOFpy/blame/master/docs/WOFpyODM2LBR_installation.md#L238

one should instead change the default configuration file parser argument like here: https://github.com/ODM2/WOFpy/blob/master/wof/examples/flask/odm2/timeseries/runserver_odm2_timeseries.py#L35

emiliom commented 7 years ago

Awesome! Let us know on Monday what problems you're still seeing.

For reference, your installation attempts (and the issue of Apache) started in #73. It'll be great to have WOFpy on top of your LCZO database, and to get from you tips about what needs to be done differently to configure it on Apache.

Also, I seriously need to get back to cleaning up the installation instructions ... I've been neglecting that task for far too long.

emiliom commented 7 years ago

@miguelcleon, can we close this issue and #73?

And I'll bug you again: It'll be great to get from you tips about what needs to be done differently to configure it on Apache.

I'll keep bugging you about this :smiling_imp:

miguelcleon commented 7 years ago

Ok, I created a pull request https://github.com/ODM2/WOFpy/pull/199 for the documentation fix I suggested. I can add more for the Apache configuration.

emiliom commented 7 years ago

Closing. Created #218 to follow up on remaining to-do regarding Apache documentation