New taiga installation on AWS, websocket connection failed

1,470 views
Skip to first unread message

David Ing

unread,
May 16, 2016, 11:52:44 PM5/16/16
to taigaio
I've been following the instructions to Setup production environment at http://taigaio.github.io/taiga-doc/dist/setup-production.html on AWS.

When I point the browser to http://projects.MYDOMAIN.com, it gets shunted to http://projects.MYDOMAIN.com/error, with the message TAIGA Something happened and our Oompa Loompas are working on it.

Looking the console in Chrome, I see:

angular.js:12477Initialize navigation urls
angular.js:12477Initialize api urls
angular.js:12477Using the default logging exception handler.
angular.js:12477Initialize resources
angular.js:12477Initialize application
angular.js:12477Analytics: no acount id provided. Disabling.

app.js:1873WebSocket connection to 'ws://projects.MYDOMAIN.com/events' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED

angular.js:12477WebSocket error: [object Event](anonymous function) @ angular.js:12477t.onError @ app.js:2661r @ lodash.js:3971
angular.js:12477WebSocket closed.

angular.js:10722OPTIONS http://projects.MYDOMAIN.com:8000/api/v1/stats/discover net::ERR_NAME_NOT_RESOLVED(anonymous function) @ angular.js:10722g @ angular.js:10515c @ angular.js:10222u @ angular.js:14745(anonymous function) @ angular.js:14761p.$eval @ angular.js:15989p.$digest @ angular.js:15800p.$apply @ angular.js:16097(anonymous function) @ angular.js:16392i @ angular.js:5507(anonymous function) @ angular.js:5784

angular.js:10722OPTIONS http://projects.MYDOMAIN.com:8000/api/v1/projects?discover_mode=true&order_by=-total_fans_last_week net::ERR_NAME_NOT_RESOLVED(anonymous function) @ angular.js:10722g @ angular.js:10515c @ angular.js:10222u @ angular.js:14745(anonymous function) @ angular.js:14761p.$eval @ angular.js:15989p.$digest @ angular.js:15800p.$apply @ angular.js:16097(anonymous function) @ angular.js:16392i @ angular.js:5507(anonymous function) @ angular.js:5784

angular.js:10722OPTIONS http://projects.MYDOMAIN.com:8000/api/v1/projects?discover_mode=true&order_by=-total_activity_last_week net::ERR_NAME_NOT_RESOLVED(anonymous function) @ angular.js:10722g @ angular.js:10515c @ angular.js:10222u @ angular.js:14745(anonymous function) @ angular.js:14761p.$eval @ angular.js:15989p.$digest @ angular.js:15800p.$apply @ angular.js:16097(anonymous function) @ angular.js:16392i @ angular.js:5507(anonymous function) @ angular.js:5784

angular.js:10722OPTIONS http://projects.MYDOMAIN.com:8000/api/v1/projects?discover_mode=true&is_featured=true net::ERR_NAME_NOT_RESOLVED

Could someone please suggest to me what I may have done wrong, or how I would continue diagnosis?  Thanks.

David Ing

unread,
May 17, 2016, 11:57:07 PM5/17/16
to taigaio
I've been looking at the "Running taiga on Ubuntu+Apache" at https://groups.google.com/forum/#!topic/taigaio/CwCfLZ4WAB4 , with similar issues, except that I'm running nginx.

For ~/taiga-front-dist/dist/conf.json ,

{
    "eventsUrl": "ws://projects.MYDOMAIN.com/events",
    "debug": "true",
    "publicRegisterEnabled": true,
    "feedbackEnabled": true,
    "privacyPolicyUrl": null,
    "termsOfServiceUrl": null,
    "maxUploadFileSize": null,
    "contribPlugins": []
}

Is this an issue with ports?

David Ing

unread,
May 18, 2016, 12:17:38 AM5/18/16
to taigaio
In addition, following "Oompa Loompas are sad and WebSocket 502" at https://groups.google.com/forum/#!topic/taigaio/IU3CvH9O_B0 , in the taiga-events directory,I tried the coffee index.coffee command, to give:

$ coffee index.coffee
Error: Cannot find module 'base64-url'
  at Function.Module._resolveFilename (module.js:338:15)
  at Function.Module._load (module.js:280:25)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/taiga/taiga-events/signing.coffee:2:13)
  at Object.<anonymous> (/home/taiga/taiga-events/signing.coffee:1:1)
  at Module._compile (module.js:456:26)
  at Object.loadFile (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/register.js:16:19)
  at Module.load (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/taiga/taiga-events/client.coffee:2:11)
  at Object.<anonymous> (/home/taiga/taiga-events/client.coffee:1:1)
  at Module._compile (module.js:456:26)
  at Object.loadFile (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/register.js:16:19)
  at Module.load (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/taiga/taiga-events/index.coffee:2:10)
  at Object.<anonymous> (/home/taiga/taiga-events/index.coffee:1:1)
  at Module._compile (module.js:456:26)

I presume that this isn't the expect response.


On Monday, 16 May 2016 23:52:44 UTC-4, David Ing wrote:

David Barragán

unread,
May 22, 2016, 4:28:59 AM5/22/16
to David Ing, taigaio
Taiga don't need taiga-event to run (Taiga event is useful to keep updated the kanban with no need to refresh the page manually). So the first error


app.js:1873WebSocket connection to 'ws://projects.
MYDOMAIN.com/events' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED

angular.js:12477WebSocket error: [object Event](anonymous function) @ angular.js:12477t.onError @ app.js:2661r @ lodash.js:3971
angular.js:12477WebSocket closed.

Say that taiga-events is not running.

This one: net::ERR_NAME_NOT_RESOLVED

angular.js:10722OPTIONS http://projects.MYDOMAIN.com:8000/api/v1/projects?discover_mode=true&order_by=-total_fans_last_week net::ERR_NAME_NOT_RESOLVED(anonymous function) @ angular.js:10722g @ angular.js:10515c @ angular.js:10222u @ angular.js:14745(anonymous function) @ angular.js:14761p.$eval @ angular.js:15989p.$digest @ angular.js:15800p.$apply @ angular.js:16097(anonymous function) @ angular.js:16392i @ angular.js:5507(anonymous function) @ angular.js:5784

is because your browser can resolve the url http://projects.MYDOMAIN.com:8000/api/v1/projects?discover_mode=true&order_by=-total_fans_last_week

So it seems that the API is not accesible.

Can you see http://projects.MYDOMAIN.com:8000/api/v1/projects/?
Why you have  "api": "http://projects.MYDOMAIN.com/api/v1/",    in your conf.json but your taig-front is triying to acces to another url?

I think your problem is in your apache configuration.

Regards


--
Please help us keep the Taiga.io Community open and inclusive, follow our Code of Conduct:
https://github.com/taigaio/code-of-conduct/blob/master/CODE_OF_CONDUCT.md
---
You received this message because you are subscribed to the Google Groups "taigaio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to taigaio+u...@googlegroups.com.
To post to this group, send email to tai...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/taigaio/2280b6e1-f938-4d9d-ba0e-8c23277fe013%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

---

 
David Barragán Merino  
Engineer

www.kaleidos.net/FFF8E7

David Ing

unread,
May 22, 2016, 11:07:19 AM5/22/16
to taigaio, coevo...@gmail.com
@David Barragán, thanks for the response.

Yes, thanks.  That's progress.  Actually, the web site responds on port 80 to http://projects.MYDOMAIN.com/api/v1/projects?discover_mode=true&order_by=-total_fans_last_week 
No, http://projects.MYDOMAIN.com/api/v1/projects/ returns "The requested URL /api/v1/projects/ was not found on this server.".  And http://projects.MYDOMAIN.com:8000/api/v1/projects/ returns "This site can’t be reached. projects.MYDOMAIN.com refused to connect"

> I think your problem is in your apache configuration.

Actually, I followed the instruction at https://taigaio.github.io/taiga-doc/dist/setup-production.html , so it's nginx.  

First, I wanted to make sure that the softlink is in place.

/etc/nginx$ find . -type l -ls
132694    0 lrwxrwxrwx   1 root     root           32 May 16 01:52 ./sites-enabled/taiga -> /etc/nginx/sites-available/taiga

Secondly, I have ensured that the default nginx site has been disabled.  

/etc/nginx/sites-enabled$ ls
taiga

I note that the default is still available (but not enabled):

/etc/nginx/sites-available$ ls
default  taiga

Here's the contents of /etc/nginx/sites-available/taiga:

server {
    listen 80 default_server;
    server_name _;

    large_client_header_buffers 4 32k;
    client_max_body_size 50M;
    charset utf-8;

    access_log /home/taiga/logs/nginx.access.log;
    error_log /home/taiga/logs/nginx.error.log;

    # Frontend
    location / {
        root /home/taiga/taiga-front-dist/dist/;
        try_files $uri $uri/ /index.html;
    }

    # Backend
    location /api {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8001/api;
        proxy_redirect off;
    }

    # Django admin access (/admin/)
    location /admin {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8001$request_uri;
        proxy_redirect off;
    }

    # Static files
    location /static {
        alias /home/taiga/taiga-back/static;
    }

    # Media files
    location /media {
        alias /home/taiga/taiga-back/media;
    }

    location /events {
       proxy_pass http://127.0.0.1:8888/events;
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       proxy_connect_timeout 7d;
       proxy_send_timeout 7d;
       proxy_read_timeout 7d;
    }
}

So, do I have a confusion between ports?  I'm running this Taiga installation on AWS, and can open and close ports as necessarily.  On the MYDOMAIN.com , I've created a DNS Record that points projects.MYDOMAIN.com to the IP address on AWS.

(1) Should I be running on port 8000 on AWS, or is port 80 okay?  

(2) If I have to run on port 8000 on AWS, can I point from projects.MYDOMAIN.com:80 to the AWS instances running on port 8000, so that I don't have to tell users to specify the port?

I'm not very experienced with running on AWS, yet.

> Say that taiga-events is not running.

Thanks for that.  I'll worry about that after I get the rest of the site working!

David Barragán

unread,
May 22, 2016, 11:30:18 AM5/22/16
to David Ing, taigaio
On Sun, May 22, 2016 at 5:07 PM, David Ing <coevo...@gmail.com> wrote:
@David Barragán, thanks for the response.

> your browser can resolve the url http://projects.MYDOMAIN.com:8000/api/v1/projects?discover_mode=true&order_by=-total_fans_last_week

Yes, thanks.  That's progress.  Actually, the web site responds on port 80 to http://projects.MYDOMAIN.com/api/v1/projects?discover_mode=true&order_by=-total_fans_last_week 


No, http://projects.MYDOMAIN.com/api/v1/projects/ returns "The requested URL /api/v1/projects/ was not found on this server.".  And http://projects.MYDOMAIN.com:8000/api/v1/projects/ returns "This site can’t be reached. projects.MYDOMAIN.com refused to connect"


If http://projects.MYDOMAIN.com:8000/api/v1/projects/ doesn't work and http://projects.MYDOMAIN.com/api/v1/projects/ works you have to change in conf.json the apiUrl to http://projects.MYDOMAIN.com/api/v1/ instead of http://projects.MYDOMAIN.com:8000/api/v1/

 

For more options, visit https://groups.google.com/d/optout.

David Ing

unread,
May 22, 2016, 12:29:58 PM5/22/16
to taigaio, coevo...@gmail.com
@David Barragán, 

> If http://projects.MYDOMAIN.com:8000/api/v1/projects/ doesn't work and http://projects.MYDOMAIN.com/api/v1/projects/ works you have to change in conf.json the apiUrl to http://projects.MYDOMAIN.com/api/v1/ instead of http://projects.MYDOMAIN.com:8000/api/v1/

I think that conf.json is already configured that way.

{
    "eventsUrl": "ws://projects.MYDOMAIN.com/events",
    "debug": "true",
    "publicRegisterEnabled": true,
    "feedbackEnabled": true,
    "privacyPolicyUrl": null,
    "termsOfServiceUrl": null,
    "maxUploadFileSize": null,
    "contribPlugins": []
}


HTTP 200 OK
x-paginated: true
Content-Type: application/json
x-paginated-by: 30
Vary: Accept
x-pagination-current: 1
Allow: GET, POST, HEAD, OPTIONS
x-pagination-count: 2
...

I get a similar response from http://projects.MYDOMAIN.com/api/v1/projects .

However from http://projects.MYDOMAIN.com/ , I'm still diverted to http://projects.MYDOMAIN.com/error.  The console says:

angular.js:12477 Initialize navigation urls
angular.js:12477 Initialize api urls
angular.js:12477 Using the default logging exception handler.
angular.js:12477Initialize resources
angular.js:12477Initialize application
angular.js:12477Analytics: no acount id provided. Disabling.
app.js:1873 WebSocket connection to 'ws://projects.MYDOMAIN.com/events' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED
angular.js:12477WebSocket error: [object Event](anonymous function) @ angular.js:12477
angular.js:12477WebSocket closed.
http://projects.MYDOMAIN.com/api/v1/stats/discover Failed to load resource: net::ERR_NAME_NOT_RESOLVED

While http://projects.MYDOMAIN.com/api/v1/projects is accessible, http://projects.MYDOMAIN.com/api/v1/stats returns "Not Found. The requested URL /api/v1/stats was not found on this server."

Does this mean that http is okay, but the websockets aren't working?  (That's more technical than I usually do).

David Barragán

unread,
May 22, 2016, 12:46:03 PM5/22/16
to David Ing, taigaio
On Sun, May 22, 2016 at 6:29 PM, David Ing <coevo...@gmail.com> wrote:
@David Barragán, 

> If http://projects.MYDOMAIN.com:8000/api/v1/projects/ doesn't work and http://projects.MYDOMAIN.com/api/v1/projects/ works you have to change in conf.json the apiUrl to http://projects.MYDOMAIN.com/api/v1/ instead of http://projects.MYDOMAIN.com:8000/api/v1/

I think that conf.json is already configured that way.

{
    "eventsUrl": "ws://projects.MYDOMAIN.com/events",
    "debug": "true",
    "publicRegisterEnabled": true,
    "feedbackEnabled": true,
    "privacyPolicyUrl": null,
    "termsOfServiceUrl": null,
    "maxUploadFileSize": null,
    "contribPlugins": []
}


HTTP 200 OK
x-paginated: true
Content-Type: application/json
x-paginated-by: 30
Vary: Accept
x-pagination-current: 1
Allow: GET, POST, HEAD, OPTIONS
x-pagination-count: 2
...


So the configuration is fine.
 
I get a similar response from http://projects.MYDOMAIN.com/api/v1/projects .

However from http://projects.MYDOMAIN.com/ , I'm still diverted to http://projects.MYDOMAIN.com/error.  The console says:

angular.js:12477 Initialize navigation urls
angular.js:12477 Initialize api urls
angular.js:12477 Using the default logging exception handler.
angular.js:12477Initialize resources
angular.js:12477Initialize application
angular.js:12477Analytics: no acount id provided. Disabling.
app.js:1873 WebSocket connection to 'ws://projects.MYDOMAIN.com/events' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED
angular.js:12477WebSocket error: [object Event](anonymous function) @ angular.js:12477
angular.js:12477WebSocket closed.
http://projects.MYDOMAIN.com/api/v1/stats/discover Failed to load resource: net::ERR_NAME_NOT_RESOLVED

While http://projects.MYDOMAIN.com/api/v1/projects is accessible, http://projects.MYDOMAIN.com/api/v1/stats returns "Not Found. The requested URL /api/v1/stats was not found on this server."

Does this mean that http is okay, but the websockets aren't working?  (That's more technical than I usually do).


/stats/ and /discover/stats/ is not the same, the first doen't exist. 

Websocket error is not the cause, websocket fail because taiga-events is not running but as I said before is not necessary. The error is in 

http://projects.MYDOMAIN.com/api/v1/stats/discover Failed to load resource: net::ERR_NAME_NOT_RESOLVED

Have you try with other browsers and in incognito mode?
 

For more options, visit https://groups.google.com/d/optout.

David Ing

unread,
May 22, 2016, 5:47:44 PM5/22/16
to taigaio, coevo...@gmail.com
@David Barragán,

> /stats/ and /discover/stats/ is not the same, the first doen't exist. 


HTTP 200 OK
Content-Type: application/json
Allow: GET, HEAD, OPTIONS
Vary: Accept

{
    "projects": {
        "total": 2
    }
}

> Have you try with other browsers and in incognito mode?

Yes.  The browser I normally use is Chrome.  In Firefox, http://projects.MYDOMAIN.com redirects to http://projects.MYDOMAIN.com/error with the console messages:

"Handler function NRL_getSecurityInfo threw an exception: TypeError: this.transport is null
Stack: DSC_send@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/main.js:1391:5
NEA_addSecurityInfo@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/webconsole.js:2064:5
NRL_getSecurityInfo@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/webconsole/network-monitor.js:265:5
exports.makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:101:14
NRL_onStartRequest@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/webconsole/network-monitor.js:217:5
Line: 1391, column: 5" ThreadSafeDevToolsUtils.js:80
TypeError: this.transport is null main.js:1391:5
Initialize navigation urls libs.js:9:29685
Initialize api urls libs.js:9:29685
Using the default logging exception handler. libs.js:9:29685
Initialize resources libs.js:9:29685
Initialize application libs.js:9:29685
Analytics: no acount id provided. Disabling. libs.js:9:29685
Firefox can't establish a connection to the server at ws://projects.webverse.com/events. app.js:2:10778
WebSocket error: [object Event] libs.js:9:29685

WebSocket closed.

Any other suggestions for diagnosis?

David Barragán

unread,
May 22, 2016, 6:12:28 PM5/22/16
to David Ing, taigaio
umm no, it have no sense why you can access to http://projects.MYDOMAIN.com/api/v1/stats/discover with your browser but taiga-front client can't with your browser too. Maybe is something related to your DNS configuration... I don't know.


For more options, visit https://groups.google.com/d/optout.

David Ing

unread,
May 22, 2016, 9:41:47 PM5/22/16
to taigaio, coevo...@gmail.com
@David Barragán ,

Thanks for your expertise, and advice.

Since you say that it's related to the DNS configuration, I edited conf.json, to hard code the IP address, i.e. 

{
    "eventsUrl": "ws://NN.23.184.61/events",
     ...

... and then tried the IP address directly in the browser.  Voila, the front page of http://NN.23.184.61/discover appears!

Are we missing something?  I did a search on "taiga aws dns" and found "Deployment on AWS #22" at https://github.com/ipedrazas/taiga-docker/issues/22 .

ipedrazas commented on 5 Nov 2015

I think the login is for a different reason but the main problem now is that we're updating the containers to Taiga 1.9 and there are some issues to be fixed :)

To use it in AWS or any other place really, you will need to define the DNS for the API host. In the docs this export API_NAME=boot2docker tells the frontend how to resolve the backend.

I guess that in your case the first thing would be to create a DNS entry for that machine, for example:


And then to add export API_NAME=taiga.mydomain.com

Does it make sense?


Where do I find the setting for API_NAME (or is that something specific to Docker)?

David Barragán

unread,
May 23, 2016, 3:59:53 AM5/23/16
to David Ing, taigaio
Is about taiga-docker?


For more options, visit https://groups.google.com/d/optout.

David Ing

unread,
May 23, 2016, 8:37:51 PM5/23/16
to taigaio, coevo...@gmail.com
I've worked things out.

On AWS, I now use Elastic IPs to set a static IP address.  This is now hard-coded into conf.json.  On my web provider (site5), I've used the Simple DNS zone so that people don't have to remember the IP numbers.

David Barragán

unread,
May 24, 2016, 3:40:14 AM5/24/16
to David Ing, taigaio
Ok, and now it's working?


For more options, visit https://groups.google.com/d/optout.

David Ing

unread,
May 26, 2016, 4:59:45 PM5/26/16
to taigaio, coevo...@gmail.com
Yes, now it's working.  Thanks.

The clue is that if there are problems like this, using the (number) IP address will resolve DNS issues.
Reply all
Reply to author
Forward
0 new messages