question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] NPE when using com.azure.storage.file.share.ShareFileClient#openInputStream()

See original GitHub issue

Describe 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 image

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:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ibrahimrababcommented, Nov 9, 2022

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

1reaction
alzimmermsftcommented, Nov 9, 2022

Thanks for the update, @ibrahimrabab.

It was weird that the tests only failed on Linux + JDK 17.

Does this mean our test pipeline uses the current version of the storage file share SDK? @ibrahimrabab @alzimmermsft

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”

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] ShareFileClient.upload() fails to upload empty file #30200
[BUG] ShareFileClient.upload() fails to upload empty file #30200 ... <init>(ShareFileRange.java:43) at com.azure.storage.file.share.
Read more >
Troubleshoot Azure Files problems in Windows (SMB)
Troubleshoot problems with SMB Azure file shares in Windows. See common issues related to Azure Files when you connect from Windows clients, ...
Read more >
Troubleshoot Azure Files problems in Linux (SMB)
You're trying to connect to an Azure file share from an Azure VM, and the VM is not in the same region as...
Read more >
Azure File Share client library for Java | Microsoft Learn
The File Share service offers the following four resources: the storage account, shares, directories, and files. Shares provide a way to ...
Read more >
Azure Cosmos DB Trigger Function uploading file to storage ...
I'm writing azure cosmos DB trigger function using Java, ... getAbsolutePath(),true);. Error:- Uploading to Blob storage as blob:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found