Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHP] Check if cached file is present before using it #264

Open
Frzk opened this issue Jul 19, 2022 · 0 comments
Open

[PHP] Check if cached file is present before using it #264

Frzk opened this issue Jul 19, 2022 · 0 comments

Comments

@Frzk
Copy link
Contributor

Frzk commented Jul 19, 2022

When deploying a PHP extension, the script downloads a md5 checksum of the extension and compares this value with the one computed from the cache.
If the .md5 file can't be downloaded, it seems that the script considers it's OK to go on and considers that the file in the cache is appropriate.

In my case, the file in the cache wasn't existing, which led to the following trace and error:

+ local checksum_url=https://storage.gra.cloud.ovh.net/v1/AUTH_be65d32d71a6435589a419eac98613f2/scalingo-php-buildpack/scalingo-20/package/amqp-1.11.0.md5
+ local package_url=https://storage.gra.cloud.ovh.net/v1/AUTH_be65d32d71a6435589a419eac98613f2/scalingo-php-buildpack/scalingo-20/package/amqp-1.11.0.tgz
+ sed -u 's/^/       /'
++ curl --fail --retry 3 --retry-delay 2 --connect-timeout 3 --max-time 30 https://storage.gra.cloud.ovh.net/v1/AUTH_be65d32d71a6435589a419eac98613f2/scalingo-php-buildpack/scalingo-20/package/amqp-1.11.0.md5
+ local checksum=
+ local cache_checksum=
+ '[' -f /tmp/cache/package/amqp-1.11.0.md5 ']'
++ dirname amqp-1.11.0
+ mkdir -p /tmp/cache/package/.
+ '[' '' '!=' '' ']'
+ echo 'Checksums match. Fetching from cache.'
+ mkdir -p /app/vendor/amqp
       Checksums match. Fetching from cache.
+ tar xzf /tmp/cache/package/amqp-1.11.0.tgz -C /app/vendor/amqp
tar (child): /tmp/cache/package/amqp-1.11.0.tgz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

I suggest to check if the file is actually in the cache before using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant