Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import_gtfs.sh with maxDistanceBetweenStops parameter problem #10

Open
wkulesza opened this issue Nov 23, 2020 · 2 comments
Open

import_gtfs.sh with maxDistanceBetweenStops parameter problem #10

wkulesza opened this issue Nov 23, 2020 · 2 comments

Comments

@wkulesza
Copy link

Trying to correct incorrect way the routes/patterns are displayed on map by modifying the parameter maxDistanceBetweenStops in import_gtfs.sh script in transitclock docker.

After docker exec to instance, i modified the import_gtfs.sh to this (it is default, only the java command is changed:
java -Xmx4g -Dtransitclock.core.agencyId=$AGENCYID -Dtransitclock.configFiles=/usr/local/transitclock/config/transitclock.properties -Dtransitclock.logging.dir=/usr/local/transitclock/logs/ -Dlogback.configurationFile=$TRANSITCLOCK_CORE/transitclock/src/main/resouces/logbackGtfs.xml -cp /usr/local/transitclock/Core.jar org.transitclock.applications.GtfsFileProcessor -gtfsUrl $GTFS_URL -maxDistanceBetweenStops 100 -maxTravelTimeSegmentLength 100

After running the script, it finishes with UPDATE 0 and this is in core.log:

root@5e36cee436b0:/usr/local/transitclock/logs/1211/core/2020/11/23# tail -n 100 core.log Detail: Key (tripid, starttime, configrev)=(501, 60900, 0) is still referenced from table "trip_scheduledtimeslist". Error writing GTFS configuration data to db. org.hibernate.exception.ConstraintViolationException: could not execute statement at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) ~[Core.jar:na] at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) ~[Core.jar:na] at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) ~[Core.jar:na] at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112) ~[Core.jar:na] at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:211) ~[Core.jar:na] at org.hibernate.engine.query.spi.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:211) ~[Core.jar:na] at org.hibernate.internal.SessionImpl.executeNativeUpdate(SessionImpl.java:1346) ~[Core.jar:na] at org.hibernate.internal.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:389) ~[Core.jar:na] at org.transitclock.db.structs.Block.deleteFromRev(Block.java:285) ~[Core.jar:na] at org.transitclock.gtfs.DbWriter.actuallyWriteData(DbWriter.java:104) ~[Core.jar:na] at org.transitclock.gtfs.DbWriter.write(DbWriter.java:222) ~[Core.jar:na] at org.transitclock.gtfs.GtfsData.processData(GtfsData.java:2743) [Core.jar:na] at org.transitclock.applications.GtfsFileProcessor.process(GtfsFileProcessor.java:306) [Core.jar:na] at org.transitclock.applications.GtfsFileProcessor.main(GtfsFileProcessor.java:677) [Core.jar:na] Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "trips" violates foreign key constraint "fk_n5et0p70cwe1dwo4m6lq0k4h0" on table "trip_scheduledtimeslist" Detail: Key (tripid, starttime, configrev)=(501, 60900, 0) is still referenced from table "trip_scheduledtimeslist". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198) ~[Core.jar:na] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927) ~[Core.jar:na] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) ~[Core.jar:na] at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:562) ~[Core.jar:na] at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:420) ~[Core.jar:na] at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:366) ~[Core.jar:na] at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:147) ~[Core.jar:na] at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:208) ~[Core.jar:na] ... 9 common frames omitted Exception when writing data to db org.hibernate.exception.ConstraintViolationException: could not execute statement at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) ~[Core.jar:na] at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) ~[Core.jar:na] at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) ~[Core.jar:na] at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112) ~[Core.jar:na] at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:211) ~[Core.jar:na] at org.hibernate.engine.query.spi.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:211) ~[Core.jar:na] at org.hibernate.internal.SessionImpl.executeNativeUpdate(SessionImpl.java:1346) ~[Core.jar:na] at org.hibernate.internal.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:389) ~[Core.jar:na] at org.transitclock.db.structs.Block.deleteFromRev(Block.java:285) ~[Core.jar:na] at org.transitclock.gtfs.DbWriter.actuallyWriteData(DbWriter.java:104) ~[Core.jar:na] at org.transitclock.gtfs.DbWriter.write(DbWriter.java:222) ~[Core.jar:na] at org.transitclock.gtfs.GtfsData.processData(GtfsData.java:2743) ~[Core.jar:na] at org.transitclock.applications.GtfsFileProcessor.process(GtfsFileProcessor.java:306) [Core.jar:na] at org.transitclock.applications.GtfsFileProcessor.main(GtfsFileProcessor.java:677) [Core.jar:na] Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "trips" violates foreign key constraint "fk_n5et0p70cwe1dwo4m6lq0k4h0" on table "trip_scheduledtimeslist" Detail: Key (tripid, starttime, configrev)=(501, 60900, 0) is still referenced from table "trip_scheduledtimeslist". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198) ~[Core.jar:na] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927) ~[Core.jar:na] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) ~[Core.jar:na] at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:562) ~[Core.jar:na] at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:420) ~[Core.jar:na] at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:366) ~[Core.jar:na] at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:147) ~[Core.jar:na] at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:208) ~[Core.jar:na] ... 9 common frames omitted could not execute statement org.hibernate.exception.ConstraintViolationException: could not execute statement at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) ~[Core.jar:na] at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) ~[Core.jar:na] at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) ~[Core.jar:na] at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112) ~[Core.jar:na] at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:211) ~[Core.jar:na] at org.hibernate.engine.query.spi.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:211) ~[Core.jar:na] at org.hibernate.internal.SessionImpl.executeNativeUpdate(SessionImpl.java:1346) ~[Core.jar:na] at org.hibernate.internal.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:389) ~[Core.jar:na] at org.transitclock.db.structs.Block.deleteFromRev(Block.java:285) ~[Core.jar:na] at org.transitclock.gtfs.DbWriter.actuallyWriteData(DbWriter.java:104) ~[Core.jar:na] at org.transitclock.gtfs.DbWriter.write(DbWriter.java:222) ~[Core.jar:na] at org.transitclock.gtfs.GtfsData.processData(GtfsData.java:2743) ~[Core.jar:na] at org.transitclock.applications.GtfsFileProcessor.process(GtfsFileProcessor.java:306) ~[Core.jar:na] at org.transitclock.applications.GtfsFileProcessor.main(GtfsFileProcessor.java:677) ~[Core.jar:na] Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "trips" violates foreign key constraint "fk_n5et0p70cwe1dwo4m6lq0k4h0" on table "trip_scheduledtimeslist" Detail: Key (tripid, starttime, configrev)=(501, 60900, 0) is still referenced from table "trip_scheduledtimeslist". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198) ~[Core.jar:na] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927) ~[Core.jar:na] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) ~[Core.jar:na] at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:562) ~[Core.jar:na] at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:420) ~[Core.jar:na] at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:366) ~[Core.jar:na] at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:147) ~[Core.jar:na] at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:208) ~[Core.jar:na] ... 9 common frames omitted ====================================================AvlProcessor processing AvlReport [vehicleId=6, time=11-23-2020 12:59:17.000 CET, location=[52.38586, 16.90274], speed=NaN, heading=NaN, source=This is th, assignmentId=null, assignmentType=UNSET] No assignment info for vehicleId=6 so trying to assign vehicle without it. Trying to automatically assign vehicleId=6

@scrudden
Copy link
Member

Can you provide the GTFS file?

@wkulesza
Copy link
Author

wkulesza commented Nov 23, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants