Issues with OneBusAway API Webapp v2.0.0

202 views
Skip to first unread message

Francois Rioux

unread,
Jan 5, 2021, 3:53:39 PM1/5/21
to onebusaway-developers
Hello everyone,

I'm trying to deploy OneBusAway v2.0.0 following this guide : https://github.com/OneBusAway/onebusaway/wiki/Configuration-and-Deployment-Guide-for-v2.x

I followed the the guide and manage to setup the app with no hiccups, I was able to go to port 8080 and see all the routes and stops in my GTFS.

However, I can't get any realtime information to show up. After looking around a bit, I found thant all the calls made to the OneBusAway API webapp fail with the rather unhelpful message "Server Error There was an error processing your request. Please try again." along with a 404 HTTP status code.

Looking into what could've gone wrong in setting up the webapp, I found to potential leads but I'm stumped as to how to adresse them.

  • First, looking at the catalina.out log file I see a lot of the following exceptions : "javax.net.ssl.SSLException MESSAGE: closing inbound before receiving peer's close_notify". They seem to originate from a call in OneBusAway Federation relating to Service Alerts (at org.onebusaway.transit_data_federation.impl.federated.TransitDataServiceImpl.getServiceAlerts(TransitDataServiceImpl.java:471)). My Realtime feed does not have Service Alerts, is it what could cause the issue?
  • Second, when looking at the data-source.xml file for the OneBusAway Enterprise ACTA Webapp provided in the guide, there seems to be references to the NYC version of the app, specifically a parameter for "configurationServiceClient" referencing a file named "/var/lib/obanyc/config.json" which is not mentioned in the guide and another where the value for  a property named "cacheManager.cacheManagerName" is "org.onebusaway.nyc_webapp.cacheManager". Could these configuration be faulty and cause the issues?
Please let me know if this rings any bell or if you need me to provide more information relating to these issues

Kind regards,
Francois R

Vicente Pérez

unread,
Jan 5, 2021, 6:24:55 PM1/5/21
to onebusaway...@googlegroups.com
Hi Francois, 

Did you configure correctly GtfsRealtimeSource bean in the transit data federation?. With this I mean  particularly tripUpdatesUrl and vehiclePositionsUrl.

Regards 
Vicente 

--
You received this message because you are subscribed to the Google Groups "onebusaway-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onebusaway-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/onebusaway-developers/1160e8b7-f34b-41f0-a594-9e1b5edfb67eo%40googlegroups.com.

Francois Rioux

unread,
Jan 6, 2021, 9:47:02 AM1/6/21
to onebusaway...@googlegroups.com
My data-source.xml for the transit data federation is as follows
image.png

The URLs are available with a wget from my OneBusAway server and the agencyId matches the on in the GTFS.

Vicente Pérez

unread,
Jan 7, 2021, 6:37:07 PM1/7/21
to onebusaway...@googlegroups.com
Hi Francois,

It looks ok, but just in case, are you sure that the agencyId is "0"?.  

What might happen is that the real time information does not match the  GTFS file you configured or time zone issue, as far as I remember it was fixed, but the server should run at the same time zone as the GTFS. Use -Duser.timezone=YourZoneId. as a java parameter.

Hope this helps.

Sheldon A. Brown

unread,
Jan 9, 2021, 9:57:17 AM1/9/21
to onebusaway...@googlegroups.com
Vincente's advice is good.  But let's step back a level first.

The typical procedure for debugging real-time is this:

* verify that the bundle loaded correctly.  The TDS log (tds.YYYY-MM-DD.log) should show the following:
-> INFO  [HttpBundleStoreImpl.java:xxx] : Found 1 bundle(s)

 available from the Server.

</snip a bunch of logging>

INFO  [BundleManagementServiceImpl.java:xxx] : Refresh/reload of bundle data complete.

INFO  [BundleManagementServiceImpl.java:xxx] : Garbage collection after bundle switch complete.

INFO  [BundleManagementServiceImpl.java:xxx] : New bundle is now ready.


If you see these messages then the static data is loaded properly.  If you do not see these, or can't find the log, don't continue until you verify the above.


* next verify the realtime data is matching to the static data, as Vincente says.  You should see:

INFO  [GtfsRealtimeSource.java:xxx] : Agency X has active vehicles=328 for updates=328 with most recent timestamp Sat Jan 09 09:48:16 EST 2021


If you don't see these messages, or if active vehicles is 0, then either your GtfsRealtime source is not configured properly, not connected to a feed as expected, or not matching to the static data.  A hint here as well: the timezone of the system should match the timezone of the feed.


* next verify the API tier is properly hooked up to the TDS.  Try something like this to verify:

wget -O - http://<api-server>:<api-port>/<api-context>/api/where/agencies-with-coverage.json?key=<key>


If this doesn't work, then verify your API data-sources is properly configured to point to your TDS.


* next verify the API tier has data, via something like this:

wget -O - http://<api-server>:<api-port>/<api-context>/api/where/vehicles-for-agency/1.json?key=<key>



If you are still stuck, please post your logs so I can dig deeper.


Good luck!


Sheldon



riou...@gmail.com

unread,
Jan 11, 2021, 11:57:28 AM1/11/21
to onebusaway-developers
I am sure of the agencyId, here is the agency.txt I am using
agency_id,agency_name,agency_url,agency_timezone,agency_lang,agency_phone
0,Société de Transport de Trois-Rivières,http://www.sttr.qc.ca/,America/Montreal,fr-CA,819-373-4533

For the timezone, at first the server was on America/Toronto. In theory this is the same as America/Montreal, but I changed it to be sure.

I couldn't find the TDS log. I did a find on the whole file system and didn't find anything. Where is this file located usually? In fact, the only logs I could find were internal tomcat logs such as catalina.out.
Otherwise I think the static data is loaded, since I can see all the routes, stops and such in the web app.

Thanks again for your help, it is much appreciated,
Francois R

Vicente Pérez

unread,
Jan 11, 2021, 6:30:20 PM1/11/21
to onebusaway...@googlegroups.com
Francois,


Take a look at the log4j.xml file configuration. You should find FileNamePattern property with the path.  

<?xml version="1.0" encoding="UTF-8" ?>

<!--


    Copyright (C) 2011 Metropolitan Transportation Authority


    Licensed under the Apache License, Version 2.0 (the "License");

    you may not use this file except in compliance with the License.

    You may obtain a copy of the License at


            http://www.apache.org/licenses/LICENSE-2.0


    Unless required by applicable law or agreed to in writing, software

    distributed under the License is distributed on an "AS IS" BASIS,

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    See the License for the specific language governing permissions and

    limitations under the License.


-->

<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">


<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">


    <!-- 0 or more renderer elements -->


    <!-- 0 or more appender elements -->


    <appender name="ROLL" class="org.apache.log4j.rolling.RollingFileAppender">

        <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">

            <param name="FileNamePattern" value="/var/lib/oba/logs/tds.%d.log" />

        </rollingPolicy>


        <layout class="org.apache.log4j.PatternLayout">

            <!-- The log message pattern -->

            <param name="ConversionPattern" value="%d{ISO8601} %-5p [%F:%L] : %m%n" />

        </layout>

    </appender>


    <appender name="stdout" class="org.apache.log4j.ConsoleAppender">


        <layout class="org.apache.log4j.PatternLayout">

            <!-- The log message pattern -->

            <param name="ConversionPattern" value="%d{ISO8601} %-5p [%F:%L] : %m%n" />

        </layout>

    </appender>


    <!-- 0 or more logger/category elements -->

    <!-- org.onebusaway.transit_data_federation.impl.realtime.gtfs_realtime.GtfsRealtimeTripLibrary -->

    <!--category name="org.onebusaway.transit_data_federation.impl.realtime.gtfs_realtime.GtfsRealtimeTripLibrary">

         <priority value="debug" />

    </category-->

    <!--category name="org.onebusaway.transit_data_federation.impl.realtime.gtfs_realtime.GtfsRealtimeSource">

        <priority value="debug" />

    </category-->


    <!-- 0 or 1 root elements -->


    <root>

        <priority value="info" />

        <appender-ref ref="ROLL" />

    </root>


    <!-- 0 or 1 categoryFactory elements -->


</log4j:configuration>


Regards
Vicente

Sheldon A. Brown

unread,
Jan 11, 2021, 8:47:14 PM1/11/21
to onebusaway...@googlegroups.com
Correct.  In this case, specifically the log4j.xml in onebusway-transit-data-federation-webapp.

Sheldon

riou...@gmail.com

unread,
Jan 13, 2021, 9:36:20 AM1/13/21
to onebusaway-developers
Hello everyone,

After looking at the log4j.mxl, I saw that it was attempting to create the log file in a tomcat6 folder, but following the guide tomcat8 is used. That is why I couldn't find it.
I changed it and a log file was successfully created. In the log, I saw active vehicles having a value of 0. After some digging it was indeed that the realtime feed did not match the static data.
This has been fixed and now I can view my realtime data!

After having followed the guide, I noticed a few minor errors, typos, and discrepancies in the guide. Is there a way I could submit a correction to keep the guide as up to date as possible?

A great many thanks for your valuable help,
Francois R

Sheldon A. Brown

unread,
Jan 13, 2021, 7:25:54 PM1/13/21
to onebusaway...@googlegroups.com
Congrats!

And yes, you can either send me notes on corrections, or you can clone the wiki repository and submit a PR on it.  I'll take the help anyway you can offer it.

Sheldon

Sean Barbeau

unread,
Jan 14, 2021, 3:41:03 PM1/14/21
to onebusaway-developers
I think the wiki is publicly editable directly on GitHub?

Sheldon A. Brown

unread,
Jan 14, 2021, 5:57:03 PM1/14/21
to onebusaway...@googlegroups.com
You need committer privs on onebusaway-application-modules as far as I know.

Sheldon

Reply all
Reply to author
Forward
0 new messages