[BUG] NPE when using com.azure.storage.file.share.ShareFileClient#openInputStream()
See original GitHub issueDescribe the bug
We have a build-from-source pipeline to run integration tests, we found NPE when using com.azure.storage.file.share.ShareFileClient#openInputStream()
.
Exception or Stack Trace
2022-11-03T02:22:58.1539717Z java.lang.NullPointerException: Cannot invoke "java.lang.Long.longValue()" because the return value of "com.azure.storage.file.share.models.ShareFileRange.getEnd()" is null
2022-11-03T02:22:58.1542857Z at com.azure.storage.file.share.ShareFileClient.openInputStream(ShareFileClient.java:132)
2022-11-03T02:22:58.1545589Z at com.azure.storage.file.share.ShareFileClient.openInputStream(ShareFileClient.java:121)
2022-11-03T02:22:58.1548417Z at com.azure.spring.cloud.core.resource.StorageFileResource.getInputStream(StorageFileResource.java:180)
2022-11-03T02:22:58.1551481Z at com.azure.spring.cloud.integration.***s.storage.***.StorageFileShareIT.***StorageFileShareOperation(StorageFileShareIT.java:35)
To Reproduce This issue always occurs, please run this IT this IT StorageFileShareIT
Run tests pipeline in this PR https://github.com/Azure/azure-sdk-for-java/pull/31911 See the detail excepton log from https://dev.azure.com/azure-sdk/internal/_build/results?buildId=1964030&view=logs&j=32044c8a-cbe9-5d25-6615-786933ab9334&t=8fea6837-1f61-5208-5da0-48288d222902&l=157
Code Snippet N/A
Expected behavior No exception.
Screenshots N/A
Setup (please complete the following information):
- OS: [linux 5.15.0-1022-azure ]
- IDE: [N/A]
- Library/Libraries: [com.azure:azure-storage-file-share:current(Nov 3 2022)]
- Java version: [temurin-17-jdk-amd64 17.0.4.1]
- Frameworks: [Spring Boot 2.7.4 or Spring Boot 3.0.0-RC1]
Additional context Pipeline env
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- Bug Description Added
- Repro Steps Added
- Setup information Added
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Hi @moarychan The failures seen are due to a bug that was introduced last week, but we have a fix that was recently merged so the NPE shouldn’t appear now. 😃
To confirm, I ran the test pipelines and they’re now succeeding, https://dev.azure.com/azure-sdk/internal/_build/results?buildId=1975381&view=results
The PR with the fix is here
At least for the run linked, yes that was using the test from source logic. You can see that in the name of the step that failed:
“Run tests for From Source run”