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

Print specific error message #129

Merged

Conversation

michaelkirk
Copy link
Contributor

@michaelkirk michaelkirk commented Jun 14, 2024

Here's the reason for this change 🚀

See pelias/docker#217

Currently users are seeing "elasticsearch index pelias does not exist" even though it does exist.

This could happen if an error is encountered while making the request.

We should print a more useful error message in that case.

Here's what actually got changed 👏

We now check to see if error is set before consulting exists.
If error is set, then exists can't be trusted.

Here's how others can test the changes 👀

Previously successful workflows should continue to succeed. Give them a try.

If you were experiencing a timeout with big planet builds, like in pelias/docker#217, this should get you a better error message.

Here's output of my running a failed planet import after these changes:

Container pelias_schema  Started
Container pelias_elasticsearch  Running
waiting for elasticsearch service to come up
..........Elasticsearch up after waiting 11 second(s).
Container pelias_elasticsearch  Running

--------------
create index 
--------------

[put mapping]     pelias { acknowledged: true, shards_acknowledged: true, index: 'pelias' } 

Container pelias_elasticsearch  Running
ERROR: Failed to check if Elasticsearch index pelias exists.
For full instructions on setting up Pelias, see http://pelias.io/install.html

/code/pelias/whosonfirst/node_modules/pelias-dbclient/src/configValidation.js:38
      throw error;
     ^
StatusCodeError: Request Timeout after 120000ms
   at /code/pelias/whosonfirst/node_modules/elasticsearch/src/lib/transport.js:397:9
   at Timeout.<anonymous> (/code/pelias/whosonfirst/node_modules/elasticsearch/src/lib/transport.js:429:7)
   at listOnTimeout (node:internal/timers:559:17)
   at processTimers (node:internal/timers:502:7) {
      status: 408,
      displayName: 'RequestTimeout'
    }

This is much more helpful than: ERROR: Elasticsearch index pelias does not exist which was downright misleading.

See pelias/docker#217

Currently users are seeing "elasticsearch index pelias does not exist"
even though it does.

This could happen if an error is encountered while making the request.
We should print a more useful error message in that case.
@missinglink
Copy link
Member

Thanks!

orangejulius added a commit to pelias/openstreetmap that referenced this pull request Dec 3, 2024
This adds some new diagnostics for errors from pelias/dbclient#129
orangejulius added a commit to pelias/openstreetmap that referenced this pull request Dec 3, 2024
This adds some new diagnostics for errors from pelias/dbclient#129
orangejulius added a commit to pelias/whosonfirst that referenced this pull request Dec 3, 2024
This adds some new diagnostics for errors from pelias/dbclient#129
orangejulius added a commit to pelias/openaddresses that referenced this pull request Dec 3, 2024
This adds some new diagnostics for errors from pelias/dbclient#129
orangejulius added a commit to pelias/polylines that referenced this pull request Dec 3, 2024
This adds some new diagnostics for errors from pelias/dbclient#129
orangejulius added a commit to pelias/geonames that referenced this pull request Dec 3, 2024
This adds some new diagnostics for errors from pelias/dbclient#129
orangejulius added a commit to pelias/transit that referenced this pull request Dec 3, 2024
This adds some new diagnostics for errors from pelias/dbclient#129
orangejulius added a commit to pelias/csv-importer that referenced this pull request Dec 3, 2024
This adds some new diagnostics for errors from pelias/dbclient#129
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

Successfully merging this pull request may close these issues.

2 participants