CityWebConsultants / Iris

Modular content management and web application framework built with Node.js and MongoDB
http://irisjs.org
Other
9 stars 7 forks source link

Invalid AuthPass error causing the site to freak out and succeeding api call no longer work until you restart from fresh install #283

Closed facascante closed 7 years ago

facascante commented 8 years ago

Step to replicate

  1. install travis-cli , https://github.com/travis-ci/travis.rb#installation
  2. login to travis(if no account, link your github to travis-ci and use github login), $> travis login
  3. generate token $> travis token
  4. obtain a job id from a previous failed build on your clone repo or in main repo if you admin access e.g. https://travis-ci.org/CityWebConsultants/Iris/builds/135049762
  5. using 135049762 build id go to https://api.travis-ci.org/builds/135049762 and get job_id "matrix":[{"id":135049764, ...
  6. use the generated token and job_id to have a docker instance in travis-ci e.g.
#! /usr/bin/env bash

curl -s -X POST \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Travis-API-Version: 3" \
  -H "Authorization: token <TOKEN>" \
  https://api.travis-ci.org/job/<JOB_ID>/debug
  1. Head back to the web UI(https://travis-ci.org/CityWebConsultants/Iris/builds/135049762) and in the log of your job. you should see the following lines to connect to the VM:
Setting up debug tools.
Preparing debug sessions.
Use the following SSH command to access the interactive debugging environment:
ssh ukjiuCEkxBBnRAe32Y8xCH0zj@ny2.tmate.io
  1. connect to it via ssh, manually install the iris site and test using the following command
  - npm install -g grunt-cli jasmine-node pm2
  - git clone https://github.com/CityWebConsultants/iris-project-template.git
  - cd iris-project-template
  - mongoimport --db mysite --collection users --file fixtures/users.json
  - mongoimport --db mysite --collection pages --file fixtures/pages.json
  - npm install  --save git+https://github.com/$TRAVIS_REPO_SLUG.git#$TRAVIS_BRANCH
  - npm install --only=dev
  - pm2 start index.js
  - npm test
  - pm2 logs
  1. check the logs and you will see
index-0 (out): Starting iris...
index-0 (out): Ready on port 4000.
index-0 (out): invalid authPass 
  1. run again the test
- npm test

and you notice all the entity api from jasmine-node no longer working

if you check the pm2 logs once more you'll see it all "can't accept header already sent"

facascante commented 8 years ago

temporary investigation, result that it might be a concurrency issue, that ui and api when parallel executed, might be polluting some global variable, which is subject for further investigation

facascante commented 8 years ago

already fixed together #284