Closed seisman closed 4 years ago
Fair enough. I need to disable locking on URLs queries.
Closed by #3768.
Re-open the issue because I still see the same error in the recent cron CI job.
Still fails for me
psxy [ERROR]: Failed to create lock file C:\TMP/query.csv?starttime=2016-01-01%2000:00:00&endtime=2016-02-01%2000:00:00&minmagnitude=4.5&orderby=magnitude.download
But there are no file locks on Windows, at least like the unix ones, right?
Could you find out why my check for the url query fails? Perhaps that macro has a problem.
The problem is not the macro. The error message is not coming from gmtremote_get_url()
but from gmt_download_file()
Maybe the problem is this. Windows doesn't accept ?
in file names (that file was manually created by me).
That is fine, it is allowed in the URL and I (think) I am checking the URL string for the question mark. THe idea is that if the URL makes the gmt_M_is_query return true then we dont try to make that lock file, but it is not triggering the test.
You are trying to create a file that has question marks in its name
Lfile = gmtremote_lockfile (API, (char *)name);
if ((fp = fopen (Lfile, "w")) == NULL) {
GMT_Report (API, GMT_MSG_ERROR, "Failed to create lock file %s\n", Lfile);
return 1;
}
and that is not allowed.
Well, I am trying not to create that file when it is an URL query:
bool query = gmt_M_file_is_query (url);
if (!query) { /* Only make a filename if not a query */
Lfile = gmtremote_lockfile (API, file);
if ((fp = fopen (Lfile, "w")) == NULL) {
GMT_Report (API, GMT_MSG_ERROR, "Failed to create lock file %s\n", Lfile);
return 1;
}
gmtlib_file_lock (GMT, fileno(fp)); /* Attempt exclusive lock */
}
So clearly query is false for this case and I dont know why.
No, query is true. I told you the error message is not coming from that function but from gmt_download_file()
where it tries to create a file with a question mark.
Shits, I must have forgotten to duplicate the test there... OK will fix now. Jeez.
OK, it works now.
If I don't get it right on the n'th try, I usually get it right on the m'th try (m > n, sometimes m >> n).
A new failure on Windows: