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

Makefile could not be extracted: Permission denied #3492

Closed
heckj opened this issue Apr 30, 2018 · 9 comments
Closed

Makefile could not be extracted: Permission denied #3492

heckj opened this issue Apr 30, 2018 · 9 comments

Comments

@heckj
Copy link
Contributor

heckj commented Apr 30, 2018

I'm trying to debug a PyInstaller packaging issue and could use some assistance.

I'm working on Ubuntu 14.04 (Trusty) with Python 2.7 and a virtualenv. When I run a scripted installation of pyinstaller to build a binary of my application, originally with --onefile it was failing, returning the error:

[21537] WARNING: file already exists but should not: /tmp/_MEI9y6dRm/../../../../../usr/lib/python2.7/config-x86_64-linux-gnu/Makefile
../../../../../usr/lib/python2.7/config-x86_64-linux-gnu/Makefile could not be extracted!
fopen: Permission denied

When I switched to running pyinstaller with --debug --onedir on my software, it reflected a a security error when building the collection.

The full pyinstaller output is https://gist.github.com/heckj/12a1d76035d8a68c0c2a7177fb2bc9ab, and the tail-end section with the error:

6645 INFO: checking COLLECT
6645 INFO: Building COLLECT because out00-COLLECT.toc is non existent
6646 INFO: Building COLLECT out00-COLLECT.toc
Security-Alert: try to store file outside of dist-directory. Aborting. '../../../../../usr/lib/python2.7/config-x86_64-linux-gnu/Makefile'

The invocation to run this was pyinstaller --clean -y --onedir src/ruler_server.py, so I wasn't starting from a spec file, but from a clean virtualenv environment that had all the software's dependencies installed.

I did find the issue #2641, which I put up a PR for based on the issue comments, but I don't think it pertains to what I'm seeing. I'm not entirely clear on how COLLECT is coming up with that path, and would love some advice on how to back-track this and understand why it's functional when I do this by hand, but not via scripts.

@heckj
Copy link
Contributor Author

heckj commented May 1, 2018

I've continued to try and track this down, and the file that's reaching outside is generated in the Analysis section. When I'm running by hand, that analysis file generates a couple of DATA elements:

[('lib/python2.7/config-x86_64-linux-gnu/Makefile',
   '/usr/lib/python2.7/config-x86_64-linux-gnu/Makefile',
   'DATA'),
  ('local/include/python2.7/pyconfig.h',
   '/home/vagrant/src/Collector/.venv/local/include/python2.7/pyconfig.h',
   'DATA')],

And when this is found/generated, it works fine. When I'm running under a completely scripted "create the virtualenv and then run pyinstaller" kind of setup, the Analysis is generating the ../../../ sequences:

 [('../../../../../usr/lib/python2.7/config-x86_64-linux-gnu/Makefile',
   '/usr/lib/python2.7/config-x86_64-linux-gnu/Makefile',
   'DATA'),
  ('local/include/python2.7/pyconfig.h',
   '/home/vagrant/src/Collector/.rt-Linux-x86_64/local/include/python2.7/pyconfig.h',
   'DATA')],

@htgoebel
Copy link
Member

htgoebel commented May 2, 2018

When I'm running under a completely scripted "create the virtualenv and then run pyinstaller" kind of setup, the Analysis is generating the ../../../ sequences

Looks like your "completely scripted" process is some how different. Can you please check this?!

@htgoebel htgoebel changed the title PyIntaller bootloader error extracting files (bootloader 3) Makefile could not be extracted: Permission denied May 2, 2018
@htgoebel
Copy link
Member

htgoebel commented May 2, 2018

Did you test with the most current development version?

@heckj
Copy link
Contributor Author

heckj commented May 4, 2018

@htgoebel I haven’t yet tried with the latest dev version - I hit a separate error installing that when I tried the first time (was working from a stock Ubuntu 14.04 - I’ve been seeing issues with pip and setuptools installs since that “default ubuntu 14.04” install tool set is so out of date. I will try again with the latest dev tools and work through that.

I’m sure there’s something wrong in different scripting, it’s understanding what that is which what I’m missing and can’t spot it. I was hoping the Analysis output that generates the ../../../ sequence might help lead me to what is happening - I haven’t yet tracked the code down that builds that path to see what might be influencing it.

@htgoebel
Copy link
Member

htgoebel commented May 6, 2018

I’m sure there’s something wrong in different scripting, it’s understanding what that is which what I’m missing and can’t spot it.

Well, then maybe you should provide us with more information about you scripting environments. We are not clairvoyants.

@heckj
Copy link
Contributor Author

heckj commented May 6, 2018

@htgoebel didnt mean to imply you were. current issue is that its not consistent for me, but the gist is when I run a sequence like:

virtualenv .venv
source .venv/bin/activate
pip install -r requirements.txt
pyinstaller --onedir src/dosomething.py

It tends to work in same interactive terminal. When I put that into a script, then it's failing - but only sometimes. Enough to be a tad difficult.

My earlier question was hoping to elicit a pointer to the code or some details on how the paths were formed in the Analysis section, since I'm not that familiar with the codebase. I was hoping that might clue me in to what the differences are. I'm working on this between other issues unrelated to this, and will try and get a more consistent reproduction and share that here.

@htgoebel
Copy link
Member

htgoebel commented May 6, 2018

Are you sure you are installing pyinstaller into this venv? I'd suggest doing explicitly and also using explicit paths:

virtualenv .venv
.venv/bin/pip install -U pyinstaller
.venv/bin/pip install -r requirements.txt
.venv/bin/pyinstaller --onedir src/dosomething.py

@htgoebel
Copy link
Member

htgoebel commented May 6, 2018

Nevertheless I'm closing this now, since it does not look like a PyInstalelr issue, if the environment is not relyable.

@heckj
Copy link
Contributor Author

heckj commented May 6, 2018

Very good, thank you for you help, I do appreciate it.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants