webuildsg / webuild

:memo: Robot-handpicked list of open events and open source for designers, developers and makers in Singapore
https://webuild.sg/
MIT License
62 stars 33 forks source link

Server crash if update fails. #281

Closed notthetup closed 6 years ago

notthetup commented 7 years ago

After and update if wb.repos get's set to undefined, server crashes.

Info: Retrying github
Info: Retrying github
Info: Retrying github
Success: Added 100 GitHub repos
/var/lib/openshift/588d582189f5cfdcc500017e/app-root/runtime/repo/app.js:87
        repos: wb.repos.feed.repos.slice(0, 10),
                       ^
TypeError: Cannot read property 'feed' of undefined
    at Request._callback (/var/lib/openshift/588d582189f5cfdcc500017e/app-root/runtime/repo/app.js:87:24)
    at Request.self.callback (/var/lib/openshift/588d582189f5cfdcc500017e/app-root/runtime/repo/node_modules/request/request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/var/lib/openshift/588d582189f5cfdcc500017e/app-root/runtime/repo/node_modules/request/request.js:1081:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/var/lib/openshift/588d582189f5cfdcc500017e/app-root/runtime/repo/node_modules/request/request.js:1001:12)
    at Object.onceWrapper (events.js:290:19)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
notthetup commented 7 years ago

Could not reproduce. Upgraded to latest node and errors seem to have gone away for now. Monitoring.

notthetup commented 7 years ago

It's back!

notthetup commented 7 years ago

Looks like an async issue in webuild-repos

Mar 24 06:01:10 <trace> (/app.js:111:12:) Updating the event feed sit tight!
2017-03-23T22:01:10.997Z POST /api/v1/events/update 200 - 29.379 ms
Mar 24 06:01:11 <trace> (/app.js:128:12:) Updating the repos feed sit tight!
2017-03-23T22:01:11.284Z POST /api/v1/repos/update 200 - 1.737 ms

 ############ Returning repos object { feed:
   { meta:
      { generated_at: '2017-03-23T21:04:30.707Z',
        location: 'Singapore',
        total_repos: 100,
        api_version: 'v1',
        max_users: 1000,
        max_repos: 100 },
     repos:
      [ [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object] ] },
  update: [Function: updateRepos],
  day:
   { meta:
      { generated_at: '2017-03-23T21:04:30.707Z',
        location: 'Singapore',
        total_repos: 13 },
     repos:
      [ [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object] ] },
  hour:
   { meta:
      { generated_at: '2017-03-23T21:04:30.707Z',
        location: 'Singapore',
        total_repos: 1 },
     repos: [ [Object] ] },
  get: [Function: get] }

 ############ Inited repos.. { feed:
   { meta:
      { generated_at: '2017-03-23T21:04:30.707Z',
        location: 'Singapore',
        total_repos: 100,
        api_version: 'v1',
        max_users: 1000,
        max_repos: 100 },
     repos:
      [ [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object] ] },
  update: [Function: updateRepos],
  day:
   { meta:
      { generated_at: '2017-03-23T21:04:30.707Z',
        location: 'Singapore',
        total_repos: 13 },
     repos:
      [ [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object] ] },
  hour:
   { meta:
      { generated_at: '2017-03-23T21:04:30.707Z',
        location: 'Singapore',
        total_repos: 1 },
     repos: [ [Object] ] },
  get: [Function: get] }
Info: Updating the repos feed... this may take a while
Mar 24 06:01:11 <info> (/node_modules/webuild-events/events/index.js:171:14:Object.update) Updating the events feed... this may take a while
Info: Loaded 100 repos from cache
Mar 24 06:01:12 <info> (/node_modules/webuild-events/events/facebookEvents.js:167:14:) Found 4 facebook.com authorized users
Mar 24 06:01:12 <info> (/node_modules/webuild-events/events/facebookEvents.js:171:14:) Found 1 facebook.com users with accessible groups
Mar 24 06:01:12 <info> (/node_modules/webuild-events/events/facebookEvents.js:104:16:) Found 62 facebook.com groups
Mar 24 06:01:12 <info> (/node_modules/webuild-events/events/facebookEvents.js:108:16:) Found 23 facebook.com events with venue
Mar 24 06:01:12 <info> (/node_modules/webuild-events/events/index.js:129:14:) Success: Added 23 Facebook events
Mar 24 06:01:12 <info> (/node_modules/webuild-events/events/icsEvents.js:117:18:) Found 31 ics events in total
Mar 24 06:01:12 <info> (/node_modules/webuild-events/events/icsEvents.js:119:18:) Found 0 ics future events in SG with location
Mar 24 06:01:12 <info> (/node_modules/webuild-events/events/index.js:129:14:) Success: Added 0 Ics events
Mar 24 06:01:12 <info> (/node_modules/webuild-events/events/eventbriteEvents.js:168:16:) Found 833 eventbrite.com free events found in Singapore in 17 pages
Mar 24 06:01:12 <info> (/node_modules/webuild-events/events/meetupEvents.js:138:14:) Found  200  meetup.com groups with offset= 0
Mar 24 06:01:13 <info> (/node_modules/webuild-events/events/meetupEvents.js:138:14:) Found  129  meetup.com groups with offset= 1
Mar 24 06:01:13 <trace> (/node_modules/webuild-events/events/meetupEvents.js:44:18:) Remove event https://www.meetup.com/OpenAI-Singapore/events/238556608/ for venue with TBD or online.
Mar 24 06:01:13 <info> (/node_modules/webuild-events/events/meetupEvents.js:124:14:) Info: Found 43 meetup.com group events with venues
Mar 24 06:01:14 <trace> (/node_modules/webuild-events/events/meetupEvents.js:44:18:) Remove event https://www.meetup.com/OSP-SG/events/238503658/ for venue with TBD or online.
Mar 24 06:01:14 <trace> (/node_modules/webuild-events/events/meetupEvents.js:44:18:) Remove event https://www.meetup.com/OSP-SG/events/238503658/ for venue with TBD or online.
Mar 24 06:01:14 <trace> (/node_modules/webuild-events/events/meetupEvents.js:44:18:) Remove event https://www.meetup.com/Apex-Users-Group-Singapore/events/238323812/ for venue with TBD or online.
Mar 24 06:01:14 <trace> (/node_modules/webuild-events/events/meetupEvents.js:44:18:) Remove event https://www.meetup.com/Apex-Users-Group-Singapore/events/238323812/ for venue with TBD or online.
Mar 24 06:01:14 <trace> (/node_modules/webuild-events/events/meetupEvents.js:44:18:) Remove event https://www.meetup.com/Big-Data-Hadoop-Ingest-Transform-Apex-Singapore-Online/events/238323804/ for venue with TBD or online.
Mar 24 06:01:14 <trace> (/node_modules/webuild-events/events/meetupEvents.js:44:18:) Remove event https://www.meetup.com/Big-Data-Hadoop-Ingest-Transform-Apex-Singapore-Online/events/238323804/ for venue with TBD or online.
Mar 24 06:01:14 <info> (/node_modules/webuild-events/events/meetupEvents.js:124:14:) Info: Found 44 meetup.com group events with venues
Info: Duplicate event removed: https://www.facebook.com/events/268708900226726
Info: Duplicate event added: https://www.meetup.com/Singapore-Python-User-Group/events/238107286/
Info: Duplicate event overlaps [41]:open,datum,available,anyone,without,fee,copyright,restriction,usage,one,many,government,started,providing,feed,explore,use,developer,point,show,possibility,limitation,when,dealing,singapore',software,engineer,previously,working,dropbox,currently,tool,startup,singapore.,he',interested,programming,language,productivity,web,development
-----------
Info: Duplicate event removed: https://www.meetup.com/OSP-SG/events/238503556/
Info: Duplicate event added: https://www.meetup.com/Hackware/events/237724094/
Info: Duplicate event overlaps [15]:yet,min,led,light,why,need,- alex,filimonov,mins connecting,iot,thing,electric,imp,ross,brigoli
-----------
Info: Duplicate event removed: https://www.meetup.com/mssgug/events/236349222/
Info: Duplicate event added: https://www.meetup.com/OSP-SG/events/238503616/
Info: Duplicate event overlaps [48]:one,azure,global,bootcamp,is,set,some,record,again,story,globalazure,unique,grand,each,year,hundred,organizer,around,globe,arrange,user,same,day. ,held,window,more,than,location,globe.,topped,then,last,hit,doing,day,deep,dive,class,help,thousand,person,up,speed,developing,cloud,computing,application,azure.
-----------
Mar 24 06:01:14 <info> (/node_modules/webuild-events/events/index.js:129:14:) Success: Added 83 Meetup events
Warn: Github rate limited. Will try again.
Mar 24 06:01:15 <info> (/node_modules/webuild-events/events/eventbriteEvents.js:130:12:filterEvents) Found 37 eventbrite.com tech events
Mar 24 06:01:16 <info> (/node_modules/webuild-events/events/eventbriteEvents.js:138:14:) Found 25 eventbrite.com with valid location
Mar 24 06:01:16 <info> (/node_modules/webuild-events/events/eventbriteEvents.js:141:14:) Found 11 allowed eventbrite.com events
Info: Duplicate event removed: https://www.eventbrite.com.au/e/yow-night-2017-singapore-fred-george-apr-6-tickets-32944458763?aff=ebapi
Info: Duplicate event added: https://www.meetup.com/Agile-Singapore/events/238556438/
Info: Duplicate event overlaps [176]:inhibitor,industry,replete,fresh,devop,cloud,computing,microservice,lean,startup,full­stack,developer,agile,variation,having,seen,this,conference,emerging,theme,around,faster.,faster,old,heard,over,four,decades.,but,business,incentive,is,more,powerful,than,ever,because,competitor,become,unfettered,traditional,barrier,free,application,framework,replace,expensive,vendor,pre­planned,machine,access,customer,through,social,network,dedicated,sale,either,emerge,presentation,identify,three,category,suggest,mitigation,strategy,employed,each,one,whether,dealing,legacy,language,tool,particularly,daunting,shift,process,run,counter,“tried,true”,inherent,organization,shake,off,time­consuming,waterfall,technology,change,sufficient.,going,can,crippled,supporting,implemented.,wrap,up,addressing,impact,role,responsibility,challenging,key,aspect,delve,into,some,detail,implementation,large,presenter,fred,george i,co­founder,outpace,system,ha,been,writing, code,year,hi,count,languages.,he,delivered, and,product,across,career,last,decade,alone,worked,india,china,uk.,started,thoughtwork,university,bangalore, based,commercial,programming,training,program,developed,90’s., early,adopter,oo,continue,leading­, edge,idea,most,recently,advocating,micro­service,architecture,flat,team,structure,under,moniker,programmer,anarchy.,oh,still,write,welcome,networking,followed,yow,night
-----------
Mar 24 06:01:17 <info> (/node_modules/webuild-events/events/index.js:129:14:) Success: Added 10 Eventbrite events
/var/lib/openshift/58ce4fd97628e15b3300008d/app-root/runtime/repo/app.js:87
        repos: wb.repos.feed.repos.slice(0, 10),
                       ^
TypeError: Cannot read property 'feed' of undefined
    at Request._callback (/var/lib/openshift/58ce4fd97628e15b3300008d/app-root/runtime/repo/app.js:87:24)
    at Request.self.callback (/var/lib/openshift/58ce4fd97628e15b3300008d/app-root/runtime/repo/node_modules/request/request.js:188:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:194:7)
    at Request.<anonymous> (/var/lib/openshift/58ce4fd97628e15b3300008d/app-root/runtime/repo/node_modules/request/request.js:1171:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:191:7)
    at IncomingMessage.<anonymous> (/var/lib/openshift/58ce4fd97628e15b3300008d/app-root/runtime/repo/node_modules/request/request.js:1091:12)
    at Object.onceWrapper (events.js:293:19)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:188:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

 ############ Returning repos object { feed: { meta: {}, repos: [] },
  update: [Function: updateRepos],
  day: { meta: {}, repos: [] },
  hour: { meta: {}, repos: [] },
  get: [Function: get] }

 ############ Inited repos.. { feed: { meta: {}, repos: [] },
  update: [Function: updateRepos],
  day: { meta: {}, repos: [] },
  hour: { meta: {}, repos: [] },
  get: [Function: get] }
Mar 24 06:24:26 <info> (/node_modules/webuild-events/events/index.js:171:14:Object.update) Updating the events feed... this may take a while
Info: Updating the repos feed... this may take a while
Mar 24 06:24:26 <trace> (/app.js:302:12:Server.<anonymous>) Express server started at http://127.2.169.1:8080