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

5.7.0 Upgrade - ucar.nc2.NetcdfFiles.openInMemory Errors for BUFR Files #1418

Open
1 task done
jacobwentzib opened this issue Feb 24, 2025 · 8 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@jacobwentzib
Copy link

Versions impacted by the bug

Recently upgrade to 5.7.0 - Seeing errors when trying to open BUFR files with the strack trace below. I am seeing the following commit: c54869c#diff-87d57326a1634222cff4aaa832d13fd2b0c8578b6965291a81e514c100d6e11b in 5.7.0 but little information on the purpose of the change.

What went wrong?

  1. Trying to open a files that has multiple BUFR Obs within in it.
  2. Stack trace on Variable 'obs_2' already exists
  3. file previously worked on v

Relevant stack trace

java.lang.IllegalArgumentException: Variable 'obs_2' already exists

	at ucar.nc2.Group$Builder.lambda$addVariable$10(Group.java:1237)
	at java.base/java.util.Optional.ifPresent(Optional.java:178)
	at ucar.nc2.Group$Builder.addVariable(Group.java:1236)
	at ucar.nc2.iosp.bufr.BufrIospBuilder.<init>(BufrIospBuilder.java:105)
	at ucar.nc2.iosp.bufr.BufrIosp2.build(BufrIosp2.java:101)
	at ucar.nc2.NetcdfFiles.build(NetcdfFiles.java:835)
	at ucar.nc2.NetcdfFiles.open(NetcdfFiles.java:770)
	at ucar.nc2.NetcdfFiles.openInMemory(NetcdfFiles.java:718)

Relevant log messages

No response

If you have an example file that you can share, please attach it to this issue.

If so, may we include it in our test datasets to help ensure the bug does not return once fixed?
Note: the test datasets are publicly accessible without restriction.

Yes

Code of Conduct

  • I agree to follow the UCAR/Unidata Code of Conduct
@jacobwentzib jacobwentzib added the bug Something isn't working label Feb 24, 2025
@lesserwhirls
Copy link
Collaborator

@Yaqiang, any thoughts on what could be happening here? @jacobwentzib - do you have an example file to help reproduce the error?

@Yaqiang
Copy link
Contributor

Yaqiang commented Feb 24, 2025

Yes, I need an example file to reproduce the error firstly.

@lesserwhirls
Copy link
Collaborator

Thank you for being willing to take a look!

@jacobwentzib
Copy link
Author

@Yaqiang
Copy link
Contributor

Yaqiang commented Feb 25, 2025

2024060100_GTS_sn.0001.txt

Got it. I will test ASAP.

@Yaqiang
Copy link
Contributor

Yaqiang commented Feb 25, 2025

I found the source of the error that the previous code can not make sure only unique categories are included in the protoMessages list. I used the category list to avoid this (maint-5.x...Yaqiang:netcdf-java:develop). It's ok now in my test using MeteoInfoLab script. @jacobwentzib You may test yourself to make sure the change is ok or not with netcdf-java folk repository in my account.

Image

@jacobwentzib
Copy link
Author

@Yaqiang Will you be opening a PR for this or are you asking me to do that? And this is wonderful to hear!

@Yaqiang
Copy link
Contributor

Yaqiang commented Feb 26, 2025

@jacobwentzib I am just not sure if this change could solve all your issues with you data files. So it's better to see you feedback on it. I will open a PR if the feedback is positive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants