-
Notifications
You must be signed in to change notification settings - Fork 262
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
Issue with _FillValue not being written for NetCDF3 files #843
Comments
Thanks @hmb1! Can you provide the Thanks! |
I picked up the version 4.6.0.1 from your ftp site: |
Hi Ward, just recreate in.nc with ...Henry` |
Ok, that is version 4.6.0. I will take a look, thanks. |
I ask because 4.6.0 is the latest official release, and you indicate that it works. I will test against the latest master branch. Thanks again! |
I've confirmed from that link you sent that it is netcdf 4.6.0, which is the latest official release. You can safely stick with 4.6.0, and I will check against our development branch before we put out a new version :). |
So I've identified this issue as being a pull request submitted from an unofficial forked branch of netcdf. For now I suggest you revert to the official netcdf (4.6.0), and I will coordinate with the author to get this bug fixed before we accept the pull request. Thanks! |
Tagging @czender - Charlie, on the branch where I can duplicate this failure, |
Yes, to clarify, @hmb1 and I first noticed this and other (possibly related from the same cause) failures on https://github.com/NetCDF-World-Domination-Council/netcdf-c.git branch ejh_rename_is_here (pinging @edhartnett). I asked Henry to report it. NCO's "make check" is pretty useless for you. The real regression test is "make test", which is where this and a few other failures with ejh_rename_is_here will appear. I have not added the "Unidata" tag to the FAILURE string yet because I am being conservative, and am not even sure the problem is in Unidata master (apparently it is not so perhaps we jumped the gun). My hope is that Henry will learn the ropes of reporting issues and cautiously alerting Unidata when something new fails on master. |
Thank you for the clarification; this was useful as it alerted us to an issue before it was merged into |
OK, I am trying to reproduce, but it's not happening. I downloaded the file in.txt and am doing:
This works for branch ejh_rename_is_here. Also works for ejh_batch.wif. Do I see the failure from just running this ncgen command? Or is there something else I need to do? |
Hi Ed, ..Henry |
OK, I got a clone of the current nco repo to build, with help from @czender. But when I run that ncap2 command using the Unidata master, I get:
So that's the error you're seeing but I expected it to work on the unidata master branch, and produce an error on ejh_rename_is_here. Did I get something wrong? I will look into the error and see what is causing it... |
I'm trying to catch-up here. @edhartnett the command should use |
@czender yes I am now using ncap2. Here's the command:
|
yep thats the error |
And do you get this on the Unidata master branch as well? |
Yes, I do:
So apparently it is already in master, but IIRC @hmb1 tested 4.6.0 and says that it does not occur there. Henry, please correct me if I'm wrong. |
I do not see this error in master on my end. I will double check this morning to confirm. |
Am getting the error with: netCDF 4.6.1-development |
Testing now but perhaps I had not pulled down all the latest changes or some other basic mistake. Will follow up momentarily, compiling NCO now. |
I do not understand why NCO logging is not working. However, on netCDF master, the above command fails with netCDF3 in.nc but succeeds with a netCDF4 version of the same file, i.e.,
We do want users to have the same _FillValue behavior between netCDF3 and netCDF4, yes? |
Interesting, but at least now I can use git bisect to determine where the bug was introduced. I assume something was fumbled on my end checking |
@hmb1 I asked you to check whether the ncap2 test failure occurs in 4.6.0 (not 4.5.0). Did you do so? And what was the result? |
OK, I can believe that this is happening on master but not in 4.6.0. This is connected no doubt to some of @wkliao's changes, since he did change a bunch of fill stuff for classic format when he added support for nc_set_fill() for classic files. I made a bunch of changes to fix string fill values, but those are not involved here because this is a classic file. If we can figure out what is happening here we can put together a C test to make this. |
Thanks for the help all, we will get this fixed. @edhartnett I'll follow up over at #844 |
The ncap2 error message says "HINT: NC_ELATEFILL errors can occur when NCO attempts to create, modify, or overwrite a _FillValue attribute for an existing variable in a netCDF4 file. The netCDF4 format (unlike netCDF3) does not permit this." Although I have not tested this particular case, I believe my changes make NetCDF3 consistent with NetCDF4, i.e. NetCDF-3 no longer permits setting _FillValue attribute for variables that already exist (or not in the variable's initial define mode). |
Hi @czender Is there a way to make ncap2 to report the code location that spews a NetCDF error? |
This seems like deja vu. IIRC, we discussed treatment of _FillValue in the 4.5.x development timeframe, and patches to be more stringent with _FillValue were rejected or deferred due to backwards compatibility issues. |
@czender you are correct, I thought we had removed this constraint for the 4.6.0 release due to the fact it was now permissible due to the damage it did to existing workflows. We will need to reverse this if that is in fact the case. |
If I recall correctly, there were 3 issues related to FillValue we discussed before.
If NetCDF decided to relax the above limitations 2 and 3, please check lines 839-849 of libsrc/attr.m4 and make changes accordingly. Line 839 in 712b13e
|
@wkliao thank you for the reminder/refresher; my attention is quite split currently and that is a terrific help! As I recall, the issue is that enforcing previously documented behavior turned into a workflow issue, where a number of tools/workflows existed which violated these behaviors, to the extent we couldn't begin enforcing restrictions without seriously damaging extant workflows. Thanks very much again, it is all coming back to me. |
I believe it is important to keep the semantics consistent between NetCDF classic and NetCDF4 formats for the APIs they share. But this is your call. |
For now, I think we need to avoid breaking existing workflows; I am going to revert the change for the time being. |
Upstream changes: ## 4.6.1 - March 15, 2018 * [Bug Fix] Corrected an issue which could result in a dap4 failure. See [Github #888](Unidata/netcdf-c#888) for more information. * [Bug Fix][Enhancement] Allow `nccopy` to control output filter suppresion. See [Github #894](Unidata/netcdf-c#894) for more information. * [Enhancement] Reverted some new behaviors that, while in line with the netCDF specification, broke existing workflows. See [Github #843](Unidata/netcdf-c#843) for more information. * [Bug Fix] Improved support for CRT builds with Visual Studio, improves zlib detection in hdf5 library. See [Github #853](Unidata/netcdf-c#853) for more information. * [Enhancement][Internal] Moved HDF4 into a distinct dispatch layer. See [Github #849](Unidata/netcdf-c#849) for more information. ## 4.6.0 - January 24, 2018 * [Enhancement] Full support for using HDF5 dynamic filters, both for reading and writing. See the file docs/filters.md. * [Enhancement] Added an option to enable strict null-byte padding for headers; this padding was specified in the spec but was not enforced. Enabling this option will allow you to check your files, as it will return an E_NULLPAD error. It is possible for these files to have been written by older versions of libnetcdf. There is no effective problem caused by this lack of null padding, so enabling these options is informational only. The options for `configure` and `cmake` are `--enable-strict-null-byte-header-padding` and `-DENABLE_STRICT_NULL_BYTE_HEADER_PADDING`, respectively. See [Github #657](Unidata/netcdf-c#657) for more information. * [Enhancement] Reverted behavior/handling of out-of-range attribute values to pre-4.5.0 default. See [Github #512](Unidata/netcdf-c#512) for more information. * [Bug] Fixed error in tst_parallel2.c. See [Github #545](Unidata/netcdf-c#545) for more information. * [Bug] Fixed handling of corrupt files + proper offset handling for hdf5 files. See [Github #552](Unidata/netcdf-c#552) for more information. * [Bug] Corrected a memory overflow in `tst_h_dimscales`, see [Github #511](Unidata/netcdf-c#511), [Github #505](Unidata/netcdf-c#505), [Github #363](Unidata/netcdf-c#363) and [Github #244](Unidata/netcdf-c#244) for more information. ## 4.5.0 - October 20, 2017 * Corrected an issue which could potential result in a hang while using parallel file I/O. See [Github #449](Unidata/netcdf-c#449) for more information. * Addressed an issue with `ncdump` not properly handling dates on a 366 day calendar. See [GitHub #359](Unidata/netcdf-c#359) for more information. ### 4.5.0-rc3 - September 29, 2017 * [Update] Due to ongoing issues, native CDF5 support has been disabled by **default**. You can use the options mentioned below (`--enable-cdf5` or `-DENABLE_CDF5=TRUE` for `configure` or `cmake`, respectively). Just be aware that for the time being, Reading/Writing CDF5 files on 32-bit platforms may result in unexpected behavior when using extremely large variables. For 32-bit platforms it is best to continue using `NC_FORMAT_64BIT_OFFSET`. * [Bug] Corrected an issue where older versions of curl might fail. See [GitHub #487](Unidata/netcdf-c#487) for more information. * [Enhancement] Added options to enable/disable `CDF5` support at configure time for autotools and cmake-based builds. The options are `--enable/disable-cdf5` and `ENABLE_CDF5`, respectively. See [Github #484](Unidata/netcdf-c#484) for more information. * [Bug Fix] Corrected an issue when subsetting a netcdf3 file via `nccopy -v/-V`. See [Github #425](Unidata/netcdf-c#425) and [Github #463](Unidata/netcdf-c#463) for more information. * [Bug Fix] Corrected `--has-dap` and `--has-dap4` output for cmake-based builds. See [GitHub #473](Unidata/netcdf-c#473) for more information. * [Bug Fix] Corrected an issue where `NC_64BIT_DATA` files were being read incorrectly by ncdump, despite the data having been written correctly. See [GitHub #457](Unidata/netcdf-c#457) for more information. * [Bug Fix] Corrected a potential stack buffer overflow. See [GitHub #450](Unidata/netcdf-c#450) for more information. ### 4.5.0-rc2 - August 7, 2017 * [Bug Fix] Addressed an issue with how cmake was implementing large file support on 32-bit systems. See [GitHub #385](Unidata/netcdf-c#385) for more information. * [Bug Fix] Addressed an issue where ncgen would not respect keyword case. See [GitHub #310](Unidata/netcdf-c#310) for more information. ### 4.5.0-rc1 - June 5, 2017 * [Enhancement] DAP4 is now included. Since dap2 is the default for urls, dap4 must be specified by (1) using "dap4:" as the url protocol, or (2) appending "#protocol=dap4" to the end of the url, or (3) appending "#dap4" to the end of the url Note that dap4 is enabled by default but remote-testing is disbled until the testserver situation is resolved. * [Enhancement] The remote testing server can now be specified with the `--with-testserver` option to ./configure. * [Enhancement] Modified netCDF4 to use ASCII for NC_CHAR. See [Github Pull request #316](Unidata/netcdf-c#316) for more information. * [Bug Fix] Corrected an error with how dimsizes might be read. See [Github #410](Unidata/netcdf-c#410) for more information. * [Bug Fix] Corrected an issue where 'make check' would fail if 'make' or 'make all' had not run first. See [Github #339](Unidata/netcdf-c#339) for more information. * [Bug Fix] Corrected an issue on Windows with Large file tests. See [Github #385](Unidata/netcdf-c#385]) for more information. * [Bug Fix] Corrected an issue with diskless file access, see [Pull Request #400](Unidata/netcdf-c#400) and [Pull Request #403](Unidata/netcdf-c#403) for more information. * [Upgrade] The bash based test scripts have been upgraded to use a common test_common.sh include file that isolates build specific information. * [Upgrade] The bash based test scripts have been upgraded to use a common test_common.sh include file that isolates build specific information. * [Refactor] the oc2 library is no longer independent of the main netcdf-c library. For example, it now uses ncuri, nclist, and ncbytes instead of its homegrown equivalents. * [Bug Fix] `NC_EGLOBAL` is now properly returned when attempting to set a global `_FillValue` attribute. See [GitHub #388](Unidata/netcdf-c#388) and [GitHub #389](Unidata/netcdf-c#389) for more information. * [Bug Fix] Corrected an issue where data loss would occur when `_FillValue` was mistakenly allowed to be redefined. See [Github #390](Unidata/netcdf-c#390), [GitHub #387](Unidata/netcdf-c#387) for more information. * [Upgrade][Bug] Corrected an issue regarding how "orphaned" DAS attributes were handled. See [GitHub #376](Unidata/netcdf-c#376) for more information. * [Upgrade] Update utf8proc.[ch] to use the version now maintained by the Julia Language project (https://github.com/JuliaLang/utf8proc/blob/master/LICENSE.md). * [Bug] Addressed conversion problem with Windows sscanf. This primarily affected some OPeNDAP URLs on Windows. See [GitHub #365](Unidata/netcdf-c#365) and [GitHub #366](Unidata/netcdf-c#366) for more information. * [Enhancement] Added support for HDF5 collective metadata operations when available. Patch submitted by Greg Sjaardema, see [Pull request #335](Unidata/netcdf-c#335) for more information. * [Bug] Addressed a potential type punning issue. See [GitHub #351](Unidata/netcdf-c#351) for more information. * [Bug] Addressed an issue where netCDF wouldn't build on Windows systems using MSVC 2012. See [GitHub #304](Unidata/netcdf-c#304) for more information. * [Bug] Fixed an issue related to potential type punning, see [GitHub #344](Unidata/netcdf-c#344) for more information. * [Enhancement] Incorporated an enhancement provided by Greg Sjaardema, which may improve read/write times for some complex files. Basically, linked lists were replaced in some locations where it was safe to use an array/table. See [Pull request #328](Unidata/netcdf-c#328) for more information.
Environment Information
Linux environment
configure
)C
code to recreate the issue?Summary of Issue
The following NCO command works in netcdf-4.6.0 and NOT in netcdf-4.6.1
ncap2 -C -v -O -s 'n2=three_dmn_var_dbl;' in.nc foo.nc
I get the following error:
When the output is NetCDF4 the command succeeds e.g
ncap2 -4 -C -v -O -s 'n2=three_dmn_var_dbl;' in.nc foo.nc
in.nc is a NetCDF classic file
the variable three_dmn_var_dbl has the following definition:
...Henry
The text was updated successfully, but these errors were encountered: