mozilla / openbadges-badgekit

No Longer Maintained
https://badgekit.org
Mozilla Public License 2.0
124 stars 84 forks source link

Install Issues #456

Open gazzastone opened 10 years ago

gazzastone commented 10 years ago

I have successfully installed the badgegit-api however on starting openbadges-badgekit I get the following error

10:49:12 web.1 | started with pid 6600 10:49:13 web.1 | 10:49:13 web.1 | undefined:19 10:49:13 web.1 | return "navigator.id.watch({ 10:49:13 web.1 | \n loggedInUser: " + obj.loggedInUser + ", 10:49:13 web.1 | \n 10:49:13 web.1 | ^^^^^^^^^^^^^^^^^^^^^ 10:49:13 web.1 | exited with code 8 10:49:13 system | sending SIGKILL to all processes 10:49:13 | SyntaxError: Unexpected token ILLEGAL

any help greatly appreciated

SueSmith commented 10 years ago

Not honestly sure but it may be worth checking the ACCESS_LIST variable in your config, depending on your system it may be necessary to escape various characters.. see this page https://github.com/mozilla/openbadges-badgekit/wiki/Troubleshooting-BadgeKit#check-your-access-list-syntax

gazzastone commented 10 years ago

Unfortunately made no difference I added debug=true to my env file which generates the following which hopefully may help somebody

11:33:06 web.1 | started with pid 4620 11:33:07 web.1 | 11:33:07 web.1 | undefined:19 11:33:07 web.1 | return "navigator.id.watch({ 11:33:07 web.1 | \n loggedInUser: " + obj.loggedInUser + ", 11:33:07 web.1 | \n 11:33:07 web.1 | ^^^^^^^^^^^^^^^^^^^^^ 11:33:07 web.1 | SyntaxError: Unexpected token ILLEGAL 11:33:07 web.1 | at Object.Function () 11:33:07 web.1 | at Function.compile (C:\Badgekit\openbadges-badgekit\node_ modules\express-persona-observer\node_modules\minstache\index.js:79:10) 11:33:07 web.1 | at Object. (C:\Badgekit\openbadges-badgekit\nod e_modules\express-persona-observer\index.js:6:25) 11:33:07 web.1 | at Module._compile (module.js:456:26) 11:33:07 web.1 | at Object.Module._extensions..js (module.js:474:10) 11:33:07 web.1 | at Module.load (module.js:356:32) 11:33:07 web.1 | at Function.Module._load (module.js:312:12) 11:33:07 web.1 | at Module.require (module.js:364:17) 11:33:07 web.1 | at require (module.js:380:17) 11:33:07 web.1 | at Object. (C:\Badgekit\openbadges-badgekit\app \index.js:20:17) 11:33:07 web.1 | exited with code 8 11:33:07 system | sending SIGKILL to all processes

although this is a windows install attempt I get exactly the same error on my Ubuntu box

SueSmith commented 10 years ago

This thread on the Google Dev Group may be relevant: https://groups.google.com/forum/#!topic/openbadges-dev/95o1Ekn3PjM

gazzastone commented 10 years ago

Yes I found that post earlier and it did not make any difference

gazzastone commented 10 years ago

Hi Sue followed https://groups.google.com/forum/#!topic/openbadges-dev/95o1Ekn3PjM again and managed to get a bit further on a start then got the following warning .. connect.multipart() will be removed in connect 3.0 this is only supposed to be a warning message but the system exited with an error 8

I then modified index.js removed the line app.use(express.bodyParser()); and added the following 2 lines app.use(express.json()); app.use(express.urlencoded());

Finally application started listening on port 3000 :-)

Navigated to http://localhost:3000 and managed to logon using chrome I then clicked on Start to create a new template.. nothing happened and noticed this error on the badgekit-api instance 09:55:37 web.1 | {"name":"badgekit-api","hostname":"TheHubster","pid":7020,"level":40,"code":"ResourceNotFound","model":"system","field":"slug","value":"\"badgekit\"","msg":"","time":"2014-07-02T08:55:37.798Z","v":0}

And ideas on this one please

SueSmith commented 10 years ago

Sounds like either the API and BadgeKit aren't talking to one another or you don't have an entry in your API systems table - it's in this section of the self-hosting guide: https://github.com/mozilla/openbadges-badgekit/wiki/BadgeKit-Self-Hosting-Guide#badgekit-api-database

..and this section of the troubleshooting guide: https://github.com/mozilla/openbadges-badgekit/wiki/Troubleshooting-BadgeKit#make-sure-you-have-a-system-in-your-badgekit-api-database

e.g.

INSERT INTO systems (slug, name, url) VALUES ('badgekit', 'Your System', 'http://localhost:3000');
gazzastone commented 10 years ago

Thanks for that I did have an entry but had the wrong name, having a few problems some of the URL's not having the http://xxxx.xxx.xxx.xxx:3000/ and thereby resulting 404 error, but other then that it is starting to come together, now all I need to do is work out how to use it

timothyfcook commented 10 years ago

I also couldn't get the Local install to work. I set it up on Heroku using the guide, but just get 404s after I try to log in. http://saxifrage-badgekit.herokuapp.com/

threeqube commented 10 years ago

@timothyfcook can you provide a bit more details on how you set up your environment?

ducnguyen9988 commented 10 years ago

I get a weird error scr

cmcavoy commented 10 years ago

What version of Node are you using?

On Fri, Sep 12, 2014 at 11:10 AM, ducnguyen9988 notifications@github.com wrote:

I get a weird error [image: scr] https://cloud.githubusercontent.com/assets/8725193/4252704/4b2c698a-3a97-11e4-8fc3-99fb360faa96.png

— Reply to this email directly or view it on GitHub https://github.com/mozilla/openbadges-badgekit/issues/456#issuecomment-55424740 .

dlampson commented 10 years ago

Hope this isn't hijacking the thread, but I'm having enough similar problems to think not...

I can confirm the need to hack the login.js file as others have observed (apparently a Windoze peculiarity). I've also had to mod the config AccessList to get the service to start (I'm using ["^xyz@@acord.org$"] but I have no idea if this causes other problems once the service is running).

Regardless of all of the above, the service still will not run--it starts, but then throws up with a code 8 and little more.

With a current BadgeKit clone from git, the server won't start. Debugging shows that this line in the index.js file fails:

app.use(express.bodyParser());

I tried replacing it with these 2 lines as others on this thread have suggested:

app.use(express.json()); app.use(express.urlencoded());

and I can get the server to start on a custom port (4000 my choice, and yes, I have the systems table row and the config.json vars set to 4000).

In Chrome, I can navigate to localhost:4000 and login to badgekit. However, any server page action results in the friendly "Something went wrong in our Server" spash page.

It seems rather clear from here:

http://stackoverflow.com/questions/24330014/bodyparser-is-deprecated-express-4

That bodyParser() has been deprecated in Express 4. I'm running Express 4.9.0 (verified using "npm info express version"). Other versions: node 0.10.31, Python 2x (this is really unfortunate, as I need 3x for other things), latest Heruko Toolbelt and MySQL 5.6 Community.

So far, I've concluded that: 1) The latest Badgekit source from Github has a deprecated method relative to current stable Express. It seems to me this should get fixed ASAP.

2) An attempt to replace the deprecated method with 2 new ones at least allows the script to complete (the service listens on the assigned port), but it's not clear to me (I'm not a node.js jockey) that this hack is not itself the source of more mischief that I'm new experiencing.

Any suggestions as to how to resolve the problem? Thx.

dlampson commented 10 years ago

This may be related to the above--forgot to include it. localhost:4000 on FF produces a strange mix of missing static content and mangled URLs (e.g., http://localhost:4000/\settings).

gkastner commented 9 years ago

Hi! I face the same problem than dlampson. Is there any approach known how to fix this issue?

Thank you