Johnson Ho created OAK-11987:
--------------------------------

             Summary: 
org.apache.jackrabbit.oak.segment.azure.tool.SegmentStoreMigrator.migrateBinaryRef
 missing a null check
                 Key: OAK-11987
                 URL: https://issues.apache.org/jira/browse/OAK-11987
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: segment-azure
    Affects Versions: 1.86.0
            Reporter: Johnson Ho


I get the following NPE when calling 
org.apache.jackrabbit.oak.segment.azure.tool.SegmentStoreMigrator.migrateBinaryRef

{code}
2025-10-14T19:33:10.831595283Z java.lang.NullPointerException: Cannot invoke 
"org.apache.jackrabbit.oak.commons.Buffer.remaining()" because "buffer" is null
2025-10-14T19:33:10.831595283Z  at 
org.apache.jackrabbit.oak.segment.azure.tool.ToolUtils.fetchByteArray(ToolUtils.java:215)
2025-10-14T19:33:10.831595283Z  at 
org.apache.jackrabbit.oak.segment.azure.tool.SegmentStoreMigrator.migrateBinaryRef(SegmentStoreMigrator.java:217)
2025-10-14T19:33:10.831595283Z  at 
org.apache.jackrabbit.oak.segment.azure.tool.SegmentStoreMigrator.migrateArchives(SegmentStoreMigrator.java:186)
2025-10-14T19:33:10.831595283Z  at 
org.apache.jackrabbit.oak.segment.azure.tool.SegmentStoreMigrator.migrate(SegmentStoreMigrator.java:97)
2025-10-14T19:33:10.831595283Z  at 
com.adobe.granite.skyline.importer.ImportCmd.downloadSegments(ImportCmd.java:700)
2025-10-14T19:33:10.831595283Z  at 
com.adobe.granite.skyline.importer.ImportCmd.run(ImportCmd.java:217)
2025-10-14T19:33:10.831595283Z  at 
com.adobe.granite.skyline.importer.Main.main(Main.java:93)
2025-10-14T19:33:10.832041290Z 2025-10-14 19:33:10,831 [main] ERROR 
c.a.g.skyline.importer.ImportCmd - NullPointerException during segment 
migration. This may indicate a missing or corrupted binary reference in the 
Azure segment store.
2025-10-14T19:33:10.832041290Z java.lang.NullPointerException: Cannot invoke 
"org.apache.jackrabbit.oak.commons.Buffer.remaining()" because "buffer" is null
2025-10-14T19:33:10.832041290Z  at 
org.apache.jackrabbit.oak.segment.azure.tool.ToolUtils.fetchByteArray(ToolUtils.java:215)
2025-10-14T19:33:10.832041290Z  at 
org.apache.jackrabbit.oak.segment.azure.tool.SegmentStoreMigrator.migrateBinaryRef(SegmentStoreMigrator.java:217)
2025-10-14T19:33:10.832041290Z  at 
org.apache.jackrabbit.oak.segment.azure.tool.SegmentStoreMigrator.migrateArchives(SegmentStoreMigrator.java:186)
2025-10-14T19:33:10.832041290Z  at 
org.apache.jackrabbit.oak.segment.azure.tool.SegmentStoreMigrator.migrate(SegmentStoreMigrator.java:97)
2025-10-14T19:33:10.832041290Z  at 
com.adobe.granite.skyline.importer.ImportCmd.downloadSegments(ImportCmd.java:700)
2025-10-14T19:33:10.832041290Z  at 
com.adobe.granite.skyline.importer.ImportCmd.run(ImportCmd.java:217)
2025-10-14T19:33:10.832041290Z  at 
com.adobe.granite.skyline.importer.Main.main(Main.java:93)
2025-10-14T19:33:10.832041290Z 2025-10-14 19:33:10,832 [main] ERROR 
c.a.g.skyline.importer.ImportCmd - Source container: 
aem-rs-cm-p18652-e299970-aem-author-000040
2025-10-14T19:33:10.832114791Z 2025-10-14 19:33:10,832 [main] ERROR 
c.a.g.skyline.importer.ImportCmd - Source directory: 
https://sa0186520shared0be8e3317.blob.core.windows.net/aem-rs-cm-p18652-e299970-aem-author-000040/aem/
2025-10-14T19:33:10.832145592Z 2025-10-14 19:33:10,832 [main] ERROR 
c.a.g.skyline.importer.ImportCmd - This error is likely caused by a missing 
blob in Azure or a bug in Oak 1.86.0
2025-10-14T19:33:10.833820219Z 2025-10-14 19:33:10,833 [main] ERROR 
c.a.granite.skyline.importer.Main - Can't perform operation for id 
[990f2480-7cd7-4c45-86ea-e4373987a535]
2025-10-14T19:33:10.833820219Z java.io.IOException: Failed to migrate segments 
due to missing or corrupted binary data: Cannot invoke 
"org.apache.jackrabbit.oak.commons.Buffer.remaining()" because "buffer" is null
2025-10-14T19:33:10.833820219Z  at 
com.adobe.granite.skyline.importer.ImportCmd.downloadSegments(ImportCmd.java:707)
2025-10-14T19:33:10.833820219Z  at 
com.adobe.granite.skyline.importer.ImportCmd.run(ImportCmd.java:217)
2025-10-14T19:33:10.833820219Z  at 
com.adobe.granite.skyline.importer.Main.main(Main.java:93)
2025-10-14T19:33:10.833820219Z Caused by: java.lang.NullPointerException: 
Cannot invoke "org.apache.jackrabbit.oak.commons.Buffer.remaining()" because 
"buffer" is null
2025-10-14T19:33:10.833820219Z  at 
org.apache.jackrabbit.oak.segment.azure.tool.ToolUtils.fetchByteArray(ToolUtils.java:215)
2025-10-14T19:33:10.833820219Z  at 
org.apache.jackrabbit.oak.segment.azure.tool.SegmentStoreMigrator.migrateBinaryRef(SegmentStoreMigrator.java:217)
2025-10-14T19:33:10.833820219Z  at 
org.apache.jackrabbit.oak.segment.azure.tool.SegmentStoreMigrator.migrateArchives(SegmentStoreMigrator.java:186)
2025-10-14T19:33:10.833820219Z  at 
org.apache.jackrabbit.oak.segment.azure.tool.SegmentStoreMigrator.migrate(SegmentStoreMigrator.java:97)
2025-10-14T19:33:10.833820219Z  at 
com.adobe.granite.skyline.importer.ImportCmd.downloadSegments(ImportCmd.java:700)
2025-10-14T19:33:10.833820219Z  ... 2 common frames omitted
{code}

Taking a closer look at the AWS implementation, a null check is present. 
However, in Azure, the null check is missing.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to