Closed tescoint closed 8 years ago
Please post the full stack trace of the error, so I can see at least see where it comes from.
2016-06-12T18:44:43.617384+00:00 heroku[web.1]: Starting process with command n pm start
2016-06-12T18:44:46.126493+00:00 app[web.1]:
2016-06-12T18:44:46.126510+00:00 app[web.1]: > binb@1.0.5 start /app
2016-06-12T18:44:46.126516+00:00 app[web.1]: > node app.js
2016-06-12T18:44:46.126517+00:00 app[web.1]:
2016-06-12T18:44:47.607089+00:00 app[web.1]: binb server listening on port 46369
2016-06-12T18:44:47.624081+00:00 app[web.1]: /app/lib/rooms.js:541
2016-06-12T18:44:47.624097+00:00 app[web.1]: room.artist = room.artistName
.toLowerCase();
2016-06-12T18:44:47.624098+00:00 app[web.1]:
^
2016-06-12T18:44:47.624099+00:00 app[web.1]:
2016-06-12T18:44:47.624100+00:00 app[web.1]: TypeError: Cannot read property 'to
LowerCase' of null
2016-06-12T18:44:47.624101+00:00 app[web.1]: at Command.callback (/app/lib/r
ooms.js:541:36)
2016-06-12T18:44:47.624101+00:00 app[web.1]: at RedisClient.return_reply (/a
pp/nodemodules/redis/index.js:664:25)
2016-06-12T18:44:47.624102+00:00 app[web.1]: at JavascriptReplyParser.reply
parser.send_reply (/app/node_modules/redis/index.js:332:14)
2016-06-12T18:44:47.624103+00:00 app[web.1]: at JavascriptReplyParser.run (/
app/node_modules/redis/lib/parsers/javascript.js:132:18)
2016-06-12T18:44:47.624104+00:00 app[web.1]: at JavascriptReplyParser.execut
e (/app/node_modules/redis/lib/parsers/javascript.js:107:10)
2016-06-12T18:44:47.624104+00:00 app[web.1]: at Socket.node ap p.js
2016-06-12T18:44:47.642178+00:00 app[web.1]: npm ERR! Exit status 1
2016-06-12T18:44:47.642355+00:00 app[web.1]: npm ERR!
2016-06-12T18:44:47.642521+00:00 app[web.1]: npm ERR! Failed at the binb@1.0.5 s
tart script 'node app.js'.
2016-06-12T18:44:47.642689+00:00 app[web.1]: npm ERR! This is most likely a prob
lem with the binb package,
2016-06-12T18:44:47.642849+00:00 app[web.1]: npm ERR! not with npm itself.
2016-06-12T18:44:47.642966+00:00 app[web.1]: npm ERR! Tell the author that this
fails on your system:
2016-06-12T18:44:47.643052+00:00 app[web.1]: npm ERR! node app.js
2016-06-12T18:44:47.643148+00:00 app[web.1]: npm ERR! You can get their info via
:
2016-06-12T18:44:47.643229+00:00 app[web.1]: npm ERR! npm owner ls binb
2016-06-12T18:44:47.643332+00:00 app[web.1]: npm ERR! There is likely additional
logging output above.
2016-06-12T18:44:47.645598+00:00 app[web.1]:
2016-06-12T18:44:47.645770+00:00 app[web.1]: npm ERR! Please include the followi
ng file with any support request:
2016-06-12T18:44:47.645846+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-06-12T18:44:48.336529+00:00 heroku[web.1]: Process exited with status 1
2016-06-12T18:44:48.349015+00:00 heroku[web.1]: State changed from starting to c
rashed
2016-06-12T18:44:48.785727+00:00 heroku[api]: Deploy cf0bc7c by tescointsite@gma
il.com
2016-06-12T18:44:48.969142+00:00 heroku[slug-compiler]: Slug compilation started
2016-06-12T18:44:48.969147+00:00 heroku[slug-compiler]: Slug compilation finishe
d
2016-06-12T18:44:48.785812+00:00 heroku[api]: Release v68 created by tescointsit
e@gmail.com
2016-06-12T18:44:49.069762+00:00 heroku[web.1]: State changed from crashed to st
arting
2016-06-12T18:44:51.486502+00:00 heroku[web.1]: Starting process with command n pm start
2016-06-12T18:44:53.745604+00:00 app[web.1]:
2016-06-12T18:44:53.745616+00:00 app[web.1]: > binb@1.0.5 start /app
2016-06-12T18:44:53.745658+00:00 app[web.1]: > node app.js
2016-06-12T18:44:53.745669+00:00 app[web.1]:
2016-06-12T18:44:56.008011+00:00 app[web.1]: binb server listening on port 26647
2016-06-12T18:44:56.033802+00:00 app[web.1]: /app/lib/rooms.js:541
2016-06-12T18:44:56.033812+00:00 app[web.1]: room.artist = room.artistName
.toLowerCase();
2016-06-12T18:44:56.033813+00:00 app[web.1]:
^
2016-06-12T18:44:56.033814+00:00 app[web.1]:
2016-06-12T18:44:56.033814+00:00 app[web.1]: TypeError: Cannot read property 'to
LowerCase' of null
2016-06-12T18:44:56.033815+00:00 app[web.1]: at Command.callback (/app/lib/r
ooms.js:541:36)
2016-06-12T18:44:56.033816+00:00 app[web.1]: at RedisClient.return_reply (/a
pp/nodemodules/redis/index.js:664:25)
2016-06-12T18:44:56.033817+00:00 app[web.1]: at JavascriptReplyParser.reply
parser.send_reply (/app/node_modules/redis/index.js:332:14)
2016-06-12T18:44:56.033818+00:00 app[web.1]: at JavascriptReplyParser.run (/
app/node_modules/redis/lib/parsers/javascript.js:132:18)
2016-06-12T18:44:56.033818+00:00 app[web.1]: at JavascriptReplyParser.execut
e (/app/node_modules/redis/lib/parsers/javascript.js:107:10)
2016-06-12T18:44:56.033819+00:00 app[web.1]: at Socket.node ap p.js
2016-06-12T18:44:56.069742+00:00 app[web.1]: npm ERR! Exit status 1
2016-06-12T18:44:56.070072+00:00 app[web.1]: npm ERR!
2016-06-12T18:44:56.070340+00:00 app[web.1]: npm ERR! Failed at the binb@1.0.5 s
tart script 'node app.js'.
2016-06-12T18:44:56.070587+00:00 app[web.1]: npm ERR! This is most likely a prob
lem with the binb package,
2016-06-12T18:44:56.070803+00:00 app[web.1]: npm ERR! not with npm itself.
2016-06-12T18:44:56.070983+00:00 app[web.1]: npm ERR! Tell the author that this
fails on your system:
2016-06-12T18:44:56.071181+00:00 app[web.1]: npm ERR! node app.js
2016-06-12T18:44:56.071472+00:00 app[web.1]: npm ERR! You can get their info via
:
2016-06-12T18:44:56.071552+00:00 app[web.1]: npm ERR! npm owner ls binb
2016-06-12T18:44:56.071766+00:00 app[web.1]: npm ERR! There is likely additional
logging output above.
2016-06-12T18:44:56.085691+00:00 app[web.1]:
2016-06-12T18:44:56.086057+00:00 app[web.1]: npm ERR! Please include the followi
ng file with any support request:
2016-06-12T18:44:56.086252+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-06-12T18:44:57.064284+00:00 heroku[web.1]: State changed from starting to c
rashed
2016-06-12T18:44:57.021296+00:00 heroku[web.1]: Process exited with status 1
2016-06-12T18:53:05.517720+00:00 heroku[web.1]: State changed from crashed to st
arting
2016-06-12T18:53:08.097383+00:00 heroku[web.1]: Starting process with command n pm start
2016-06-12T18:53:11.438021+00:00 app[web.1]:
2016-06-12T18:53:11.438037+00:00 app[web.1]: > binb@1.0.5 start /app
2016-06-12T18:53:11.438044+00:00 app[web.1]: > node app.js
2016-06-12T18:53:11.438045+00:00 app[web.1]:
2016-06-12T18:53:15.523669+00:00 heroku[web.1]: State changed from starting to u
p
2016-06-12T18:53:15.478867+00:00 app[web.1]: binb server listening on port 46074
2016-06-12T18:53:15.516259+00:00 app[web.1]: /app/lib/rooms.js:541
2016-06-12T18:53:15.516272+00:00 app[web.1]: room.artist = room.artistName
.toLowerCase();
2016-06-12T18:53:15.516273+00:00 app[web.1]:
^
2016-06-12T18:53:15.516274+00:00 app[web.1]:
2016-06-12T18:53:15.516275+00:00 app[web.1]: TypeError: Cannot read property 'to
LowerCase' of null
2016-06-12T18:53:15.516276+00:00 app[web.1]: at Command.callback (/app/lib/r
ooms.js:541:36)
2016-06-12T18:53:15.516277+00:00 app[web.1]: at RedisClient.return_reply (/a
pp/nodemodules/redis/index.js:664:25)
2016-06-12T18:53:15.516278+00:00 app[web.1]: at JavascriptReplyParser.reply
parser.send_reply (/app/node_modules/redis/index.js:332:14)
2016-06-12T18:53:15.516279+00:00 app[web.1]: at JavascriptReplyParser.run (/
app/node_modules/redis/lib/parsers/javascript.js:132:18)
2016-06-12T18:53:15.516280+00:00 app[web.1]: at JavascriptReplyParser.execut
e (/app/node_modules/redis/lib/parsers/javascript.js:107:10)
2016-06-12T18:53:15.516280+00:00 app[web.1]: at Socket.node ap p.js
2016-06-12T18:53:15.557241+00:00 app[web.1]: npm ERR! Exit status 1
2016-06-12T18:53:15.557439+00:00 app[web.1]: npm ERR!
2016-06-12T18:53:15.557619+00:00 app[web.1]: npm ERR! Failed at the binb@1.0.5 s
tart script 'node app.js'.
2016-06-12T18:53:15.557837+00:00 app[web.1]: npm ERR! This is most likely a prob
lem with the binb package,
2016-06-12T18:53:15.558035+00:00 app[web.1]: npm ERR! not with npm itself.
2016-06-12T18:53:15.558247+00:00 app[web.1]: npm ERR! Tell the author that this
fails on your system:
2016-06-12T18:53:15.559371+00:00 app[web.1]: npm ERR! node app.js
2016-06-12T18:53:15.559571+00:00 app[web.1]: npm ERR! You can get their info via
:
2016-06-12T18:53:15.559767+00:00 app[web.1]: npm ERR! npm owner ls binb
2016-06-12T18:53:15.559970+00:00 app[web.1]: npm ERR! There is likely additional
logging output above.
2016-06-12T18:53:15.565633+00:00 app[web.1]:
2016-06-12T18:53:15.565942+00:00 app[web.1]: npm ERR! Please include the followi
ng file with any support request:
2016-06-12T18:53:15.566133+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-06-12T18:53:16.768040+00:00 heroku[web.1]: Process exited with status 1
2016-06-12T18:53:16.785283+00:00 heroku[web.1]: State changed from up to crashed
This means that songs have not been loaded correctly in the db. Not sure what you changed in the load script.
This is the artist ids am using to upload 'use strict';
/**
module.exports = { pop: [ 119258059 //2Face , 274725761 //9ice , 481383337 // Yemi Alade , 973451696 // Adekunle Gold , 26089928 // Asa , 260802864 //Cobhams Asuquo , 158227126 //Banky W , 833611554 //Korede Bello , 419956872 //Brymo , 586786082 //Chidinma , 119240106 //Dbanj , 321873755 //D'Prince , 119240102 //Don Jazzy , 526258226 //Dr Sid , 287712491 //Di'ja , 412032998 //Amarachi , 463183936 //Emma Nyra , 101911760 //Eedris Abdulkareem , 65327058 //Faze , 520417106 //HarrySong , 360504820 //Iyanya , 194605362 //Kcee , 855238148 //Lil Kesh , 480217968 //Mo Cheddah , 901988673 //Genevieve , 932978337 //Monica Ogah , 511284693 //Omawumi , 586848979 //Omotola Jolade , 176621657 //Onyeka Onwenu , 828415607 //Reekado Banks , 309335750 //WhizKid , 418011557 //Waconzy , 324225716 //Tiwa Savage , 321187699 //May7ven , 504190300 //Mr 2kay , 128880985 //Praiz , 531364876 //Runtown , 436265893 //Seyi Shay , 306347382 //Waje // , 262836961 // ADELE // , 459885 // Avril Lavigne // , 1419227 // Beyoncé // , 217005 // Britney Spears // , 64387566 // Katy Perry // , 277293880 // Lady GaGa // , 184932871 // MIKA ], rap: [ 517329823 //Eva Alordiah , 260136055 //African Boy , 334602885 //Dagrin , 206540188 //Da'Emperor , 192557881 //elDee , 360389344 //Falz , 309335658 //Ice Prince , 385350270 //Jesse jags , 924250671 //M.I. , 26592985 //M Trill , 283943489 //Mode 9 , 1042111883 //Muna , 514017875 //Phyno , 1855044 //Weird Mc , 843234442 //CDQ , 934321806 //Chinko Ekun , 508405356 //Yung6ix , 992144443 //YCEE , 419957057 //Skales , 389401008 //Olamide , 111796431 //RuggedMan // 1587965 // A Tribe Called Quest // , 1971863 // Beastie Boys // , 465802 // Cypress Hill // , 384304 // EPMD // , 289550 // OutKast // , 13503763 // Swollen Members // , 43680 // The Roots
],
reggae: [ 77973263 //Black Face , 591899010 //Burna Boy , 319054999 //Duncan Mighty , 14749297 //Dr. Alban , 355856842 //Orezi , 772255131 //patoranking , 282132704 // Timaya , 27764109 //Majek Fashek , 337910718 //Sonny Okosuns , 669332055 // Sean Tizzle , 128617624 //Sound Sultan , 792968862 //Tekno Miles , 103082000 //Tony Tetuila , 26948805 //Eddy Wata
],
oldies: [ 271400130 //Ayinde Bakare , 602606704 //Alhaji Dauda Epo-Akara , 598065737 // Alhaji Alamu Atatalo , 128877660 //Adewale Ayuba , 377085580 //Dele Ojo , 251263103 //Yinka Davies , 79359975 //Haruna Ishola , 270610340 // Peter King , 301680872 // Tunde King , 549022675 // Ayinla Kollington , 55088 //Fela Kuti , 399130 //Femi Kuti , 256287083 //SEun Kuti , 7021236 //Lagbaja , 517178421 //Obesere , 377026818 //Ebenezer Obey , 941431 //Sade Adu , 215589978 //Sina Peters , 531155154 //Salawa beni , 77539 //Sunny Ade , 476683 //Babatunde Olatunji , 634816976 //I.K. Dairo , 472350094 //oliver De Coque , 195150668 //Fela Sowande , 2475847 //Prince Nico , 314253227 //Yusuf Olatunji , 6667947 //William Onyeabor , 470978385 //Orlando owoh , 66506700 //REex Lawson , 589313020 //Tunde Nightingale , 79359590 //Sir Victor Uwaifo
]
// gospel:[ // 253975953 //Tope Alabi // , 172278322 //Tony Allen // , 469277518 // Yinka Ayefele // , 304569528 //Ty Bello // , 5401553 //Frank Edwards // , 376113241 //Nosa // , 346407731 //Obiwon // , 176614584 //Victor Olaiya // , 909258651 // patience Ozokwor // , 325036607 //Samsong // , 909258648 //Stella Damasus // , 128623973 //Niyola // , 6249833 //Nneka // , 519026522 //Sinach // , 251836467 //Tolumide
// ]
};
This is the load_sample_track `'use strict';
/**
var artistIds = require('./artist-ids')
, http = require('http')
, JSONStream = require('JSONStream')
, limit = 15 // The number of songs to retrieve for each artist
, parser = JSONStream.parse(['results', true])
, popIds = artistIds.pop
, rapIds = artistIds.rap
, rc = redis.createClient(redisURL.port, redisURL.hostname, {no_ready_check: true})
, reggaeIds = artistIds.reggae
, oldiesIds = artistIds.oldies
, rooms = require('../config').rooms
, score
, skip = 0 // Skip counter
, songId = 0;
rc.auth(redisURL.auth.split(":")[1]);
var options = {
headers: {'content-type': 'application/json'},
host: 'itunes.apple.com',
// Look up multiple artists by their IDs and get limit
songs for each one
path: '/lookup?id='+popIds.concat(rapIds, reggaeIds, oldiesIds).join()+'&entity=song&limit='+limit,
port: 80
};
/**
var updateRooms = function(artistId) { rooms = ['mixed']; score = 0; if (artistId === popIds[0]) { rooms.push('hits', 'pop'); // Set the skip counter (there is no need to update the rooms for the next pop artists) skip = popIds.length - 1; }else if (artistId === rapIds[0]) { rooms.push('rap'); skip = rapIds.length - 1; }else if (artistId === reggaeIds[0]){ rooms.push('reggae'); skip = reggaeIds.length - 1; }else if (artistId === oldiesIds[0]) { rooms.push('oldies'); skip = oldiesIds.length - 1; } // else if (artistId === gospelIds[0]){ // rooms.push('gospel'); // skip = gospelIds.length - 1; // } };
parser.on('data', function(track) { if (track.wrapperType === 'artist') { if (skip) { skip--; return; } updateRooms(track.artistId); return; }
rc.hmset('song:'+songId, 'artistName', track.artistName, 'trackName', track.trackName, 'trackViewUrl', track.trackViewUrl, 'previewUrl', track.previewUrl, 'artworkUrl60', track.artworkUrl60, 'artworkUrl100', track.artworkUrl100 );
rooms.forEach(function(room) { var _score = (room === 'mixed') ? songId : score; rc.zadd(room, _score, songId); });
score++; songId++; });
parser.on('end', function() { rc.quit(); process.stdout.write('OK\n'); });
rc.del(rooms, function(err) { if (err) { throw err; } process.stdout.write('Loading sample tracks... '); http.get(options, function(res) { res.pipe(parser); }); }); `
And finally the config.json { "gameswithnorepeats": 3, "port": 8138, "rooms": [ "hits", "pop", "rap", "oldies", "mixed", "reggae" ], "songsinarun": 15 }
So basically I just removed rock among the categories and included reggae
And Finally On Heroku am not allowed to use more than one db so I changed `'use strict';
/**
var redis = require('redis'); var url = require('url');
/**
var usersclient = redis.createClient(redisURL.port, redisURL.hostname, {no_ready_check: true}); usersclient.auth(redisURL.auth.split(":")[1]);
// var songsclient = redis.createClient(process.env.REDISCLOUD_URL, {no_ready_check: true}) // , usersclient = redis.createClient(process.env.REDISCLOUD_URL, {no_ready_check: true});
songsclient.on('error', function(err) { console.error(err.message); });
usersclient.on('error', function(err) { console.error(err.message); });
usersclient.select(0);
/**
exports.songs = songsclient; exports.users = usersclient; ` I changed usersclient.select(1); to usersclient.select(0);
Sorry I can't help you with this. Anyway it's not a bug in binb. Try to understand how the load script works and go on from there. Also keep in mind that the script is only there to let you understand how the db is structured.
Ok, Thanks Very much. But one last question, the load script does not have limit to the number of songs it can load to the database right?
No, there shouldn't be limits. Try to make the same request made by the script in Postman or cURL or whatever and see if the returned JSON data gives you any clue.
Hello Thanks For Your help. When I try to access the script on my tablet, it gives me Websocket is closed before the connection is established. But it works well on pc. What could be wrong?
The error you are receiving can't be produced by the load script as it doesn't use WebSocket.
yeah the load script is working now, but am getting the websocket error
I don't know. Your code may close the connection before it is established. See http://stackoverflow.com/questions/12487828/what-does-websocket-is-closed-before-the-connection-is-established-mean/12503628#12503628.
I don't even know whats wrong again, It was working on pc before but now it ain't working it keeps telling me Firefox can't establish a connection to the server at ws://jembe.herokuapp.com/primus/?_primuscb=LL9UlVs
By the way where are you hosting binb.co
Sorry man this isn't a support channel :/ binb is now hosted on a VPS. It was previously hosted on Nodejitsu.
This happens when I load more artist id into the artistids file