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

issue on Ubuntu 10.04 LTS (lucid) #49

Open
focal opened this issue Apr 13, 2011 · 12 comments
Open

issue on Ubuntu 10.04 LTS (lucid) #49

focal opened this issue Apr 13, 2011 · 12 comments

Comments

@focal
Copy link

focal commented Apr 13, 2011

Hello folks,

Somebody, please help !
I'm trying to make Ajaxim work under Ubuntu 10 for the last two days without success.
I'm following the guide available at: https://github.com/endtwist/AjaxIM/wiki/Getting-Started

After dealing with openssl + node installation (libssl-dev package is required but not mentioned on that tutorial), I'm still getting error about 'cookieDecoder' method when trying to run Node.js:


root@ubuntu:/tmp/AjaxIM# node server/app.js

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object # has no method 'cookieDecoder'
at Object. (/tmp/AjaxIM/server/app.js:57:13)
at Module._compile (module.js:404:26)
at Object..js (module.js:410:10)
at Module.load (module.js:336:31)
at Function._load (module.js:297:12)
at Array. (module.js:423:10)

at EventEmitter._tickCallback (node.js:126:26)

root@ubuntu:/tmp/AjaxIM# ls -al
total 16
drwxr-xr-x 6 root root 180 2011-04-13 11:59 .
drwxrwxrwt 17 root root 420 2011-04-13 12:39 ..
drwxr-xr-x 2 root root 60 2011-04-13 11:59 build
drwxr-xr-x 4 root root 80 2011-04-13 11:59 client
drwxr-xr-x 8 root root 260 2011-04-13 11:59 .git
-rw-r--r-- 1 root root 136 2011-04-13 11:59 .gitignore
-rw-r--r-- 1 root root 861 2011-04-13 11:59 Makefile
-rw-r--r-- 1 root root 5819 2011-04-13 11:59 README.md
drwxr-xr-x 5 root root 140 2011-04-13 11:59 server

root@ubuntu:/tmp/AjaxIM# ls -al server
total 8
drwxr-xr-x 5 root root 140 2011-04-13 11:59 .
drwxr-xr-x 6 root root 180 2011-04-13 11:59 ..
-rwxr-xr-x 1 root root 3713 2011-04-13 11:59 app.js
drwxr-xr-x 4 root root 100 2011-04-13 11:59 dev
drwxr-xr-x 4 root root 120 2011-04-13 11:59 libs
drwxr-xr-x 3 root root 80 2011-04-13 11:59 middleware
-rw-r--r-- 1 root root 814 2011-04-13 11:59 settings.js

@focal
Copy link
Author

focal commented Apr 13, 2011

Sorry for the mess on the pasted text. I'll try to make it more clear here:

root@ubuntu:/tmp/AjaxIM# node server/app.js

node.js:134

 throw e; // process.nextTick error, or 'error' event on first tick

TypeError: Object # has no method 'cookieDecoder'

at Object.<anonymous> (/tmp/AjaxIM/server/app.js:57:13)

at Module._compile (module.js:404:26)

at Object..js (module.js:410:10)

at Module.load (module.js:336:31)

at Function._load (module.js:297:12)

at Array.<anonymous> (module.js:423:10)

at EventEmitter._tickCallback (node.js:126:26)

@focal
Copy link
Author

focal commented Apr 13, 2011

All right, I found out about 'cookie.Decoder' method issue at:
https://github.com/senchalabs/connect#readme

If someone is getting that same error just search for those methods at SERVER/APP.JS (bodyDecoder, cookieDecoder, staticProvider).

Some methods were renamed and you can read more at:
http://nodenerd.net/post/3847003578/client-side-monitoring

Now I'm getting another error message about some missing module (somebody please, help me on that):

root@ubuntu:/tmp/endtwist-AjaxIM-053795c# node server/app.js

node.js:134

    throw e; // process.nextTick error, or 'error' event on first tick
    ^

Error: Cannot find module 'connect/utils'

at Function._resolveFilename (module.js:320:11)

at Function._load (module.js:266:25)

at require (module.js:348:19)

at Object.<anonymous> (/tmp/endtwist-AjaxIM-053795c/server/dev/app.js:1:75)

at Module._compile (module.js:404:26)

at Object..js (module.js:410:10)

at Module.load (module.js:336:31)

at Function._load (module.js:297:12)

at require (module.js:348:19)

at HTTPServer.<anonymous> (/tmp/endtwist-AjaxIM-053795c/server/app.js:81:36)

@focal
Copy link
Author

focal commented Apr 13, 2011

Hey everybody, finally I manged to fix this last issue. The problem was on a file of Ajaxim under 'server/dev/app.js'
You should change the offending line of that file (the first line) and put the correct location of the file 'utils.js'

On my testing environment it was like this:
var utils = require('/usr/local/lib/node/.npm/connect/1.3.0/package/lib/utils.js');

The original line was:
var utils = require('connect/utils');

After doing this last change, the server was started with 'node server/app.js' and another problem arise with my PHP installation. I am able to open PHP scripts under Apache2 or Litespeed on the same test enviroment, but the script for Ajaxim refuses to run (install.php). The browser keeps popping-up a download window to save the 'install.php' file instead of run the PHP script.

So right now I'll change the environment and use another machine + older Ubuntu version.

I'll post when I get it fix or if another problem arises.

Thanks,

Focal
[email protected]

@focal
Copy link
Author

focal commented Apr 14, 2011

Hi again folks,

Today I have changed my environment and managed to get a working Apache + PHP server.
After taking care of the same issues related here at my past posts I could run everything but Ajaxim still don't work.

By default, when I start the Ajaxim server with 'node server/app.js' a new TCP port 8000 is opened.
The problem is, when I open http://localhost:8000/dev/cookie the following error appears on the web browser:

Express

500 TypeError: Object # has no method 'uid'
at Object. (/root/endtwist-AjaxIM-053795c/server/dev/app.js:12:68)
at param (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/middleware/router.js:148:21)
at pass (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/middleware/router.js:164:10)
at Object.router as handle
at next (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/http.js:204:15)
at Object.logger as handle
at next (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/http.js:204:15)
at Object.session as handle
at next (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/http.js:204:15)
at Object.bodyParser as handle

And on the command line Node.js will dump:

root@univasf-netbook:~/endtwist-AjaxIM-053795c# node server/app.js
Daemon library not found! Please compile ./libs/daemon/daemon.node if you would like to use it.
TypeError: Object # has no method 'uid'
at Object. (/root/endtwist-AjaxIM-053795c/server/dev/app.js:12:68)
at param (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/middleware/router.js:148:21)
at pass (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/middleware/router.js:164:10)
at Object.router as handle
at next (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/http.js:204:15)
at Object.logger as handle
at next (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/http.js:204:15)
at Object.session as handle
at next (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/http.js:204:15)
at Object.bodyParser as handle
127.0.0.1 - - [Thu, 14 Apr 2011 14:35:38 GMT] "GET /dev/cookie HTTP/1.1" 500 - "" "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.63 Safari/534.3"
Error: {"type":"error","error":"not authenticated"}
at Object.session as handle
at next (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/http.js:204:15)
at Object.bodyParser as handle
at next (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/http.js:204:15)
at Object.cookieParser as handle
at next (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/http.js:204:15)
at Object.methodOverride as handle
at next (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/http.js:204:15)
at Object.handle (/usr/local/lib/node/.npm/express/2.2.2/package/lib/http.js:75:5)
at next (/usr/local/lib/node/.npm/connect/1.3.0/package/lib/http.js:204:15)

@focal
Copy link
Author

focal commented Apr 14, 2011

Sorry guys, my fault !

The error about 'uid' method was caused by myself (wrong path to the correct library).
This error will occur if you point to the file 'utils.js' in 'server/libs/utils.js' ('server/dev/app.js').
Sorry about that folks.

You should do as I told here before:
var utils = require('/usr/local/lib/node/.npm/connect/1.3.0/package/lib/utils.js');

Now everything is running and the tests:

http://localhost:8000/dev/cookie
http://localhost:8000/dev/

will confirm everything is all right.

Now I just need to figure out how to use the included development testing app (client) !

@renoproc
Copy link

hi focal,
first thanks for these issues !
Because I'd some troubles to install npm I want to notice this link :
http://web.onassar.com/blog/2010/11/10/installing-npm-node-package-manage-on-ubuntu-10-10/
not forget to send this :
sudo chown -R $USER /usr/local
before the curl http://npmjs.org/install.sh | sh

other point, for my part I have a pb with .npm, this folder is in /home/user_name/ not in '/usr/local/lib/node/
so I've modified server/dev/app.js file like this :
var utils = require('/home/.npm/connect/1.5.1/package/lib/utils.js');
and when I send node server/app.js it return :

Daemon library not found! Please compile ./libs/daemon/daemon.node if you would like to use it.
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object # has no method 'cookieDecoder'
at Object. (/home/reno/ajaxim-latest/server/app.js:57:13)
at Module._compile (module.js:407:26)
at Object..js (module.js:413:10)
at Module.load (module.js:339:31)
at Function._load (module.js:298:12)
at Array. (module.js:426:10)
at EventEmitter._tickCallback (node.js:126:26)

if you have any idea...

@sharjeel
Copy link

sharjeel commented Jul 5, 2011

renoproc, take a look at README of ajaxim to see how to compile daemon: "Compile the daemon add-on if you plan on letting the server daemonize itself: cd server/libs/daemon; node-waf configure build; cp build/default/daemon.node . ; rm -rf build "

@renoproc
Copy link

renoproc commented Jul 5, 2011

thanks a lot I'll try this.

On Tue, Jul 5, 2011 at 7:51 AM, sharjeel <
[email protected]>wrote:

renoproc, take a look at README of ajaxim to see how to compile daemon:
"Compile the daemon add-on if you plan on letting the server daemonize
itself: cd server/libs/daemon; node-waf configure build; cp
build/default/daemon.node . ; rm -rf build "

Reply to this email directly or view it on GitHub:
#49 (comment)

@renoproc
Copy link

renoproc commented Jul 5, 2011

Ok found this readme.md, but not in files I have.
It can be find here :
http://www.cuillan.co.uk/ajaxim/README.md

here is the interesting part :

Installation

Install Node.js:
wget http://nodejs.org/dist/node-v0.2.5.tar.gz
tar xzf node-v0.2.5.tar.gz
cd node-v0.2.5
./configure
make
make install

Install Node Package Manager (npm):
See instructions at http://github.com/isaacs/npm.

Install Express.js and Connect (included automatically):
npm install express

Compile the daemon add-on if you plan on letting the server daemonize itself:
cd server/libs/daemon
node-waf configure build
cp build/default/daemon.node .
rm -rf build

Installation for Development

If you want to test Ajax IM as a standalone app for development, you will need
to install Jade as well.

To install Jade:
npm install jade

Starting up the server

Starting the server in development mode is as simple as:
node server/app.js

To start the server in production mode:
EXPRESS_ENV=production node server/app.js

To start the server as a daemon in production mode:
node server/app.js start production

Testing it out

Once the server is up and running in development mode, you can test it out
through the included development testing app. The below instructions are
assuming that you have left all default configuration options. If not, please
replace the host/port values with the correct ones.

To get started, first initialize a session cookie by going to:
http://localhost:8000/dev/cookie

Then head over to the development page that will initialize the client:
http://localhost:8000/dev/

That's it!

More Information

Node Compatibility

The master branch of Ajax IM is compatible with node --version:
v0.2.5

Contributing

Pull requests are being accepted! If you would like to contribute, simply fork
the project and make your changes.

Style Guide

If you intend on contributing, please follow this style guide when submitting
patches or commits. Submissions that do not follow these guidelines will not
be accepted.

  • Use 4 space indents (not tabs!)
  • No trailing whitespace
  • Blank line at the end of files
  • Semi-colons at the ends of lines, where appropriate
  • Keep lines to 80 characters or less
  • Never bump the version

No whitespace between keys and values:
{foo: 'bar'}
// good

{foo : 'bar'}
// bad

Hash formatting:
{foo: 'bar', baz: 'taz'}
// good

{
    foo: 'bar',
    baz: 'taz',
    moo: 'cow'
}
// good

{ foo: 'bar', baz: 'taz' }
// bad

{foo: 'bar',
 baz: 'taz',
 moo: 'cow'}
// bad

Chained methods:
str
.strip
.replace(...)
.replace(...)
// good

str
.strip
.replace(...)
.replace(...)
// bad

str.
    strip.
    replace(...).
    replace(...)
// bad

Single quotes over double quotes, unless double quotes make sense:
'hello'
// good

"what's up?"
// good

"hello"
// bad

Ternary expressions are fine, but cannot be nested and must be formatted as:
foo = (a ? b : c);
// good

foo = (something.hasAPropertyLikeThis == 'some other value'
           ? 'result one'
           : 'result two'
      );
// good

foo = something.hasAPropertyLikeThis === 'some other value' ?
          'result one' :
          'result two'
// bad

Use braces for conditionals, unless conditionals are single statements:
if(foo) {
bar();
baz();
}
// good

if(foo) bar();
else baz();
// good

if(foo)
    bar(),
    baz()
// bad

Closures:
function() {
}
// good

function () {
}
// bad

function()
{
}
// bad

Methods:
foo.bar = function() {
}
// good

foo.bar = function (){
}
// bad

foo.bar = function()
{
}
// bad

@renoproc
Copy link

renoproc commented Jul 5, 2011

I recompiled the daemon, but error is the same (less the daemon warning) :

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object # has no method 'cookieDecoder'
at Object. (/home/reno/ajaxim-latest/server/app.js:57:13)
at Module._compile (module.js:407:26)
at Object..js (module.js:413:10)
at Module.load (module.js:339:31)
at Function._load (module.js:298:12)
at Array. (module.js:426:10)
at EventEmitter._tickCallback (node.js:126:26)

@sharjeel
Copy link

sharjeel commented Jul 5, 2011

renoproc, Your issue has already been addresses in the same thread. See above; you need to rename some variable (like cookieDecoder to cookieParser). As focal has pointed out, check http://nodenerd.net/post/3847003578/client-side-monitoring

@dannyboo
Copy link

Hey, I have cleared up some off the issues. when I try to run node server/app.js it just returns me to the command line no
listening on ip or domain at port. I have compiled daemon and run as production and nothing, no errors.
as I have made all the edits. When I use hello world example it says listening on 21x.xx.xxx.xx:8000
when I check the ip or domain 21x.xx.xxx.xx:8000 or http://xxxxxxxxxxx.com I get page not found. any ideas?
When I edit "sys" to "net" nothing happens as well.
tested nodejs 6.1 it works
tested AjaxIM in php only it works
also there is nothing from today in error log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants