-
Notifications
You must be signed in to change notification settings - Fork 27
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
Issue installing iRail with Docker #511
Comments
Hi Matthias, These are some composer warnings regarding outdated packages, as well as some npm warnings regarding javascript packages (javascript is only used during installation by irail/stations in order to generate a json file). They do not affect the working of the application. If you're having issues running the docker container, it might be because of another error not described in the log excerpt you shared. I'm currently refactoring the codebase into a strongly typed more object-oriented version in order to add new features and v2 endpoints, which also should be easier to understand compared to the current master version. A bit more about that can be found in #503. I'll create some new issues which are easier to follow when it is stable enought for everyone to test backwards compatibility and move over, I'm currently testing the backwards compatibility myself. You can find this version in the lumen branch: https://github.com/iRail/iRail/tree/feature/laravel-lumen-framework . I'm actively using the docker-compose setup in there, so that one's guaranteed to work. |
Thank you for your response. I successfully installed the docker container with your repo. However when doing a request I get an error about the API key. The request: The response: |
When doing a request to a vehicle, I get a bunch of errors. Request:
Response:{
"code": 0,
"message": "Irail\\Repositories\\Riv\\NmbsRivRawDataRepository::getJourneyDetailRef(): Return value must be of type ?string, Irail\\Models\\CachedData returned",
"previous": null,
"at": "",
"stack": [
"#0 \/var\/www\/app\/Repositories\/Riv\/NmbsRivRawDataRepository.php(140): Irail\\Repositories\\Riv\\NmbsRivRawDataRepository->getJourneyDetailRef(Object(Irail\\Repositories\\Gtfs\\GtfsTripStartEndExtractor), Object(Irail\\Http\\Requests\\DatedVehicleJourneyV1Request), Object(Irail\\Repositories\\Gtfs\\Models\\JourneyWithOriginAndDestination))",
"#1 \/var\/www\/app\/Repositories\/Riv\/NmbsRivRawDataRepository.php(124): Irail\\Repositories\\Riv\\NmbsRivRawDataRepository->getFreshVehicleJourneyData(Object(Irail\\Http\\Requests\\DatedVehicleJourneyV1Request))",
"#2 \/var\/www\/app\/Traits\/Cache.php(157): Irail\\Repositories\\Riv\\NmbsRivRawDataRepository->Irail\\Repositories\\Riv\\{closure}()",
"#3 \/var\/www\/app\/Repositories\/Riv\/NmbsRivRawDataRepository.php(123): Irail\\Repositories\\Riv\\NmbsRivRawDataRepository->getCacheOrUpdate('|VehicleJourney...', Object(Closure))",
"#4 \/var\/www\/app\/Repositories\/Nmbs\/NmbsRivVehicleJourneyRepository.php(61): Irail\\Repositories\\Riv\\NmbsRivRawDataRepository->getVehicleJourneyData(Object(Irail\\Http\\Requests\\DatedVehicleJourneyV1Request))",
"#5 \/var\/www\/app\/Http\/Controllers\/DatedVehicleJourneyV1Controller.php(26): Irail\\Repositories\\Nmbs\\NmbsRivVehicleJourneyRepository->getDatedVehicleJourney(Object(Irail\\Http\\Requests\\DatedVehicleJourneyV1Request))",
"#6 \/var\/www\/vendor\/illuminate\/container\/BoundMethod.php(36): Irail\\Http\\Controllers\\DatedVehicleJourneyV1Controller->getVehicleById(Object(Irail\\Http\\Requests\\DatedVehicleJourneyV1Request))",
"#7 \/var\/www\/vendor\/illuminate\/container\/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()",
"#8 \/var\/www\/vendor\/illuminate\/container\/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))",
"#9 \/var\/www\/vendor\/illuminate\/container\/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Laravel\\Lumen\\Application), Array, Object(Closure))",
"#10 \/var\/www\/vendor\/illuminate\/container\/Container.php(662): Illuminate\\Container\\BoundMethod::call(Object(Laravel\\Lumen\\Application), Array, Array, NULL)",
"#11 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(391): Illuminate\\Container\\Container->call(Array, Array)",
"#12 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(356): Laravel\\Lumen\\Application->callControllerCallable(Array, Array)",
"#13 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(331): Laravel\\Lumen\\Application->callLumenController(Object(Irail\\Http\\Controllers\\DatedVehicleJourneyV1Controller), 'getVehicleById', Array)",
"#14 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(284): Laravel\\Lumen\\Application->callControllerAction(Array)",
"#15 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(269): Laravel\\Lumen\\Application->callActionOnArrayBasedRoute(Array)",
"#16 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(171): Laravel\\Lumen\\Application->handleFoundRoute(Array)",
"#17 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Routing\/Pipeline.php(48): Laravel\\Lumen\\Application->Laravel\\Lumen\\Concerns\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
"#18 \/var\/www\/vendor\/illuminate\/http\/Middleware\/TrustProxies.php(39): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
"#19 \/var\/www\/vendor\/illuminate\/pipeline\/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Laravel\\Lumen\\Http\\Request), Object(Closure))",
"#20 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Routing\/Pipeline.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
"#21 \/var\/www\/app\/Http\/Middleware\/RequestDumpingMiddleware.php(26): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
"#22 \/var\/www\/vendor\/illuminate\/pipeline\/Pipeline.php(183): Irail\\Http\\Middleware\\RequestDumpingMiddleware->handle(Object(Laravel\\Lumen\\Http\\Request), Object(Closure))",
"#23 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Routing\/Pipeline.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
"#24 \/var\/www\/vendor\/illuminate\/pipeline\/Pipeline.php(119): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
"#25 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(428): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))",
"#26 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(167): Laravel\\Lumen\\Application->sendThroughPipeline(Array, Object(Closure))",
"#27 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(112): Laravel\\Lumen\\Application->dispatch(NULL)",
"#28 \/var\/www\/public\/index.php(28): Laravel\\Lumen\\Application->run()",
"#29 {main}"
]
} |
Thanks for pointing this out! There was a line of code missing on that code path, used to get the value which was being cached from the CachedData wrapper object. |
Thanks for helping! I've got an new error... Response:
|
That's a general error, signaling that some underlying data source didn't return a response as expected. The logs could clarify that error further, but it's typically not something that can be fixed. |
Here are the logs if it would be any useful.
.
|
The NMBS_RIV_API_KEY environment variable is not set, see the example environment file to see which variables are required. |
Hi, i've set the .env file like this: APP_NAME=Lumen
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_TIMEZONE=Europe/Brussels
LOG_CHANNEL=stack
LOG_SLACK_WEBHOOK_URL=
# Which requests, made by iRail, to log. Requests are logged into the application logs. ALL | ERROR | NONE
LOG_REQUESTS=ALL
# Set LOG_REQUESTS_FILE to TRUE in order to log requests to files in the app directory
# LOG_REQUESTS_FILE=TRUE
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=irail
DB_USERNAME=irail-api
DB_PASSWORD=irail-api
CACHE_DRIVER=apc
QUEUE_CONNECTION=sync
NMBS_RIV_API_KEY=IOS-v0001-20190214-YKNDlEPxDqynCovC2ciUOYl8L6aMwU4WuhKaNtxl
GTFS_RANGE_DAYS_BACKWARDS=3
GTFS_RANGE_DAYS_FORWARDS=14 But now i'm getting an error message saying it doesn't find any tables. The request: The error: {
"code": "42S02",
"message": "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'irail.occupancy_reports' doesn't exist (Connection: mysql, SQL: SELECT vehicle_id, occupancy FROM occupancy_reports WHERE source=NMBS AND stop_id=8892007 AND journey_start_date=2024-03-12 00:00:00)",
"previous": {
"errorInfo": [
"42S02",
1146,
"Table 'irail.occupancy_reports' doesn't exist"
]
},
"at": "",
"stack": [
"#0 \/var\/www\/vendor\/illuminate\/database\/Connection.php(783): Illuminate\\Database\\Connection->runQueryCallback('SELECT vehicle_...', Array, Object(Closure))",
"#1 \/var\/www\/vendor\/illuminate\/database\/Connection.php(414): Illuminate\\Database\\Connection->run('SELECT vehicle_...', Array, Object(Closure))",
"#2 \/var\/www\/vendor\/illuminate\/database\/DatabaseManager.php(509): Illuminate\\Database\\Connection->select('SELECT vehicle_...', Array)",
"#3 \/var\/www\/vendor\/illuminate\/support\/Facades\/Facade.php(355): Illuminate\\Database\\DatabaseManager->__call('select', Array)",
"#4 \/var\/www\/app\/Database\/OccupancyDao.php(297): Illuminate\\Support\\Facades\\Facade::__callStatic('select', Array)",
"#5 \/var\/www\/app\/Database\/OccupancyDao.php(233): Irail\\Database\\OccupancyDao->readLevelsForStation(Object(Irail\\Models\\Dao\\OccupancyReportSource), 8892007, Object(Carbon\\Carbon))",
"#6 \/var\/www\/app\/Database\/OccupancyDao.php(194): Irail\\Database\\OccupancyDao->readLevels(Object(Irail\\Models\\Dao\\OccupancyReportSource), 'IC707', 8892007, Object(Carbon\\Carbon), Object(Irail\\Database\\OccupancyDaoPerformanceMode))",
"#7 \/var\/www\/app\/Database\/OccupancyDao.php(176): Irail\\Database\\OccupancyDao->getOfficialLevel('IC707', '008892007', Object(Carbon\\Carbon), Object(Irail\\Database\\OccupancyDaoPerformanceMode))",
"#8 \/var\/www\/app\/Database\/OccupancyDao.php(50): Irail\\Database\\OccupancyDao->getStoredNmbsOccupancy(Object(Irail\\Models\\DepartureOrArrival), Object(Irail\\Database\\OccupancyDaoPerformanceMode))",
"#9 \/var\/www\/app\/Repositories\/Nmbs\/NmbsRivLiveboardRepository.php(178): Irail\\Database\\OccupancyDao->getOccupancy(Object(Irail\\Models\\DepartureOrArrival), NULL, Object(Irail\\Database\\OccupancyDaoPerformanceMode))",
"#10 \/var\/www\/app\/Repositories\/Nmbs\/NmbsRivLiveboardRepository.php(94): Irail\\Repositories\\Nmbs\\NmbsRivLiveboardRepository->parseStopAtStation(Object(Irail\\Http\\Requests\\LiveboardV1Request), Object(Irail\\Models\\Station), Array)",
"#11 \/var\/www\/app\/Repositories\/Nmbs\/NmbsRivLiveboardRepository.php(62): Irail\\Repositories\\Nmbs\\NmbsRivLiveboardRepository->parseNmbsRawData(Object(Irail\\Http\\Requests\\LiveboardV1Request), Object(Irail\\Models\\CachedData))",
"#12 \/var\/www\/app\/Http\/Controllers\/LiveboardV1Controller.php(39): Irail\\Repositories\\Nmbs\\NmbsRivLiveboardRepository->getLiveboard(Object(Irail\\Http\\Requests\\LiveboardV1Request))",
"#13 \/var\/www\/vendor\/illuminate\/container\/BoundMethod.php(36): Irail\\Http\\Controllers\\LiveboardV1Controller->getLiveboardById(Object(Irail\\Http\\Requests\\LiveboardV1Request))",
"#14 \/var\/www\/vendor\/illuminate\/container\/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()",
"#15 \/var\/www\/vendor\/illuminate\/container\/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))",
"#16 \/var\/www\/vendor\/illuminate\/container\/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Laravel\\Lumen\\Application), Array, Object(Closure))",
"#17 \/var\/www\/vendor\/illuminate\/container\/Container.php(662): Illuminate\\Container\\BoundMethod::call(Object(Laravel\\Lumen\\Application), Array, Array, NULL)",
"#18 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(391): Illuminate\\Container\\Container->call(Array, Array)",
"#19 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(356): Laravel\\Lumen\\Application->callControllerCallable(Array, Array)",
"#20 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(331): Laravel\\Lumen\\Application->callLumenController(Object(Irail\\Http\\Controllers\\LiveboardV1Controller), 'getLiveboardByI...', Array)",
"#21 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(284): Laravel\\Lumen\\Application->callControllerAction(Array)",
"#22 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(269): Laravel\\Lumen\\Application->callActionOnArrayBasedRoute(Array)",
"#23 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(171): Laravel\\Lumen\\Application->handleFoundRoute(Array)",
"#24 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Routing\/Pipeline.php(48): Laravel\\Lumen\\Application->Laravel\\Lumen\\Concerns\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
"#25 \/var\/www\/vendor\/illuminate\/http\/Middleware\/TrustProxies.php(39): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
"#26 \/var\/www\/vendor\/illuminate\/pipeline\/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Laravel\\Lumen\\Http\\Request), Object(Closure))",
"#27 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Routing\/Pipeline.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
"#28 \/var\/www\/app\/Http\/Middleware\/RequestDumpingMiddleware.php(26): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
"#29 \/var\/www\/vendor\/illuminate\/pipeline\/Pipeline.php(183): Irail\\Http\\Middleware\\RequestDumpingMiddleware->handle(Object(Laravel\\Lumen\\Http\\Request), Object(Closure))",
"#30 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Routing\/Pipeline.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
"#31 \/var\/www\/vendor\/illuminate\/pipeline\/Pipeline.php(119): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Laravel\\Lumen\\Http\\Request))",
"#32 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(428): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))",
"#33 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(167): Laravel\\Lumen\\Application->sendThroughPipeline(Array, Object(Closure))",
"#34 \/var\/www\/vendor\/laravel\/lumen-framework\/src\/Concerns\/RoutesRequests.php(112): Laravel\\Lumen\\Application->dispatch(NULL)",
"#35 \/var\/www\/public\/index.php(28): Laravel\\Lumen\\Application->run()",
"#36 {main}"
]
} After some research, I found that i still need to migrate like this:
|
Are you trying to run 'php artisan migrate' in the app container? This looks like a connection error where the app container can't connect properly to the db container. |
Yes, i'm doing that. I'm trying to resolve this issue. Docker list shows it correct:
|
Sounds like an issue with the database hostname configuration, but the database configuration from the docker file should work out of the box, Docker environment variables should take precedence over env files, so the application should use those correct credentials.
This seems to be correct based on the logs: |
I'm using macOS. |
Hello, I would like to contribute to iRail and run it with docker. But when i follow the steps, i get an error because the PHP is outdated and some packages are abandoned. I know this is not normally the place for this but the gitter room is kinda dead.
The errors:
The text was updated successfully, but these errors were encountered: