Forum OpenACS Q&A: (Error: can't read "address": no such variable) after Install OpenACS with NaviServer from Scratch

Request notifications

Congratulations, you have installed OpenACS with NaviServer on your machine.
You might start the server manually with

sudo /usr/local/ns/bin/nsd -t /usr/local/ns/config-oacs-5-9.tcl -u nsadmin -g nsadmin

or you can manage your installation with upstart (Ubuntu/Debian). In this case, you might use the following commands

status oacs-5-9
start oacs-5-9
stop oacs-5-9

To use OpenACS, point your browser to http://localhost:8000/
The configuration file is /usr/local/ns/config-oacs-5-9.tcl
and might be tailored to your needs. The access.log and error.log of this instance are in /var/www/oacs-5-9/log
---------------------------------------------
I changed the 127.0.0.1 to 0.0.0.0 tried it and it did not work then to the specific ip address and i still get the following:

kmw@lrn-ubuntu-16-0-4:/var/www/oacs-5-9/log$ sudo /usr/local/ns/bin/nsd -t /usr/local/ns/config-oacs-5-9.tcl -u nsadmin -g nsadmin -b (used the ip address:8000)
kmw@lrn-ubuntu-16-0-4:/var/www/oacs-5-9/log$ [25/Aug/2016:14:08:57][2636.7f9199599700][-main-] Notice: trying to prebind
[25/Aug/2016:14:08:57][2636.7f9199599700][-main-] Notice: prebind: proto tcp addr (ip) port 8000
[25/Aug/2016:14:08:57][2636.7f9199599700][-main-] Notice: prebind adds: SockAddr family AF_INET, (ip), port 8000
[25/Aug/2016:14:08:57][2636.7f9199599700][-main-] Notice: prebind: tcp: [ip]8000 = 4
[25/Aug/2016:14:08:57][2636.7f9199599700][-main-] Notice: nsd.tcl: starting to read config file...
[25/Aug/2016:14:08:57][2636.7f9199599700][-main-] Error: can't read "address": no such variable
can't read "address": no such variable
while executing
"ns_param address $address"
(context: config eval)
[25/Aug/2016:14:08:57][2636.7f9199599700][-main-] Fatal: config error
[25/Aug/2016:14:08:57][2636.7f9199599700][-main-] Notice: binder: started
[25/Aug/2016:14:08:57][2636.7f9199599700][binder] Notice: binder: stopped
-------------------------------------
what am i not doing?

should it work after editing the ip address in the /usr/local/ns/config-oacs-5-9.tcl ?
or are there other files that need to be edited?

Hi Kenneth,

It looks like you hit a small glitch with Naviserver 4.99.11 release that is corrected for the next (now recent) release (naviserver-4.99.12).

What version of Naviserver are you using?

Yep, looks like so, the fix is super easy, is really just a missing var in the conf, but as the new version is out there I'd say Kenneth could just upgrade his Naviserver
ok i've downloaded https://sourceforge.net/projects/naviserver/files/latest/download?source=files
and what do i need to do to update it? I've done several searches everything comes up with upgrade.

how is it that the script does not pull in the new version?
thank you for helping me. i need to install .lrn several times

you are probably referring to the install-ns.sh file. This install script "knows" the version numbers from the configuration section at the begin of the script [1]. change the version number of naviserver and the modules from 4.99.11 to 4.99.12 in your downloaded version of the script, and the will get that newest version. i am currently at vacation in greece and can't update the installation script.

-gn
PS: don't run scripts on your machine without looking first, what these are doing.
[1] https://github.com/gustafn/install-ns/blob/master/install-ns.sh#L22

Collapse
Posted by Kenneth Wyrick on
ok to install the newer version of naviserver I worked through the instructions at: https://bitbucket.org/naviserver/naviserver/
which instructed me to run:
sudo gunzip < naviserver-4.99.12.tar.gz | tar xvf -

It returned MANY lines i.e. the following:
tar: naviserver-4.99.11/doc/html/naviserver/files/ns_write.html: Cannot open: No such file or directory
naviserver-4.99.11/doc/html/naviserver/files/ns_writecontent.html
tar: naviserver-4.99.11: Cannot mkdir: Permission denied

so now i am trying to figure out how to un-install naviserver-4.99.11. any direction would be greatly appreciated.

thanks.

can i change naviserver version from 11 to 10 on line 210 of the:
https://github.com/gustafn/install-ns/blob/master/install-ns.sh#L210
?
210 version_ns=${version_ns}
correction not line 210 but on
line 29 version_ns=4.99.11
change line 29 to version ns=4.99.12
Almost.

$ grep -n 4.99.11 install-ns.sh
29:version_ns=4.99.11
31:version_modules=4.99.11

Lines 29 and 31 should be changed to same: 4.99.12

ok i changed the one but not the other and got the following error:

modules/websocket/websocket-procs.tcl
gcc -I/usr/include/postgresql -O2 -fomit-frame-pointer -DNDEBUG -Wall -fPIC -pipe -I/usr/local/ns/include -I"/usr/local/ns/include" -DHAVE_CONFIG_H -c -o nsdbpg.o nsdbpg.c
nsdbpg.c:47:1: error: unknown type name ‘Ns_ReturnCode’
static Ns_ReturnCode OpenDb(Ns_DbHandle *handle);
^
nsdbpg.c:48:1: error: unknown type name ‘Ns_ReturnCode’
static Ns_ReturnCode CloseDb(Ns_DbHandle *handle);
^
nsdbpg.c:53:1: error: unknown type name ‘Ns_ReturnCode’
static Ns_ReturnCode Flush(const Ns_DbHandle *handle);
^
nsdbpg.c:54:1: error: unknown type name ‘Ns_ReturnCode’
static Ns_ReturnCode ResetHandle(Ns_DbHandle *handle);
^
nsdbpg.c:100:1: error: unknown type name ‘Ns_ReturnCode’
Ns_DbDriverInit(const char *driver, const char *configPath)
^
nsdbpg.c:180:1: error: unknown type name ‘Ns_ReturnCode’
OpenDb(Ns_DbHandle *handle)
^
nsdbpg.c:259:1: error: unknown type name ‘Ns_ReturnCode’
CloseDb(Ns_DbHandle *handle) {
^
nsdbpg.c:598:1: error: unknown type name ‘Ns_ReturnCode’
Flush(const Ns_DbHandle *handle)
^
nsdbpg.c:636:1: error: unknown type name ‘Ns_ReturnCode’
ResetHandle(Ns_DbHandle *handle)
^
make: *** [nsdbpg.o] Error 1
root@lrn-14:/usr/local/src/install-ns#

hopefully i can make the change to the second one and run it again or do need to start over?

actually i noticed that i changed line 31 and not 29 so i changed it and started it again. i will let you know what happens.

thank you very very much.

the 2 ns and oacs scripts finished and gave me a congratulations. i commented out the 127.0.0.1 and uncommented the 0.0.0. and ran the following command.

root@lrn-14:/usr/local/src/install-ns# sudo /usr/local/ns/bin/nsd -t /usr/local/ns/config-oacs-5-9.tcl -u nsadmin -g nsadmin
[26/Aug/2016:15:05:46][2637.7f9cea895740][-main-] Notice: OpenSSL 1.0.1f 6 Jan 2014 initialized
root@lrn-14:/usr/local/src/install-ns# [26/Aug/2016:15:05:46][2638.7f9cea895740][-main-] Notice: nsd.tcl: starting to read config file...
[26/Aug/2016:15:05:46][2638.7f9cea895740][-main-] Notice: Use Tcl thread library /usr/local/ns/lib/thread2.7.3/libthread2.7.3.so
[26/Aug/2016:15:05:46][2638.7f9cea895740][-main-] Notice: nsd.tcl: using threadsafe tcl: 1
[26/Aug/2016:15:05:46][2638.7f9cea895740][-main-] Notice: nsd.tcl: finished reading config file.
[26/Aug/2016:15:05:46][2638.7f9cea895740][-main-] Notice: binder: started
[26/Aug/2016:15:05:47][2638.7f9cea895740][binder] Fatal: binder: recvmsg() failed: recv 56 bytes, 'Success'

For clarity, you replaced with "0.0.0.0" not "0.0.0." right?
What is the first error in the log file.
log is probably at /var/www/oacs-5-9/log/error.log
I have recently upgraded from 4.99.11 to 4.99.12 as you are doing without encountering issues. I run current Debian testing. What kind of distro/version are you running?

What I did was just:
- donwload again install-ns.sh from here to ensure I didn't miss any recent change in the script https://raw.githubusercontent.com/gustafn/install-ns/master/install-ns.sh
- made it executable using chmod
- opened the script looking for any line about naviserver version 4.99.11 and changed it to 4.99.12 (lines about version are at the beginning of the script)
- run the script

My dev istance could run ok without any fiddling, just changing the web server underneath.

Maybe you just need to "clear the room" a bit

i'm using ubuntu 16.0.4.4 server which install postgresql 9.5. I did edit the install-ns.sh and it seem to work but the nsd loaded before the postgres which i think, postgres needs to load before the nsd.

i like that you did it with debian testing. i prefer to use the https://www.turnkeylinux.org/postgresql but ran into compression file setting problems.

^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: Sourcing files for postload...^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: Done.^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: Executing initialization code blocks...^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: QD=Postload files to load from www: ^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: QD=Postload files to load from tcl: ^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: driver: starting: nssock_v4^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce28da700][-driver:nssock_v4-] ^[[0m^[[0;39mNotice: bind operation on sock 14 lead to error: Address a$
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce28da700][-driver:nssock_v4-] ^[[0m^[[1;39mWarning: bind on: SockAddr family AF_INET, ip 0.0.0.0, por$
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce28da700][-driver:nssock_v4-] ^[[0m^[[1;31mError: Ns_SockBinderListen: sendmsg() failed: sent 56 byte$
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce28da700][-driver:nssock_v4-] ^[[0m^[[1;31mError: nssock_v4: failed to listen on [0.0.0.0]:8000: Addr$
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: nsmain: NaviServer/4.99.12 running^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: nsmain: security info: uid=1001, euid=1001, gid=1001, egid=100$
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea894700][-sched-] ^[[0m^[[0;39mNotice: sched: starting^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce28da700][-driver:nssock_v4-] ^[[0m^[[0;39mNotice: driver: accepting connections^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce28da700][-driver:nssock_v4-] ^[[0m^[[0;39mNotice: exiting^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce29db700][-conn:oacs-5-9:0-] ^[[0m^[[0;39mNotice: thread initialized (0.179198 secs)^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce2adc700][-conn:oacs-5-9:1-] ^[[0m^[[0;39mNotice: thread initialized (0.178231 secs)^[[0m
the same as above but with more lines

^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: Loading acs-tcl/tcl/xml-1-dom-procs.tcl^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: Loading acs-tcl/tcl/xml-2-procs.tcl^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: Bootstrap: Installation is not complete - sourcing the installer.^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: Sourcing files for postload...^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: Done.^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: Executing initialization code blocks...^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: QD=Postload files to load from www: ^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: QD=Postload files to load from tcl: ^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: driver: starting: nssock_v4^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce28da700][-driver:nssock_v4-] ^[[0m^[[0;39mNotice: bind operation on sock 14 lead to error: Address already in use^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce28da700][-driver:nssock_v4-] ^[[0m^[[1;39mWarning: bind on: SockAddr family AF_INET, ip 0.0.0.0, port 8000^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce28da700][-driver:nssock_v4-] ^[[0m^[[1;31mError: Ns_SockBinderListen: sendmsg() failed: sent 56 bytes, 'Address already in use'^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce28da700][-driver:nssock_v4-] ^[[0m^[[1;31mError: nssock_v4: failed to listen on [0.0.0.0]:8000: Address already in use^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: nsmain: NaviServer/4.99.12 running^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea895740][-main-] ^[[0m^[[0;39mNotice: nsmain: security info: uid=1001, euid=1001, gid=1001, egid=1001^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9cea894700][-sched-] ^[[0m^[[0;39mNotice: sched: starting^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce28da700][-driver:nssock_v4-] ^[[0m^[[0;39mNotice: driver: accepting connections^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce28da700][-driver:nssock_v4-] ^[[0m^[[0;39mNotice: exiting^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce29db700][-conn:oacs-5-9:0-] ^[[0m^[[0;39mNotice: thread initialized (0.179198 secs)^[[0m
^[[0;32m[26/Aug/2016:15:05:47][2638.7f9ce2adc700][-conn:oacs-5-9:1-] ^[[0m^[[0;39mNotice: thread initialized (0.178231 secs)^[[0m
^[[0;32m[27/Aug/2016:00:00:00][2623.7fd7cbffc700][-sched-] ^[[0m^[[0;39mNotice: nslog: closed '/var/www/oacs-5-9/log//access.log'^[[0m
^[[0;32m[27/Aug/2016:00:00:00][2623.7fd7cbffc700][-sched-] ^[[0m^[[0;39mNotice: nslog: opened '/var/www/oacs-5-9/log//access.log'^[[0m
^[[0;32m[27/Aug/2016:00:00:00][2638.7f9cea894700][-sched-] ^[[0m^[[0;39mNotice: nslog: closed '/var/www/oacs-5-9/log//access.log'^[[0m

Looks like an nsd or other service is already using the port:

"Error: nssock_v4: failed to listen on [0.0.0.0]:8000: Address already in use"

The script sets up an autostart. You can check and control by issuing one of these from root (or sudo):

oacs-5-9 status
oacs-5-9 stop
oacs-5-9 start

It worked using debian testing netinstall. it actually may have been working before but when i ctrl c out of the terminal it stopped the naviserver from running. so now on to using systemctl to start it as a service... next i need to figure out what the it is so i can run the command.

thank you all for your help and support with me working through this install. it really does mean a lot to me.

cheers!

Hi Kenneth,

FYI, if you run nsd from the terminal, it's normal for it to quit with ctrl-c.

Since you've already installed on ubuntu using the install-ns.sh script, you should be able to control starting, stopping the server with:

sudo status oacs-5-9
sudo start oacs-5-9
sudo stop oacs-5-9

There should be no need to do something else.
cheers,
Ben

Collapse
22: steps to install oacs/lrn (response to 1)
Posted by Kenneth Wyrick on
1. Installed debian testing netinstall

2. apt-get install postgres

3. cd /usr/local/src/

4. download the two install scripts:
https://raw.githubusercontent.com/gustafn/install-ns/master/install-ns.sh
https://raw.githubusercontent.com/gustafn/install-ns/master/install-oacs.sh

5. edit the install-ns.sh under settings: #ns_install_dir=/usr/local/oo2
version_ns=4.99.12
#version_ns=HEAD
version_modules=4.99.12
*changed from 4.99.11 to 4.99.12

6. edit the install-oacs.sh under settings:
oacs_dir=/var/www/${oacs_service}
db_name=${oacs_service}
install_dotlrn=1
*where the dotlrn=0 is 1 as above

7. bash both scripts (above)

8. follow the instructions on the screen