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

downloadOsmNetworkData: fail if output directory does not exist #739

Closed
davidmurray opened this issue Oct 25, 2023 · 3 comments · Fixed by #1150
Closed

downloadOsmNetworkData: fail if output directory does not exist #739

davidmurray opened this issue Oct 25, 2023 · 3 comments · Fixed by #1150
Assignees

Comments

@davidmurray
Copy link
Collaborator

With a brand new instance of Transition, the runtime/imports does not exist. The download task will fail:

davidmurray@Davids-MBP-2 transition % yarn node --max-old-space-size=4096 packages/chaire-lib-backend/lib/scripts/osrm/downloadOsmNetworkData.task.js --polygon-file polygon_mtl.geojson 
yarn node v1.22.19
Using .env file from /Users/davidmurray/code/poly/transition/.env
Read server configuration from /Users/davidmurray/code/poly/transition/config.js
Retrieving data from osm...
Done retrieving data from osm...
Writing osm data to /Users/davidmurray/code/poly/transition/runtime//imports/osm_network_data.osm
Error download from API [Error: ENOENT: no such file or directory, open '/Users/davidmurray/code/poly/transition/runtime//imports/osm_network_data.osm'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/davidmurray/code/poly/transition/runtime//imports/osm_network_data.osm'
}
task did not complete correctly [Error: ENOENT: no such file or directory, open '/Users/davidmurray/code/poly/transition/runtime//imports/osm_network_data.osm'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/davidmurray/code/poly/transition/runtime//imports/osm_network_data.osm'
}
✨  Done in 5.15s.
@greenscientist
Copy link
Collaborator

Do you have a runtime directory or both are missing?

@davidmurray
Copy link
Collaborator Author

Do you have a runtime directory or both are missing?

I think both were missing!
It's the first thing I ran after git clone, yarn setup, compile, migrate and create-user.

@greenscientist
Copy link
Collaborator

From a potential PR: " the task should at least fail cleanly, so it should at least check if the directory is present and print an error message saying that the directly is invalid and suggest appropriate steps."
We will do at least that.

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