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.

Regression 4.5.0 -> 4.6.1: valueBlobFile fails with "BLOB resource not found"

See original GitHub issue

Environment

Liquibase Version: 4.6.1

Liquibase Integration & Version: Spring Boot 2.1.18.RELEASE

Database Vendor & Version: H2 1.4.200 (in-memory)

Operating System Type & Version: macOS Catalina (10.15.7)

Description

Spring Boot application can’t start and fails with an exception.

Steps To Reproduce

Run an application with ./mvnw spring-boot:run

Actual Behavior

liquibase.exception.MigrationFailedException: Migration failed for change set liquibase/version/0.4/2017-05-29--test_image.xml::add-test-image::php-coder:
     Reason: liquibase.exception.DatabaseException: BLOB resource not found: /test/test.png

Expected/Desired Behavior

Migration should work as it worked before.

Additional Context

It has happened when I upgraded Liquibase from 4.5.0 to 4.6.1

Migration that has failed:

	<changeSet id="add-test-image" author="php-coder" context="test-data">
		
		<insert tableName="images_data">
			<column name="image_id" valueNumeric="1" />
			<column name="content" valueBlobFile="/test/test.png" />
		</insert>
		
	</changeSet>

See https://github.com/php-coder/mystamps/blob/4fd2d3b6c89cd06dcc027a7239233ab78be8b895/src/main/resources/liquibase/version/0.4/2017-05-29--test_image.xml

The file it looks for (/test/test.png) is here: src/main/resources/test/test.png

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
iorjfeiofjseoirfcommented, Apr 4, 2022

@famod said:

I bisected my way through this and ended up here: ba64243, so #2114 seems to have broken it.

Yes, I agree. liquibase.util.file.FilenameUtils#concat()` in Liquibase 4.5.0 documents its contract:

     * /foo + bar           -->   /foo/bar
     * /foo + /bar          -->   /bar

The newer liquibase.util.FilenameUtil#concat() since Liquibase 4.6.0 does not document its contract and none of the tests use an absolute path for the second parameter, but the method behaves differently:

     * /foo + bar           -->   /foo/bar
     * /foo + /bar          -->   /foo/bar

@nvoxland Could you please clarify if/how liquibase.util.FilenameUtil#concat() is intended to handle absolute paths for its second parameter?

1reaction
famodcommented, Jan 13, 2022

Good point if that’s the case (haven’t checked).

Btw, @php-coder I didn’t pay full attention to where your changelog file is located exactly. Since it’s located in /src/main/resources/liquibase/version/0.4/, you have to step up three levels: ../../../test/test.png But then again you probably don’t want to change your past changelogs anyway, right? 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

rest - "404 Resource Not Found" From Azure Blob Storage ...
During a PUT request, with the proper Authorization header, which creates a new BLOB, my process is getting a "404 Resource Not Found"...
Read more >
Use the Azure Storage Emulator for development and testing ...
The Microsoft Azure Storage Emulator is a tool that emulates the Azure Blob, Queue, and Table services for local development purposes.
Read more >
Azure.Storage 4.3.1 - PowerShell Gallery
Version Downloads Last updated 4.6.1 26,839,837 10/9/2018 4.6.0 344,102 9/24/2018 4.5.0 769,952 8/14/2018
Read more >
Azure.Storage.Blobs 12.14.1 - NuGet
This client library enables working with the Microsoft Azure Storage Blob service for storing binary and text data. For this release see notes ......
Read more >
No known class method for selector 'startSession' - IssueHint
After installing and building the pods i face the build error 'No known class ... Regression 4.5.0 -> 4.6.1: valueBlobFile fails with "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