502 (Bad Gateway)

50 views
Skip to first unread message

Andy Lucas

unread,
Jul 30, 2018, 5:25:45 AM7/30/18
to opentreemap-user
Hi folks,

I know that there is another thread containing a similar question related to 502s but I haven't as yet found it very helpful.
So, I have followed the otm-core installation guide.
All works well apart from (as far as I can see because i'm not sure if I'm missing something on the site that should be displayed but isn't) the tree position indicators, I believe they should be green dots.
In my browser console I do get a very long list of 502 (Bad Gateway) errors, when investigating one of those errors in the Chrome console I see that there is a .png tile not loaded because error: password authentication failed for user "otm"
I did alter the user and the password and the database name, but I think I'm stuck on understanding Step 7 paragraph 2 in the otm-core installation instructions. If I try and add env variables like 

env HOME="/home/otm"
env OTM_DB_USER = 'psr'
env OTM_DB_PASSWORD = 'psrxxxxxx'
env OTM_DB_NAME = 'psrotm'
env OTM_DB_HOST = 'otm.mydomain.com,localhost'
env OTM_DB_PORT = 5432
env OTM_CACHE_HOST = '127.0.0.1'
env OTM_CACHE_PORT = 6379

into the  '/etc/init/tiler.conf' for example, then that service will not start but returns

start: Unknown job: tiler

Where is the default "otm" user set?
How can I add those env vars into those files as instructed without hindering the service startup?
Message has been deleted

Andy Lucas

unread,
Jul 31, 2018, 10:37:14 AM7/31/18
to opentreemap-user
Having altered the default settings in the File: /usr/local/ecoservice/ecorest/config/main.go the tiler now works.
I have entered the settings for the ecoservice in the same way but although the ecoservice is running I get 500 (Internal Server Error) when trying to load the 'explore map' page.
How can I troubleshoot this?

Many thanks for any help, it will be highly appreciated.
Regards



Justin Walgran

unread,
Jul 31, 2018, 5:02:55 PM7/31/18
to opentree...@googlegroups.com
The details of the 500 exception should be written to /var/log/syslog. If you sudo tail -f /var/log/syslog and then try loading https://otm.publicservicerequest.com/niagara/map/ in your browser you should see the exception printed to the console.

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

Andy Lucas

unread,
Aug 1, 2018, 4:15:18 AM8/1/18
to opentreemap-user
Thanks Justin
When I run sudo tail -f /var/log/syslog I get a constant stream of 

Aug  1 08:39:08 vps495003 kernel: [2374959.419213] init: celeryd main process ended, respawning
Aug  1 08:39:08 vps495003 kernel: [2374960.029112] init: celeryd main process (17870) terminated with status 1

at least every second, loading the page as described makes no difference to the log.

Andy Lucas

unread,
Aug 7, 2018, 4:42:24 AM8/7/18
to opentreemap-user
I simply can't get the celeryd service to run, anybody any idea why that is?

the version of celery that is installed is 
celery --version
4.1.0 (latentcall)

service celeryd start
celeryd start/running, process 27697

So the service starts OK BUT as soon as I hit the Explore Map button,  the errors start streaming

Aug  7 09:57:04 vps495003 kernel: [2898036.146117] init: celeryd main process ended, respawning
Aug  7 09:57:05 vps495003 kernel: [2898036.734028] init: celeryd main process (685) terminated with status 1
Aug  7 09:57:05 vps495003 kernel: [2898036.734040] init: celeryd main process ended, respawning
Aug  7 09:57:06 vps495003 kernel: [2898037.339348] init: celeryd main process (703) terminated with status 1
Aug  7 09:57:06 vps495003 kernel: [2898037.339360] init: celeryd main process ended, respawning
Aug  7 09:57:06 vps495003 kernel: [2898037.937058] init: celeryd main process (721) terminated with status 1
Aug  7 09:57:06 vps495003 kernel: [2898037.937068] init: celeryd main process ended, respawning
Aug  7 09:57:07 vps495003 kernel: [2898038.520476] init: celeryd main process (739) terminated with status 1
Aug  7 09:57:07 vps495003 kernel: [2898038.520487] init: celeryd main process ended, respawning
Aug  7 09:57:07 vps495003 kernel: [2898039.147725] init: celeryd main process (757) terminated with status 1
Aug  7 09:57:07 vps495003 kernel: [2898039.147735] init: celeryd main process ended, respawning
Aug  7 09:57:08 vps495003 kernel: [2898039.723356] init: celeryd main process (775) terminated with status 1

in the console of the browser I see one error thus: /niagara/benefit/search:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Really, I need to understand what I can do to debug this, otherwise the Eco Benefits simply do not work. (everything else does though ;-) )

Many thanks for your help if you can.

Justin Walgran

unread,
Aug 10, 2018, 12:47:00 PM8/10/18
to opentree...@googlegroups.com
A little clarification on the three major services that make up OTM:
  • The OpenTreeMap web application, written in Python/Django.
  • The tiler, written in Javascript/nodejs
  • The ecobenefits service, written in go.
The OpenTreeMap Django application uses Celery for background processing of long running tasks like imports and exports. Celery is not used by the ecobenefits service. The celery service should not be failing as you describe, but it is not the cause of the ecobenefit failure.

Ecobenefit requests are made from the browser to the Django app and the Django app then makes a request to the ecobenefits service. There are two general places the /niagara/benefit/search request could be failing, in the Django view, or in the ecoservice itself. You can try running the ecoservice in a shell instead of running it as a service to check for more verbose failure logging.


 
Reply all
Reply to author
Forward
0 new messages