Forum OpenACS Q&A: Permission Error on new install when installing package

I followed the instructions to install oacs on ubuntu 12.04 https://openacs.org/xowiki/naviserver-openacs

When trying to install from repository:
/acs-admin/install/

I am getting this in the logs:
[04/Jul/2014:20:06:08][1459.7f99c412a700][-conn:oacs-oacs-5-8:0] Error: Error downloading package attachments from https://openacs.org/repository/5-8/attachments-0.11d2.apm. Installing package failed.
[04/Jul/2014:20:06:08][1459.7f99c412a700][-conn:oacs-oacs-5-8:0] Notice: Installing calendar
[04/Jul/2014:20:06:08][1459.7f99c412a700][-conn:oacs-oacs-5-8:0] Notice: - Downloading
https://openacs.org/repository/5-8/calendar-2.6.1d2.apm...
[04/Jul/2014:20:06:10][1459.7f99c412a700][-conn:oacs-oacs-5-8:0] Notice: Unable to download. Please check your URL.

. The following error was returned:

couldn't open "/oacs-c0JF8h.apm": permission denied

What permissions need to be changed?

Thank You

Dear Raul,

i've just tested install from repository, and everything worked fine for me. The problem seems to be that the tmpdir is not set appropriately (the server should have no write permission on /, and it does not have to have it).

Can you check (e.g. from the developer shell), what the result of [ns_config ns/parameters tmpdir] is? It looks like tmpdir is set to "" (empty string) at your installation.

The tmpdir is determined as following:
a) if "tmpdir" is configured in the ns/parameters section the value is taken.
b) otherwise, if the environment variable TMPDIR is set, its value is taken.
c) otherwise, the value of the compile time macro P_tmpdir is used.

On most installations, TMPDIR (b) is actually used. If my guess concerning tmpdir is incorrect, we have to check version numbers in more detail.

All the best
-gustaf neumann

Thank you for you help.

Yes the tmpdir is set to ""

What is it supposed to be set to?

How do I set it?

Thank you

Raul,

try setting temp dir to "/tmp" or "/var/tmp" per:
http://manpages.ubuntu.com/manpages/karmic/en/man7/hier.7.html

cheers,
Ben

In case the value comes from the environment variable TMPDIR: Since ubuntu (at least the version i've checked) does not set TMPDIR, it has been set to "" on your system. Setting TMPDIR to "" is quite unusual. See [1] for how to set environment variables for a single shell, for a user or for the full system. You can set the environment variable e.g. in the script starting the server.

In case, the value is from you config file: check your startup-file for a add a line containing "tmpdir". If it is there, delete the line.

An appropriate value is e.g. "/tmp" (maybe with a trailing slash) as Benjamin already mentioned.

-g

[1] https://help.ubuntu.com/community/EnvironmentVariables

Thank you for your help.

I added it to the /var/www/oacs-oacs-5-8/etc/config.tcl and I am still getting the same error. Where in the config.tcl file do I add it?

I tried here:
ns_section ns/parameters
ns_param serverlog ${serverroot}/log/error.log
ns_param home $homedir
ns_param tmpdir /tmp

Thank You

yes, the place looks correct.

Just to be sure: is this really the config file you are using to start the server? Per default, the install script of [1] installs the startup script to ${ns_install_dir}/config-${oacs_service}.tcl, which is /usr/local/ns/config-${oacs_service}.tcl per default, and not in /var/www. There is nothing wrong about installing it there. I find it just hard to believe, that setting the parameter has no effect on querying the parameter later (via [ns_config ns/parameters tmpdir]).

In case, this was the file used for startup, replace in your build-dir naviserver-4.99.6/nsd/nsmain.c by https://openacs.org/nsmain.c, cd to naviserver-4.99.6, and do there a "root make install". After this, start your server; you should early during startup in the log file a line containing "get tmpdir".

[06/Jul/2014:13:07:44][4863.7fff777a7310][-main-] Notice: get tmpdir - config value 0x7f8b8d83fbb0 </tmp>
What do you get? What version of Ubuntu are you using?

-g
[1] https://openacs.org/xowiki/naviserver-openacs

I updated the wrong config file.

After I updated:
/usr/local/ns/config-oacs-oacs-5-8.tcl

It worked.

Thank you for your help.