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

Source permissions persist in build artifacts #4625

Closed
mattray opened this issue Feb 16, 2018 · 5 comments
Closed

Source permissions persist in build artifacts #4625

mattray opened this issue Feb 16, 2018 · 5 comments
Labels
Documentation Flags an issue / PR for attention by the technical documentation team Stale Type: Chore Issues for general code and infrastructure maintenance
Milestone

Comments

@mattray
Copy link
Contributor

mattray commented Feb 16, 2018

MacOS 10.13.3, Docker Version 18.02.0-ce-mac53 (22617)

For historical reasons I have umask 077 in my .bashrc and all files I check out from GitHub have permissions of 600 by default. When I enter the studio and build packages, permissions on files in the package are not changed and root ownership is preserved. This means that the https://github.com/mattray/sample-node-app fails with the following error:

sample-node-app.default(SV): Starting service as user=hab, group=hab
sample-node-app.default(O): fs.js:646
sample-node-app.default(O):   return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
sample-node-app.default(O):                  ^
sample-node-app.default(O):
sample-node-app.default(O): Error: EACCES: permission denied, open '/hab/pkgs/mattray/sample-node-app/1.0.1/20180216050235/app/routes/index.js'
sample-node-app.default(O):     at Object.fs.openSync (fs.js:646:18)
sample-node-app.default(O):     at Object.fs.readFileSync (fs.js:551:33)
sample-node-app.default(O):     at Object.Module._extensions..js (module.js:653:20)
sample-node-app.default(O):     at Module.load (module.js:556:32)
sample-node-app.default(O):     at tryModuleLoad (module.js:499:12)
sample-node-app.default(O):     at Function.Module._load (module.js:491:3)
sample-node-app.default(O):     at Module.require (module.js:587:17)
sample-node-app.default(O):     at require (internal/module.js:11:18)
sample-node-app.default(O):     at Object.<anonymous> (/hab/pkgs/mattray/sample-node-app/1.0.1/20180216050235/app/app.js:8:13)
sample-node-app.default(O):     at Module._compile (module.js:643:30)
hab-launch(SV): Child for service 'sample-node-app.default' with PID 40 exited with code exit code: 1

Manually updating the source permissions to 755 and 644 where appropriate and rebuilding the packages results in working demos.

I would expect habitat to set ownership of the files to the pkg_svc_user

@fnichol
Copy link
Collaborator

fnichol commented Feb 16, 2018

Am I right that this would be using the Node Scaffolding? If so, yep, we should be adding some group/other read/execute bits where appropriate.

@mattray
Copy link
Contributor Author

mattray commented Feb 16, 2018

It's both scaffolding and regular plans. sample-node-app, sample-rails-app and the national-parks demos all failed without fixing the permissions. chmoding the files properly fixed all of them.

@stale
Copy link

stale bot commented Apr 3, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

@stale stale bot added the Stale label Apr 3, 2020
@christophermaier christophermaier added Type: Chore Issues for general code and infrastructure maintenance and removed C-chore labels Jul 24, 2020
@stale stale bot removed the Stale label Jul 24, 2020
@christophermaier christophermaier added Documentation Flags an issue / PR for attention by the technical documentation team and removed A-documentation labels Aug 18, 2020
@stale
Copy link

stale bot commented Oct 1, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

@stale stale bot added the Stale label Oct 1, 2022
@stale
Copy link

stale bot commented Mar 19, 2023

This issue has been automatically closed after being stale for 400 days. We still value your input and contribution. Please re-open the issue if desired and leave a comment with details.

@stale stale bot closed this as completed Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Flags an issue / PR for attention by the technical documentation team Stale Type: Chore Issues for general code and infrastructure maintenance
Projects
None yet
Development

No branches or pull requests

5 participants