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

Better error message for server connection errors #2119

Closed
seisman opened this issue Nov 22, 2019 · 10 comments
Closed

Better error message for server connection errors #2119

seisman opened this issue Nov 22, 2019 · 10 comments
Labels
longterm Long standing issues that need to be resolved

Comments

@seisman
Copy link
Member

seisman commented Nov 22, 2019

Sometimes, we may have intermittent network issues and fail to download some files. GMT reports errors likes:

movie [ERROR]: Libcurl Error: Couldn't connect to server
movie [ERROR]: You can turn remote file download off by setting GMT_DATA_SERVER_LIMIT = 0.

Is it possible to provide more information? For example.

@PaulWessel
Copy link
Member

OK, will see what information is available when it fails. But for certain we know what it is trying to download when it fails so we can add more information. I experience the same thing from time to time.

@MarkWieczorek
Copy link

MarkWieczorek commented Nov 22, 2019

I get the following error in pygmt from time to time when plotting my own data. Why would gmt be trying to download these files at all? At a very minimum, this should return a warning as opposed to an error.

grdimage [ERROR]: Unable to download file https://oceania.generic-mapping-tools.org/gmt_hash_server.txt
grdimage [ERROR]: Libcurl Error: Timeout was reached
grdimage [ERROR]: GMT data server may be down - delay checking hash file for 24 hours
grdimage [ERROR]: You can turn remote file download off by setting GMT_DATA_SERVER_LIMIT = 0.
grdimage [ERROR]: Unable to obtain remote file @GMTAPI@-000000
grdimage [ERROR]: File GMTAPI@-000000 not found
[Session pygmt-session (4)]: Error returned from GMT API: GMT_FILE_NOT_FOUND (16)

@seisman
Copy link
Member Author

seisman commented Nov 22, 2019

I think GMT only tries to download the hash table (gmt_hash_server.txt) if a remote file (file with a leading "@") is required.

I see two possible issues here:

  1. It seems GMT takes @GMTAPI@-000000 as a remote file.
  2. As @MarkWieczorek suggested, failing to download gmt_hash_server.txt should be a warning instead of an error.

@PaulWessel
Copy link
Member

We have explicit checks to not download @GMTAPI@-###### files and I have not seen that before. COuld you tell me the circumstance in which it happened. I know you use pygmt.

@MarkWieczorek
Copy link

The circumstance is very banal: I have a grid stored as a local xarray, and I am using grdimage to plot it. Here is an example if you want to check out a different problem! GenericMappingTools/pygmt#375

@seisman
Copy link
Member Author

seisman commented Nov 23, 2019

I tried @MarkWieczorek's script in GenericMappingTools/pygmt#375. The first few lines of debug messages are:

grdimage [DEBUG]: Map distance calculation will be using great circle approximation with authalic auxiliary latitudes and authalic (R_2) radius = 6371007.1809 m, in meter.
grdimage [DEBUG]: Map distance calculation will be using great circle approximation with authalic auxiliary latitudes and authalic (R_2) radius = 6371007.1809 m, in meter.
grdimage [DEBUG]: Look for file @GMTAPI@-000000 in /Users/seisman/.gmt
grdimage [DEBUG]: Look for file @GMTAPI@-000000 in /Users/seisman/.gmt/cache
grdimage [DEBUG]: Look for file @GMTAPI@-000000 in /Users/seisman/.gmt/server
grdimage [DEBUG]: Look for file @GMTAPI@-000000 in /Users/seisman/.gmt/server/srtm1
grdimage [DEBUG]: Look for file @GMTAPI@-000000 in /Users/seisman/.gmt/server/srtm3
grdimage [INFORMATION]: Read header from file @GMTAPI@-000000
grdimage [DEBUG]: Local file /Users/seisman/.gmt/server/gmt_hash_server.txt found
grdimage [DEBUG]: File /Users/seisman/.gmt/server/gmt_hash_server.txt less than 24 hours old, refresh is premature.
grdimage [DEBUG]: api_begin_io: Input resource access is now enabled [container]

PaulWessel added a commit that referenced this issue Nov 23, 2019
See issue #2119.  If we cannot update the hash table we can still use the cached data files so this snould not be an error.
@seisman
Copy link
Member Author

seisman commented Nov 23, 2019

@PaulWessel I'm reopening it since there are still some unsolved issues here.

@seisman seisman reopened this Nov 23, 2019
@PaulWessel
Copy link
Member

OK, fine.

PaulWessel added a commit that referenced this issue Nov 24, 2019
See issue #2119.  If we cannot update the hash table we can still use the cached data files so this snould not be an error.
@stale
Copy link

stale bot commented Feb 22, 2020

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@stale stale bot added the stale This will not be worked on label Feb 22, 2020
@seisman seisman added the longterm Long standing issues that need to be resolved label Feb 22, 2020
@stale stale bot removed the stale This will not be worked on label Feb 22, 2020
@joa-quim
Copy link
Member

Can we close this?

@seisman seisman closed this as completed Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
longterm Long standing issues that need to be resolved
Projects
None yet
Development

No branches or pull requests

4 participants