BlinkTagInc / gtfs-to-html

Build human readable transit timetables as HTML or PDF from GTFS.
https://gtfstohtml.com
MIT License
183 stars 56 forks source link

Error: Cannot open database because the directory does not exist #156

Closed Flopris closed 1 year ago

Flopris commented 1 year ago

This is my first experiece experimenting with node and I am really lost on what to do.

I keep getting the error Error: Cannot open database because the directory does not exist, even when I test with the same settings from the sample config in my actual config.

Im probably making a very simple mistake somwhere but i just cannot find it.

C:\WINDOWS\system32>gtfs-to-html --configPath "\Users\Floris Vink\OneDrive\Documenten\Uni Dingen (PC)\2023\P1\NE\config.json"

Error: Cannot open database because the directory does not exist [ Error: Cannot open database because the directory does not exist ]

brendannee commented 1 year ago

Can you share with me your config.json file?

Flopris commented 1 year ago

The config i'd like to use:

{ "agencies": [ { "agency_key": "TGV", "url": "https://eu.ftp.opendatasoft.com/sncf/gtfs/export_gtfs_voyages.zip" } ], "sqlitePath": "/tmp/gtfs", "allowEmptyTimetables": false, "beautify": false, "coordinatePrecision": 5, "dateFormat": "MMM D, YYYY", "daysShortStrings": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], "daysStrings": ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"], "defaultOrientation": "vertical", "effectiveDate": "July 8, 2016", "interpolatedStopSymbol": "•", "interpolatedStopText": "Estimated time of arrival", "linkStopUrls": true, "mapboxAccessToken": "YOUR MAPBOX ACCESS TOKEN", "menuType": "simple", "noDropoffSymbol": "‡", "noDropoffText": "No drop off available", "noHead": false, "noPickupSymbol": "**", "noPickupText": "No pickup available", "noServiceSymbol": "—", "noServiceText": "No service at this stop", "outputFormat": "html", "requestDropoffSymbol": "†", "requestDropoffText": "Must request drop off", "requestPickupSymbol": "***", "requestPickupText": "Request stop - call for pickup", "serviceNotProvidedOnText": "Service not provided on", "serviceProvidedOnText": "Service provided on", "showArrivalOnDifference": 0.2, "showMap": true, "showOnlyTimepoint": true, "showRouteTitle": true, "showStopCity": false, "showStopDescription": false, "showStoptimesForRequestStops": true, "skipImport": false, "sortingAlgorithm": "common", "templatePath": "views/default", "timeFormat": "h:mma", "useParentStation": true, "verbose": true, "zipOutput": false }

The sample config renamed to config i tried for troubleshooting, resulting in the same error.

{ "agencies": [ { "agency_key": "bart", "url": "http://www.bart.gov/dev/schedules/google_transit.zip" } ], "sqlitePath": "/tmp/gtfs", "allowEmptyTimetables": false, "beautify": false, "coordinatePrecision": 5, "dateFormat": "MMM D, YYYY", "daysShortStrings": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], "daysStrings": ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"], "defaultOrientation": "vertical", "effectiveDate": "July 8, 2016", "interpolatedStopSymbol": "•", "interpolatedStopText": "Estimated time of arrival", "linkStopUrls": true, "mapboxAccessToken": "YOUR MAPBOX ACCESS TOKEN", "menuType": "simple", "noDropoffSymbol": "‡", "noDropoffText": "No drop off available", "noHead": false, "noPickupSymbol": "**", "noPickupText": "No pickup available", "noServiceSymbol": "—", "noServiceText": "No service at this stop", "outputFormat": "html", "requestDropoffSymbol": "†", "requestDropoffText": "Must request drop off", "requestPickupSymbol": "***", "requestPickupText": "Request stop - call for pickup", "serviceNotProvidedOnText": "Service not provided on", "serviceProvidedOnText": "Service provided on", "showArrivalOnDifference": 0.2, "showMap": true, "showOnlyTimepoint": false, "showRouteTitle": true, "showStopCity": false, "showStopDescription": false, "showStoptimesForRequestStops": true, "skipImport": false, "sortingAlgorithm": "common", "templatePath": "views/default", "timeFormat": "h:mma", "useParentStation": true, "verbose": true, "zipOutput": false, "debug": true }

brendannee commented 1 year ago

Try omitting sqlitePath from the config - this will cause it to use an in-memory database.

Otherwise, change sqlitePath to a path that exists on your system, such as \Users\Floris Vink\OneDrive\Documenten\Uni Dingen (PC)\2023\P1\NE\

Flopris commented 1 year ago

I apllied the first step and that defenitly made it work. Im getting a lot of errors warnings tho, about 'no such file or directory' Its a large file so I'll respond when its done and see if its actually working or not.

Thanks for the help.

Flopris commented 1 year ago

okay it finished with the following error messasge

Error: ENOENT: no such file or directory, open 'views\default\overview_full.pug'
[  Error: no such file or directory, open 'views\default\overview_full.pug'
] {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'views\\default\\overview_full.pug'
}

Using node app results in the messasge

C:\Users\Floris Vink\OneDrive\Documenten\Uni Dingen (PC)\2023\P1\NE>node app
node:internal/modules/cjs/loader:1080
  throw err;
  ^

Error: Cannot find module 'C:\Users\Floris Vink\OneDrive\Documenten\Uni Dingen (PC)\2023\P1\NE\app'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.18.0

Trying to connect to localhost 3000 shows it cant be reached

brendannee commented 1 year ago

Try removing the templatePath field from your config.json.

Flopris commented 1 year ago

Try removing the templatePath field from your config.json.

That seems to have done it, its going now without anu warnings.

Its even slower than before tho and when I tried to assign more memory earlier i got more errors, something about the module not being present. But thats an issue for another time, I just hope this works now when i check up on it next morning.

Thanks a lot for these quick replies.

Edit: I also updated my node from 18 to 20 if that would be important to know.