Coder Social home page Coder Social logo

Comments (39)

jwcooper avatar jwcooper commented on July 2, 2024

Bummer, what was the URL of that error page? If you manually go to the setup page again (raspberypi.local:3000/setup), are the OAuth values pre-populated at the bottom of the page?

The 400 error seems to indicate something is wrong with the request itself.

from adafruit-webide.

dasistdaniel avatar dasistdaniel commented on July 2, 2024

Yes, the values are there.

The URL is http://192.168.2.130:3000/auth/bitbucket
Does it need to be raspberrypi.local?

from adafruit-webide.

jwcooper avatar jwcooper commented on July 2, 2024

No, an IP address should be fine, and that does look good for the callback. I automatically detect what the valid hostname should be based on your first request to the editor.

Can you try creating a new key and secret, and update with those new keys? It seems like bitbucket is complaining about bad data for some reason. I'm trying to reproduce this on my end as well.

from adafruit-webide.

dasistdaniel avatar dasistdaniel commented on July 2, 2024

Same one with new keys

failed to obtain request token (status: 400 data: Could not verify OAuth request.)
at /home/pi/Adafruit/WebIDE/editor/node_modules/passport-bitbucket/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth.js:183:36
at /home/pi/Adafruit/WebIDE/editor/node_modules/passport-bitbucket/node_modules/passport-oauth/node_modules/oauth/lib/oauth.js:512:17
at passBackControl (/home/pi/Adafruit/WebIDE/editor/node_modules/passport-bitbucket/node_modules/passport-oauth/node_modules/oauth/lib/oauth.js:368:13)
at IncomingMessage.<anonymous> (/home/pi/Adafruit/WebIDE/editor/node_modules/passport-bitbucket/node_modules/passport-oauth/node_modules/oauth/lib/oauth.js:380:9)
at IncomingMessage.emit (events.js:88:20)
at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:130:23)
at CleartextStream.socketOnData [as ondata] (http.js:1288:20)
at CleartextStream._push (tls.js:375:27)
at SecurePair.cycle (tls.js:734:20)
at EncryptedStream.write (tls.js:130:13)

from adafruit-webide.

jwcooper avatar jwcooper commented on July 2, 2024

What distro are you using, and what browser are you using? I did most of my development with chrome, firefox, and Occidentalis.

Are you behind a proxy or firewall?

It appears you're making it to bitbucket, but they're responding that you have something wrong with the request.

If all else fails, maybe do a full uninstall, and then a re-install. It will remember your bitbucket values, so it's just a matter of waiting for it to complete:
curl https://raw.github.com/adafruit/Adafruit-WebIDE/release/scripts/uninstall.sh | sh
curl https://raw.github.com/adafruit/Adafruit-WebIDE/release/scripts/install.sh | sh

from adafruit-webide.

dasistdaniel avatar dasistdaniel commented on July 2, 2024

It's the official Raspbian Wheezy.
The Webbrowser is Chrome on a Windows XP Machine. But i also tried iceweasel on the Raspberry itself.

There is a Router to connect all machines to the Internet but there are no firewall rules set.

I forwarding Port 3000 or setting up the DMZ doesn't have any effect.

from adafruit-webide.

dasistdaniel avatar dasistdaniel commented on July 2, 2024

Does it need Bonjour?

from adafruit-webide.

jwcooper avatar jwcooper commented on July 2, 2024

It shouldn't need Bonjour, as I do all of my development using various hostnames, such as 127.0.0.1, localhost, or my external IP...they all seem to work.

The key here is that you're on Raspbian. Unfortunately, I haven't done much testing with Raspbian, so it could have different settings than Occidentalis 0.2.

What version of node are you on?

node -v

Currently, it's targeted for node -v 0.6.x, as that's what typically is pre-installed in the debian repo.

from adafruit-webide.

dasistdaniel avatar dasistdaniel commented on July 2, 2024

pi@raspberrypi ~ $ node -v
v0.6.19

from adafruit-webide.

dasistdaniel avatar dasistdaniel commented on July 2, 2024

tried to uninstall and got an error

**** Removing auto-generated Bitbucket SSH keys ****
sh: 17: cd: can't cd to /home/pi/.ssh
rm: Entfernen von „id_rsa_bitbucket*“ nicht möglich: Datei oder Verzeichnis nicht gefunden

Could this be the problem?

from adafruit-webide.

jwcooper avatar jwcooper commented on July 2, 2024

I don't think that would be an issue. The only reason that failed is you haven't gotten far enough in the process to create your bitbucket ssh keys.

from adafruit-webide.

bwsparxz avatar bwsparxz commented on July 2, 2024

I am getting the same issue . I tried reimaging the card and reinstalling . Created a different bitbucket account. Still the same. I am going through a DMZ on the network . Using Occidentalis v0.2

from adafruit-webide.

jwcooper avatar jwcooper commented on July 2, 2024

Is your Pi able to ping bitbucket.org?

Also, do you get the status: 400 data: Could not verify OAuth request.?

from adafruit-webide.

bwsparxz avatar bwsparxz commented on July 2, 2024

Yes can ping from Pi to bitbucket.org. Yes on status: 400 data: Could not verify OAuth request.

from adafruit-webide.

bwsparxz avatar bwsparxz commented on July 2, 2024

failed to obtain request token (status: 400 data: Could not verify OAuth request.)
at /home/pi/Adafruit/WebIDE/editor/node_modules/passport-bitbucket/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth.js:183:36
at /home/pi/Adafruit/WebIDE/editor/node_modules/passport-bitbucket/node_modules/passport-oauth/node_modules/oauth/lib/oauth.js:512:17
at passBackControl (/home/pi/Adafruit/WebIDE/editor/node_modules/passport-bitbucket/node_modules/passport-oauth/node_modules/oauth/lib/oauth.js:368:13)
at IncomingMessage. (/home/pi/Adafruit/WebIDE/editor/node_modules/passport-bitbucket/node_modules/passport-oauth/node_modules/oauth/lib/oauth.js:380:9)
at IncomingMessage.emit (events.js:88:20)
at HTTPParser.parserOnMessageComplete as onMessageComplete
at CleartextStream.socketOnData as ondata
at CleartextStream._push (tls.js:375:27)
at SecurePair.cycle (tls.js:734:20)
at EncryptedStream.write (tls.js:130:13)

from adafruit-webide.

ianauch avatar ianauch commented on July 2, 2024

I'm also getting an error when trying to login, but only when i try and connect from my computer. If i use the brower on the pi it works fine.

Here is the error:

Error: failed to find request token in session
at Strategy.authenticate (/home/pi/Adafruit/WebIDE/editor/node_modules/passport-bitbucket/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth.js:122:54)
at attempt (/home/pi/Adafruit/WebIDE/editor/node_modules/passport/lib/passport/middleware/authenticate.js:223:16)
at Passport.authenticate (/home/pi/Adafruit/WebIDE/editor/node_modules/passport/lib/passport/middleware/authenticate.js:224:7)
at callbacks (/home/pi/Adafruit/WebIDE/editor/node_modules/express/lib/router/index.js:162:11)
at param (/home/pi/Adafruit/WebIDE/editor/node_modules/express/lib/router/index.js:136:11)
at pass (/home/pi/Adafruit/WebIDE/editor/node_modules/express/lib/router/index.js:143:5)
at Router._dispatch (/home/pi/Adafruit/WebIDE/editor/node_modules/express/lib/router/index.js:170:5)
at Object.router as handle
at next (/home/pi/Adafruit/WebIDE/editor/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Object.handle (/home/pi/Adafruit/WebIDE/editor/server.js:105:3)

from adafruit-webide.

jwcooper avatar jwcooper commented on July 2, 2024

ianauch what is the URL for that error? Did you use a different hostname for the attempts from the Pi (localhost, vs an IP, for example)? If you restart the editor, and try first from your computer, it should work (try clearing the cookies too):

Takes about 20-30 seconds to start up:
service adafruit-webide.sh stop
service adafruit-webide.sh start

from adafruit-webide.

bwsparxz avatar bwsparxz commented on July 2, 2024

Still cannot get past this stage of install. Have taken Pi to 3 different networks, all with different ISPs. Have reinstall Occidentalis v0.2 twice , changed SD cards. Still nothing. Anything else to try?

from adafruit-webide.

bwsparxz avatar bwsparxz commented on July 2, 2024

Also got this error:

failed to obtain request token (Error: getaddrinfo ENOENT)
at /home/pi/Adafruit/WebIDE/editor/node_modules/passport-bitbucket/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth.js:183:36
at /home/pi/Adafruit/WebIDE/editor/node_modules/passport-bitbucket/node_modules/passport-oauth/node_modules/oauth/lib/oauth.js:512:17
at ClientRequest. (/home/pi/Adafruit/WebIDE/editor/node_modules/passport-bitbucket/node_modules/passport-oauth/node_modules/oauth/lib/oauth.js:391:7)
at ClientRequest.emit (events.js:67:17)
at CleartextStream.socketErrorListener (http.js:1188:9)
at CleartextStream.emit (events.js:67:17)
at Socket.onerror (tls.js:1146:17)
at Socket.emit (events.js:88:20)
at Array.0 (net.js:595:16)
at EventEmitter._tickCallback (node.js:190:39)

from adafruit-webide.

jwcooper avatar jwcooper commented on July 2, 2024

The latest error you posted appears to be a dns lookup failure of sorts.

From your Pi, if you run the following command:
redis-cli hgetall bitbucket_oauth

Do you see the valid consumer_key, and consumer_secret (no need to paste these here :))?

Also, if you run 'df' from the command line, do you have anything "Use%' at 100%?

Also, are you using a 4GB SD card?

Do you get a valid time and date back:
pi@raspberrypi ~ $ date
Thu Oct 11 03:30:19 UTC 2012

You can try seeing if the linked in oauth test console will work for your key and secret, just need to add:
get these from your 'redis-cli hgetall bitbucket_oauth' command:
API KEY
API Secret
URL: https://api.bitbucket.org/1.0/user/

The 400 bad request error likely means that a required parameter is missing:
https://confluence.atlassian.com/display/BITBUCKET/Using+the+Bitbucket+REST+APIs

In the editor/server.js file on the Pi, you can add logging right at the beginning of the setup_passport (around lines 50-60), to see if all three parameters are set correctly:
function setup_passport(consumer_key, consumer_secret) {
console.log(consumer_key);
console.log(consumer_secret);
console.log("http://" + HOSTNAME + "/auth/bitbucket/callback");

After entering that, restart the server
service adafruit-webide.sh stop
service adafruit-webide.sh start

Wait 20-30 seconds until it's started up.

Let me know if any of this helps!

from adafruit-webide.

jrosengren avatar jrosengren commented on July 2, 2024

I was seeing the exact same issue with not being able to authenticate to Bitbucket, Justin's comment about the date triggered the fix for me - I never realized that neither NTP nor Chrony were running, so my Pi's clock was very out of date.

I fixed the date and everything is working as it should.

from adafruit-webide.

jwcooper avatar jwcooper commented on July 2, 2024

Great! The date is used to create an OAuth timestamp, so if the Pi has the wrong date or time set, Bitbucket will reject it with that 400 error (for those that didn't know the nasty inner workings of OAuth). ;)

from adafruit-webide.

bwsparxz avatar bwsparxz commented on July 2, 2024

My time and date is correct. I'm a little lost on the rest.

from adafruit-webide.

FourthDr avatar FourthDr commented on July 2, 2024

I'm having the same problem! I've tried all the trouble shooting listed above, still getting the same error. :-|

from adafruit-webide.

FourthDr avatar FourthDr commented on July 2, 2024

I am using Occidentalis 0.2.......

from adafruit-webide.

jwcooper avatar jwcooper commented on July 2, 2024

Please try the latest version, and we can start from there with this OAuth issue. Here are the upgrade instructions:
http://www.adafruit.com/blog/2012/10/18/raspberry-pi-webide-update-to-0-2-0/

from adafruit-webide.

FourthDr avatar FourthDr commented on July 2, 2024

Well, after uninstalling my system time was reset to a time in the future! :-( It should say 10:21AM but it's now stuck at Thur Oct 18 12:45PM! :-| What the script do to my Pi? Date command won't reset the time.

from adafruit-webide.

jwcooper avatar jwcooper commented on July 2, 2024

The script is quite simple, you can review it in this repository, and it doesn't execute any date or time commands, unless 'apt-get update' updates the time. What is the timezone on your Pi? Does the latest version fix your OAuth issue?

Type 'date' on the command line to get the date, including the timezone. You can change the timezone in raspi-config:
sudo raspi-config

from adafruit-webide.

FourthDr avatar FourthDr commented on July 2, 2024

reset time zone, rebooted, set time. So now the WebIDE gets to logging on github. However, now NoScript is blocking the callbacks because the website is requesting lan resources "ABE". Any thoughts?

from adafruit-webide.

jwcooper avatar jwcooper commented on July 2, 2024

You'll need to disable NoScript for the editor (lots of javascript). NoScript won't like the call from localhost to bitbucket for the OAuth request, which is what I'm sure it's complaining about with the ABE error.

from adafruit-webide.

FourthDr avatar FourthDr commented on July 2, 2024

Two problems there. 1. disabling NoScript requires a browser restart. 2. once disabled, it is disable for EVERY website. Not a good thing! Is there an exception that I can set just for butbucket and WebIDE sites? Not sure how I would do that since I usually block these kinds of website requests.

from adafruit-webide.

jwcooper avatar jwcooper commented on July 2, 2024

You can unblock it for just the WebIDE, unfortunately I'm not sure how, as I don't often use NoScript. May need to Google that one.

from adafruit-webide.

bwsparxz avatar bwsparxz commented on July 2, 2024

I rebuilt my 8 gb card with Occidentalis 0.2. Ran the new 0.2 installer script. No installation errors like before, using my home network. Still getting: failed to obtain request token (Error: getaddrinfo ENOENT). I will check it on another network tomorrow but not having any DNS problems on network or the Pi.

Thank you for your hard work developing this, cant wait to try it out after getting this issue resolved.

from adafruit-webide.

jwcooper avatar jwcooper commented on July 2, 2024

@bwsparxz Everything I've searched for on that error makes it appear as though you're going through a firewall, or have DNS issues. Does that error also have the '400' 'bad request' in it? You've posted two errors in this thread, and just want to make sure we're working on the same one. :)

from adafruit-webide.

bwsparxz avatar bwsparxz commented on July 2, 2024

Still getting this error:

failed to obtain request token (Error: getaddrinfo ENOENT)
at /home/pi/Adafruit/WebIDE/editor/node_modules/passport-bitbucket/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth.js:183:36
at /home/pi/Adafruit/WebIDE/editor/node_modules/passport-bitbucket/node_modules/passport-oauth/node_modules/oauth/lib/oauth.js:512:17
at ClientRequest. (/home/pi/Adafruit/WebIDE/editor/node_modules/passport-bitbucket/node_modules/passport-oauth/node_modules/oauth/lib/oauth.js:391:7)
at ClientRequest.emit (events.js:67:17)
at CleartextStream.socketErrorListener (http.js:1188:9)
at CleartextStream.emit (events.js:67:17)
at Socket.onerror (tls.js:1146:17)
at Socket.emit (events.js:88:20)
at Array.0 (net.js:595:16)
at EventEmitter._tickCallback (node.js:190:39)

from adafruit-webide.

bwsparxz avatar bwsparxz commented on July 2, 2024

EUREKA, I finally got the WebIDE working. Turns out it was a DNS resolution issue. Had tried changing nameserver to google dns with no luck. Tonight I realized I had not tried OpenDNS. That worked, as well as my issue with git clone. Had to set my Pi to static ip from dhcp so when I reboot the resolv.conf wasn't changed back to router gateway ip address, no big deal to me. Guess my ISP dns doesn't like git or bitbucket. But I guess that is the same for google dns as well. Makes no sense but its working. Thanks for putting me on the right path.

from adafruit-webide.

jwcooper avatar jwcooper commented on July 2, 2024

Great news! I'm glad it's working for you. I'll leave this issue open for a while to help others that run into this issue.

from adafruit-webide.

fredefl avatar fredefl commented on July 2, 2024

I got the 400 error too. All I did was executing "/etc/init.d/ntp force-reload". My time was way off.

from adafruit-webide.

jwcooper avatar jwcooper commented on July 2, 2024

I've created an FAQ page for this issue on the Adafruit Learning System. If we're missing anything, feel free to add to this issue. All known cases of this so far have been unrelated to any code.

http://learn.adafruit.com/webide/faq

from adafruit-webide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.