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.

Asset.fingerprint() does not account for file mode, only file type and content

See original GitHub issue

When adding files to an Asset staging area a hash is calculated that attempts to verify that the files have actually changed in order to avoid unneeded rebuilds. However, the fingerprint() function that calculates this hash only takes into account the type of the file (file or folder) and its content.

It does not take into account the Unix file mode. So if you change the mode of a file the asset system will not detect a change and will not rebuild the asset.

Reproduction Steps

I created a Dockerfile that executes a bash script. Initially forgot to chmod +x the script file, so it was not executable. I built the asset with CDK, which built the Docker image and pushed it.

Once I realize the error of my ways and the Docker image failed to run in my dev environment I went back and ran chmod +x on the bash script file so that it could actually be executed.

I did a CDK build again and noted that CDK skipped the asset build because it did not notice any changes. Despite the file mode change CDK continued to use the previous version of the Docker image without picking up my changes. I had to make another file change by adding a comment before CDK noticed a change and rebuilt the asset

Environment

  • CLI Version : 1.22.0
  • Framework Version: 1.22.0

This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
christophgysincommented, Feb 11, 2021

Bad bot.

0reactions
github-actions[bot]commented, Feb 28, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

css - Rails 4; asset helper not pointing to fingerprinted image ...
Rails apps require use of asset helpers so that when the assets are precompiled, the source will be a fingerprinted asset file. I.e.,...
Read more >
Verify Android App Links - Android Developers
You can verify whether you're using Play App Signing for your app in your Play Console developer account under Release > Setup >...
Read more >
Content eligible for Content ID - YouTube Help - Google Support
Fingerprint -only references will be automatically replaced with media-file references that embody the identical content. If you provide such a fingerprint-only ...
Read more >
The Asset Pipeline - Ruby on Rails Guides
Fingerprinting is a technique that makes the name of a file dependent on the contents of the file. When the file contents change,...
Read more >
How do I get the MD5 sum of a directory's contents as one sum?
The right way depends on exactly why you're asking: Option 1: Compare Data Only. If you just need a hash of the tree's...
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