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

Permission denied (absent execute-permission) #28

Open
lon9man opened this issue Sep 18, 2023 · 6 comments
Open

Permission denied (absent execute-permission) #28

lon9man opened this issue Sep 18, 2023 · 6 comments

Comments

@lon9man
Copy link

lon9man commented Sep 18, 2023

Hello, noticed interesting case.

WHAT I DID

i installed your package in 2 places:

  1. local development (docker) - Debian GNU/Linux 11 (bullseye) 5.4.0-137-generic
  2. dev-server Ubuntu 22.04.3 LTS 5.15.0-1031-aws

WHAT I GOT

i got different execute-permissions in these 2 cases.

  1. local development (docker)
    image

  2. dev-server
    image

in case 1 package works as expected.
in case 2 package works with error:

Couldn't convert HEIC to JPG: 'sh: 1: /home/user/app/vendor/maestroerror/php-heic-to-jpg/src/../bin/php-heic-to-jpg-linux-arm64: Permission denied' | 
Bin used: 'php-heic-to-jpg-linux-arm64' HEIC: '/tmp/image-editor/image-editor-2iIvs9' 
Full Command: '/home/user/app/vendor/maestroerror/php-heic-to-jpg/src/../bin/php-heic-to-jpg-linux-arm64 "/tmp/image-editor/image-editor-2iIvs9" "/tmp/image-editor/image-editor-2iIvs9-19333623666504703814bc31.41181168" 2>&1' 
Output from heif-converter-image exe: 

when i add execute-permission for php-heic-to-jpg-linux-arm64 then package works as expected.

QUESTIONS

  1. why permissions are different on 2 environments?
  2. how should look correct execute-permissons for files?
  3. why in case 1 execute-permissions are absent for files php-heic-to-jpg-{os-architecture}, but package works as expected? and in case 2 - not?
  4. what is the suggestion to make it work in both cases (add execute-permissons for all needed files or something else)?

thanks!

@MaestroError
Copy link
Owner

Hi, @lon9man! Thanks for reaching out! I am not sure why are they different but in the first case (local development (docker)) it used heicToJpg and execute permission was correct, so it worked 👍 In the second case, it tried to use php-heic-to-jpg-linux-arm64 probably because the "dev-server" is arm64 architecture. But execution permission wasn't set, so it threw an error.

Both cases acted logically, we just need to find out, why execution permission isn't set correctly for needed bin files (Second case) and yes, to make it work all needed files should have execute-permissions 👍

@lon9man
Copy link
Author

lon9man commented Sep 20, 2023

@MaestroError, thanks for the response!
Will you have a chance to detect the issue and update the package?

Offtop question:
Method convertFromUrl creates temporary file inside project-root.. as for me it should create it inside /tmp to prevent make a mess.

Thanks!

@MaestroError
Copy link
Owner

Strange, I think it should delete the temporary file right after execution. Sure, I will keep this issue open to remind me about it and I will update the package with the following fixes:

  • Setting correct execution permission for any platform
  • Delete the temp file created by convertFromUrl

@lon9man
Copy link
Author

lon9man commented Sep 20, 2023

It deletes it if everything gone successfully, but if we got error - then file remains in Project-root and developer should delete artifacts manually..
if it will be located in /tmp in any case it will be good solution

@jdevinemt
Copy link
Contributor

Any update on this? I'm also experiencing this installing in a docker container (Ubuntu 20.04)

Screenshot 2024-03-20 at 5 03 17 PM

@MaestroError
Copy link
Owner

Hey @jdevinemt! Unfortunately not, I wasn't able to update it yet, but you can solve them easily by setting execution permission 👍

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

3 participants