Failed to execv() on trying to upgrade on shared host

357 views
Skip to first unread message

turbo2ltr

unread,
Aug 28, 2022, 1:00:56 PM8/28/22
to GAM for Google Workspace
I'm upgrading a 4.x install to the latest 6.x installation. I did this a few minutes ago on a VPS that I have root on, but I use it on a shared hosting account as well.  
First issue was the shared host doesn't have xz installed so I couldn't extract the archives.  for a 15mb file does it really require the use of xz instead of the much more prevalent gz is used??

Anyway I copied the files over from my successful upgrade and went to run "gam update project" and got this:

Failed to execv() /tmp/staticx-hMBhMp/gam: Permission denied

I assume that is because they do not allow users to execute anything in tmp.

How can I get around this?  Can I tell gam not to use /tmp but instead use a local folder I have execute permissions on?

Jay Lee

unread,
Aug 28, 2022, 1:07:38 PM8/28/22
to google-ap...@googlegroups.com
xz is available on every modern Linux distro I know of, what are you using that doesn't have it?

The setup script calls the mktemp command to create the temporary file. On most systems mktemp in turn uses the TMPDIR environment variable to understand where it's supposed to write temp files. This sounds broken on your system and should be fixed either by setting TMPDIR or asking it be corrected on the shared host system for everyone.

The tl;dr is that your hosted system sounds rather broken or difficult to use. Have you considered just using a GCP VM? There is a free tier...

Jay

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/a2a791ad-cb8e-48b0-bfb7-7c90efcef202n%40googlegroups.com.

turbo2ltr

unread,
Aug 28, 2022, 1:48:28 PM8/28/22
to GAM for Google Workspace
Linux version 3.10.0-962.3.2.lve1.5.38.el7.x86_64 (cloudlinux.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) running cPanel

I don't view not allowing shared hosting users from executing files from /tmp as being broken. As a matter of fact, cPanel specifically recommends doing this for security reasons.

I don't go with a VPS because this is not my site, I volunteer to manage it (Non profit) and don't want to have to manage the OS too.

Now back to the original issue.
I used the following command and then it worked.

export TMPDIR=~/gam/temp


Thanks.

Jay Lee

unread,
Aug 28, 2022, 2:24:21 PM8/28/22
to google-ap...@googlegroups.com
To clarify I'd consider not allowing users to write to /tmp just fine. But not ALSO setting TMPDIR to somewhere they can write to like $HOME/tmp is broken IMHO because it leaves apps like GAM without the ability to do simple things like create a temp file wherever.

Glad it's working for you.

Jay

Steve Zinski

unread,
Sep 6, 2022, 3:06:21 PM9/6/22
to GAM for Google Workspace
I am having this issue too. Our System Admins mount the /tmp filesystem with "noexec" flag which is a best-practice security measure. But GAM won't run with with that setting.

[root]# gam version
Failed to execv() /tmp/staticx-OHgech/gam: Permission denied

I mounted /tmp with the "exec" flag to get GAM installed, but my SAs want it set back to "noexec" to comply with their security policies. What's the suggested workaround?

turbo2ltr

unread,
Sep 6, 2022, 3:10:33 PM9/6/22
to GAM for Google Workspace
I posted the solution in my previous post.

Run this before you try to  upgrade:
export TMPDIR=~/gam/temp

Note that ~/gam/temp must exist and needs execute permissions for the user calling the gam update.
Message has been deleted

Steve Zinski

unread,
Sep 6, 2022, 3:35:27 PM9/6/22
to GAM for Google Workspace
Thanks, that seems to have done the trick.
Reply all
Reply to author
Forward
0 new messages