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

Cannot install nginx-full --with-mruby-module #312

Closed
chriscarpenter12 opened this Issue Aug 8, 2017 · 4 comments

Comments

Projects
None yet
5 participants
@chriscarpenter12

chriscarpenter12 commented Aug 8, 2017

Indicate troubleshooting steps taken

  • Ran brew update and retried your prior step?
  • Ran brew doctor, fixed as many issues as possible and retried your prior step?
  • Checked that a similar issue hasn't already been filed?
  • Looked up the software bug tracker if reporting a build error?
  • If you're seeing permission errors tried running sudo chown -R $(whoami) $(brew --prefix)?

Bug reports / build errors:

brew install nginx-full --with-mruby-module
==> Installing nginx-full from homebrew/nginx
==> Installing dependencies for homebrew/nginx/nginx-full: mruby-nginx-module
==> Installing homebrew/nginx/nginx-full dependency: mruby-nginx-module
==> Downloading https://github.com/matsumoto-r/ngx_mruby/archive/v1.20.0.tar.gz
Already downloaded: /Users/chris/Library/Caches/Homebrew/mruby-nginx-module-1.20.0.tar.gz
Warning: This keg was marked linked already, continuing anyway
🍺  /usr/local/Cellar/mruby-nginx-module/1.20.0: 512 files, 4MB, built in 1 second
==> Installing homebrew/nginx/nginx-full --with-mruby-module
==> Downloading https://nginx.org/download/nginx-1.12.1.tar.gz
Already downloaded: /Users/chris/Library/Caches/Homebrew/nginx-full-1.12.1.tar.gz
==> git init
Last 15 lines from /Users/chris/Library/Logs/Homebrew/nginx-full/01.git:
2017-08-08 10:16:25 -0400

git
init

/usr/local/Cellar/mruby-nginx-module/1.20.0/share/mruby-nginx-module/.git: Operation not permitted

READ THIS: https://docs.brew.sh/Troubleshooting.html

These open issues may also help:
Compiler error when installing nginx-full ---with-upload-module https://github.com/Homebrew/homebrew-nginx/issues/304
building nginx-full with healthcheck module giving error https://github.com/Homebrew/homebrew-nginx/issues/263

Brief summary of issue:

Seems to have an issue initializing git in the directory?...

The complete command that you issued:

nginx-full --with-mruby-module

Gist with output of brew doctor:

Link output by brew gist-logs <formula>:

Output of brew config:

https://gist.github.com/chriscarpenter12/442504f6d1ea2f1fae281436185394d5

If I try going directly to /usr/local/Cellar/mruby-nginx-module/1.20.0/share/mruby-nginx-module I can run a git init manually.

Try to install again and get a different error:

brew install nginx-full --with-mruby-module
==> Installing nginx-full from homebrew/nginx
==> Downloading https://nginx.org/download/nginx-1.12.1.tar.gz
Already downloaded: /Users/chris/Library/Caches/Homebrew/nginx-full-1.12.1.tar.gz
==> git init
Last 15 lines from /Users/chris/Library/Logs/Homebrew/nginx-full/01.git:
2017-08-08 10:21:41 -0400

git
init

error: could not lock config file /usr/local/Cellar/mruby-nginx-module/1.20.0/share/mruby-nginx-module/.git/config: Operation not permitted
fatal: could not set 'core.repositoryformatversion' to '0'

READ THIS: https://docs.brew.sh/Troubleshooting.html

These open issues may also help:
Compiler error when installing nginx-full ---with-upload-module https://github.com/Homebrew/homebrew-nginx/issues/304
building nginx-full with healthcheck module giving error https://github.com/Homebrew/homebrew-nginx/issues/263

Seems to have an issue setting a line in the git config file. Ok, lets check:

cat /usr/local/Cellar/mruby-nginx-module/1.20.0/share/mruby-nginx-module/.git/config
[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
	ignorecase = true
	precomposeunicode = true

repositoryformatversion = 0 is already set to 0.

Not sure what else to try here. Any help is appreciated.

@totem3

This comment has been minimized.

Show comment
Hide comment
@totem3

totem3 Aug 13, 2017

I have encountered the same problem. This may be because now homebrew build is executed within a sandbox, using sandbox-exec.
The error occurs because the git command here tries to write or modify files in mruby-nginx-module directory, which is not allowed to write within the sandbox, even though you can write files under the only explicitly allowed directories within a sandbox.
You can see the detail with --verbose and --debug option.

The possible workaround to handle this is to use --no-sandbox option...

totem3 commented Aug 13, 2017

I have encountered the same problem. This may be because now homebrew build is executed within a sandbox, using sandbox-exec.
The error occurs because the git command here tries to write or modify files in mruby-nginx-module directory, which is not allowed to write within the sandbox, even though you can write files under the only explicitly allowed directories within a sandbox.
You can see the detail with --verbose and --debug option.

The possible workaround to handle this is to use --no-sandbox option...

@whatisjasongoldstein

This comment has been minimized.

Show comment
Hide comment
@whatisjasongoldstein

whatisjasongoldstein Aug 16, 2017

The no-sandbox option doesn't work for me.

whatisjasongoldstein commented Aug 16, 2017

The no-sandbox option doesn't work for me.

@denji

This comment has been minimized.

Show comment
Hide comment
@denji

denji Aug 19, 2017

Owner

error: could not lock config file /usr/local/Cellar/mruby-nginx-module/1.20.0/share/mruby-nginx-module/.git/config: Operation not permitted
fatal: could not set 'core.repositoryformatversion' to '0'

lsattr -d /usr/local/Cellar/mruby-nginx-module/*/share/mruby-nginx-module/.git{,/*}

/cc @matsumotory

Owner

denji commented Aug 19, 2017

error: could not lock config file /usr/local/Cellar/mruby-nginx-module/1.20.0/share/mruby-nginx-module/.git/config: Operation not permitted
fatal: could not set 'core.repositoryformatversion' to '0'

lsattr -d /usr/local/Cellar/mruby-nginx-module/*/share/mruby-nginx-module/.git{,/*}

/cc @matsumotory

@syucream

This comment has been minimized.

Show comment
Hide comment
@syucream

syucream Sep 22, 2017

Contributor

The no-sandbox option doesn't work for me.

It'll fixed by #324.
The sandbox-exec issue continues. Recent ngx_mruby contains mruby src so git files modifications is not required but nginx-full Formula writes mruby-nginx-modules Formula's dir, out of its dir. See also https://github.com/Homebrew/brew/blob/master/Library/Homebrew/formula_installer.rb#L696-L700.

I think these Formula's need any mechanism allows write operations from other Formula...

Contributor

syucream commented Sep 22, 2017

The no-sandbox option doesn't work for me.

It'll fixed by #324.
The sandbox-exec issue continues. Recent ngx_mruby contains mruby src so git files modifications is not required but nginx-full Formula writes mruby-nginx-modules Formula's dir, out of its dir. See also https://github.com/Homebrew/brew/blob/master/Library/Homebrew/formula_installer.rb#L696-L700.

I think these Formula's need any mechanism allows write operations from other Formula...

@denji denji closed this Sep 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment