Unable to install WebIDE
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Unable to install WebIDE

by alfiesty on Sun Mar 03, 2013 2:56 pm

When I try the easy way

pi@raspberrypi ~ $ curl https://raw.github.com/adafruit/Adafrui ... install.sh
curl: (35) Unknown SSL protocol error in connection to raw.github.com:443
pi@raspberrypi ~ $

Installing manually

pi@raspberrypi ~ $ sudo apt-get install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
git is already the newest version.
git set to manually installed.
The following packages were automatically installed and are no longer required:
cvm fgetty ipsvd libbg1 libbg1-doc libcvm1 libmatrixssl1.8 runit
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.pi@raspberrypi ~ $ git clone
pi@raspberrypi ~ $ git clone git://github.com/adafruit/Adafruit-WebIDE.git
Cloning into 'Adafruit-WebIDE'...
fatal: unable to connect to github.com:
github.com[0: 207.97.227.239]: errno=Connection timed out
pi@raspberrypi ~ $

What am I doing wrong? Shutting off Windows firewall made no difference.


Jim
alfiesty
 
Posts: 25
Joined: Mon Apr 16, 2012 4:47 pm

Re: Unable to install WebIDE

by adafruit_support_mike on Wed Mar 06, 2013 8:36 am

Offhand, it looks like you don't have a network connection.

Try this:
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi ~ $ traceroute raw.github.com

You should see a series of lines like this:

Code: Select all | TOGGLE FULL SIZE
 1  192.168.0.1 (192.168.0.1)  2.377 ms  1.818 ms  2.906 ms
 2  99-195-210-1.dyn.centurytel.net (99.195.210.1)  17.538 ms  16.866 ms  16.963 ms
 3  173-248-84-30.centurylink.net (173.248.84.30)  15.001 ms  17.329 ms  13.608 ms
 4  173-248-69-196.centurylink.net (173.248.69.196)  26.550 ms  25.140 ms  26.256 ms

that tell you how long it took to make a connection to each machine in the path between your RasPi and Github. If you get a series of lines like this:

Code: Select all | TOGGLE FULL SIZE
 11  * * *
 12  * * *
 13  * * *

hit control-C to stop the test.

If you don't see at least a few lines of the first sort, your Pi doesn't have a connection to the internet.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 9163
Joined: Thu Feb 11, 2010 1:51 pm

Re: Unable to install WebIDE

by alfiesty on Wed Mar 06, 2013 10:25 pm

you are right
pi@raspberrypi ~ $ traceroute raw.github.com
traceroute to raw.github.com (199.27.74.133), 30 hops max, 60 byte packets
1 qwestmodem.domain.actdsltmp (192.168.0.1) 6.503 ms 7.123 ms 7.606 ms
2 * * *
3 * * *
4 * * *
5 * * *
6 * * *
7 * * *
8 * * *
9 * * *
10 * * *
11 * * *
12 * *^C

However I can ping and browse

$pi@raspberrypi ~ $ ping raw.github.com
PING github.map.fastly.net (199.27.73.133) 56(84) bytes of data.
64 bytes from raw.github.com (199.27.73.133): icmp_req=1 ttl=56 time=132 ms
64 bytes from raw.github.com (199.27.73.133): icmp_req=2 ttl=56 time=130 ms
64 bytes from raw.github.com (199.27.73.133): icmp_req=3 ttl=56 time=130 ms
64 bytes from raw.github.com (199.27.73.133): icmp_req=4 ttl=56 time=135 ms
64 bytes from raw.github.com (199.27.73.133): icmp_req=5 ttl=56 time=134 ms
64 bytes from raw.github.com (199.27.73.133): icmp_req=6 ttl=56 time=130 ms
^C
--- github.map.fastly.net ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5006ms
rtt min/avg/max/mdev = 130.569/132.455/135.843/1.983 ms
pi@raspberrypi ~ $

What is wrong with my setup?

Jim
alfiesty
 
Posts: 25
Joined: Mon Apr 16, 2012 4:47 pm

Re: Unable to install WebIDE

by adafruit_support_mike on Thu Mar 07, 2013 5:41 pm

Now that's interesting..

If you can ping, you have a network connection. The fact that traceroute returns nothing is odd because traceroute and ping both use ICMP echo requests.

My next guess would be that you're running into a protocol filter at your local router.

The usual RasPi setup involves a WiFi dongle linking to a WiFi router with a DSL or cable connection to the upstream provider. If that's what you have, check the configuration settings on that to see if it has a traffic filter of some kind.

Looking back at the commands you listed in your original post, neither of them was straight HTTP. Try this:

Code: Select all | TOGGLE FULL SIZE
curl http://raw.github.com/adafruit/Adafruit-WebIDE/alpha/scripts/install.sh

Your original version was HTTPS, and there might be something wonky that's blocking the SSL connection.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 9163
Joined: Thu Feb 11, 2010 1:51 pm

Re: Unable to install WebIDE

by alfiesty on Fri Mar 08, 2013 6:24 pm

Yet another funny response! NOTHING!!

pi@raspberrypi ~ $ curl http://raw.github.com/adafruit/Adafruit ... install.sh
pi@raspberrypi ~ $ ping raw.github.com
PING github.map.fastly.net (199.27.75.133) 56(84) bytes of data.
64 bytes from raw.github.com (199.27.75.133): icmp_req=1 ttl=55 time=80.7 ms
64 bytes from raw.github.com (199.27.75.133): icmp_req=2 ttl=55 time=79.6 ms
64 bytes from raw.github.com (199.27.75.133): icmp_req=3 ttl=55 time=81.3 ms
64 bytes from raw.github.com (199.27.75.133): icmp_req=4 ttl=55 time=79.6 ms
64 bytes from raw.github.com (199.27.75.133): icmp_req=5 ttl=55 time=77.5 ms
64 bytes from raw.github.com (199.27.75.133): icmp_req=6 ttl=55 time=78.5 ms
^C
--- github.map.fastly.net ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5006ms
rtt min/avg/max/mdev = 77.528/79.592/81.370/1.303 ms
pi@raspberrypi ~ $ sudo curl http://raw.github.com/adafruit/Adafruit ... install.sh
pi@raspberrypi ~ $

Jim "Still searching for solutions"
alfiesty
 
Posts: 25
Joined: Mon Apr 16, 2012 4:47 pm

Re: Unable to install WebIDE

by adafruit_support_mike on Sat Mar 09, 2013 1:45 am

All right, I just executed the same command with a -v flag to see exactly what was going on, and found a redirect to the https version.

Time to stop being subtle.. here's the installer script:

Code: Select all | TOGGLE FULL SIZE
#!/usr/bin/env bash

# curl https://raw.github.com/adafruit/Adafruit-WebIDE/alpha/scripts/install.sh | sudo sh
# curl https://raw.github.com/adafruit/Adafruit-WebIDE/test/scripts/install.sh | sudo sh

#tar -zcvf editor.tar.gz * --exclude .git --exclude .gitignore
#tar -zcvf editor-update.tar.gz * --exclude .git --exclude .gitignore
#scp pi@raspberrypi.local:/home/pi/Adafruit-WebIDE/editor.tar.gz editor-0.2.4.tar.gz
#scp pi@raspberrypi.local:/home/pi/Adafruit-WebIDE-Update/editor-update.tar.gz editor-0.2.4-update.tar.gz
#sudo -u webide -g webide node server

set -e
WEBIDE_ROOT="/usr/share/adafruit/webide"

#needed for SSH key and config access at this point.
WEBIDE_HOME="/home/webide"

#NODE_PATH="/usr/local/lib/node"

#if [ ! -d "$NODE_PATH" ]; then
#  mkdir -p "$NODE_PATH"
#    # Control will enter here if $DIRECTORY doesn't exist.
#fi

mkdir -p "$WEBIDE_ROOT"
mkdir -p "$WEBIDE_HOME"
cd "$WEBIDE_ROOT"

echo "**** Downloading the latest version of the WebIDE ****"
curl -L http://adafruit-download.s3.amazonaws.com/webide-0.3.6.tar.gz | tar xzf -

echo "**** Installing required libraries ****"
echo "**** (redis-server git restartd libcap2-bin avahi-daemon i2c-tools python-smbus) ****"
apt-get update
apt-get install nodejs nodejs-legacy redis-server git restartd libcap2-bin avahi-daemon i2c-tools python-smbus -y

echo "**** Create webide user and group ****"
groupadd webide || true
useradd -g webide webide || true
usermod -a -G i2c,sudo webide || true

echo "**** Adding webide user to sudoers ****"
if [ -f "/etc/sudoers.tmp" ]; then
    rm /etc/sudoers.tmp
fi
cp /etc/sudoers /etc/sudoers.tmp
echo "webide ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.tmp
visudo -c -f /etc/sudoers.tmp
if [ "$?" -eq "0" ]; then
    cp /etc/sudoers.tmp /etc/sudoers
fi
rm /etc/sudoers.tmp

chown -R webide:webide "$WEBIDE_HOME"
chown -R webide:webide "$WEBIDE_ROOT"
chmod 775 "$WEBIDE_ROOT"

echo "**** Adding default .bashrc file for webide user ****"
cp "$WEBIDE_ROOT/scripts/.bashrc" "$WEBIDE_HOME"

echo "**** Installing the WebIDE as a service ****"
echo "**** (to uninstall service, execute: 'sudo update-rc.d -f adafruit-webide.sh remove') ****"
cp "$WEBIDE_ROOT/scripts/adafruit-webide.sh" "/etc/init.d"
cd /etc/init.d
chmod 755 adafruit-webide.sh

NODE_PATH=""
ARCH=$(dpkg --print-architecture)
if [ $ARCH = armhf ]; then
  NODE_PATH="\/usr\/share\/adafruit\/webide\/bin\/node_hf\/node"
  chmod +x "$WEBIDE_ROOT/bin/node_hf/node"
else
  NODE_PATH="\/usr\/share\/adafruit\/webide\/bin\/node_sf\/node"
  chmod +x "$WEBIDE_ROOT/bin/node_sf/node"
fi
sed -i "s/NODE_PATH/$NODE_PATH/g" adafruit-webide.sh

update-rc.d adafruit-webide.sh defaults

#set binaries as executable


#Check if port 80 is in use, use 3000 if so.
PORT_USED=""
if netstat -lnt | awk '$6 == "LISTEN" && $4 ~ ".80"' | grep -q "LISTEN"
then
  redis-cli HMSET server port 3000
  PORT_USED=":3000"
  echo "**** WARNING: PORT 80 IN USE. FALLING BACK TO 3000. ****"
  echo "**** TO CHOOSE A DIFFERENT PORT USE THE FOLLOWING COMMAND: ****"
  echo "**** redis-cli HMSET server port 3000 ****"
  echo "**** AND RESTART THE SERVER ****"
fi

service adafruit-webide.sh start

if grep -q adafruit-webide.sh /etc/restartd.conf
then
  echo "restartd already configured"
else
  echo 'webide "node" "service adafruit-webide.sh restart" ""' >> /etc/restartd.conf
fi

#kill all restartd processes, and restart one
pkill -f restartd || true
sleep 5s
restartd

echo "**** Starting the server...(please wait) ****"
sleep 20s

echo "**** The Adafruit WebIDE is installed and running! ****"
echo "**** Commands: sudo service adafruit-webide.sh {start,stop,restart} ****"
echo "**** Navigate to http://$(hostname).local$PORT_USED to use the WebIDE"
#echo "**** To run the editor: ****"
#echo "**** cd ~/Adafruit/WebIDE ****"
#echo "**** node webide ****"


Copy that to your RasPi by any means necessary, and save it as 'install.sh'.

Then execute the command:

Code: Select all | TOGGLE FULL SIZE
cat install.sh | sudo sh


The WebIDE lives in the Amazon cloud under a regular HTTP address, and the apt-get stuff is plain-vanilla HTTP too. Hopefully whatever it is in your network that hates HTTPS traffic will stay out of the way.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 9163
Joined: Thu Feb 11, 2010 1:51 pm

Re: Unable to install WebIDE

by alfiesty on Sat Mar 09, 2013 12:51 pm

That seemed to work but connecting to "http://raspberry.local" just brings up a search engine. Since I had the install window still open in SSH, I copied the last lines of the install logging to the screen.

update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto m ode
Setting up nodejs-legacy (0.6.19~dfsg1-6) ...
Setting up restartd (0.2.2) ...
Starting process checker: No processes defined in config file. Exiting.
restartd.
**** Create webide user and group ****
**** Adding webide user to sudoers ****
/etc/sudoers.tmp: parsed OK
/etc/sudoers.d/README: parsed OK
sh: 50:  : not found
pi@raspberrypi /boot $

PS I really appreciate all your help! My field was giant klystrons( 30-100 megawatt) which somehow did not include Linux.
alfiesty
 
Posts: 25
Joined: Mon Apr 16, 2012 4:47 pm

Re: Unable to install WebIDE

by adafruit_support_mike on Sun Mar 10, 2013 7:30 pm

Okay, it glitched out at copying the webIDE user to the sudoers file.. for reference 'sudo' allows regular users to execute commands with the power of the 'root' user. All unix variants have user-based access restrictions on what files you can read, edit, or execute. Most user accounts are restricted to files in their own home directory and 'you can see it but you can't change it' utilities.

That causes some headaches in an age where we interact with computers through a web browser. The server program (called a 'daemon') has its own user account, and there are good reasons for that account to have fairly tight limits. That means the files that are best behaved for the daemon are locked off to a point where the average user account can't work with them.

The root user account doesn't have those access restrictions, precisely because having a file nobody can change is a Big Problem in all sorts of places. Rather than giving everyone access to the root account, the 'sudo' command lets regular users run specific commands with the power of root.

That's not the kind of thing you want built into every user account by default, so there's a tightly access-controlled file named 'sudoers' which tells the machine who can execute 'sudo' at all, and what commands they can use.

That's where things went blooey.

So.. enter this command:
Code: Select all | TOGGLE FULL SIZE
sudo cat /etc/sudoers

and see if the last line is:
Code: Select all | TOGGLE FULL SIZE
webide ALL=(ALL) NOPASSWD: ALL

If not, do this:
Code: Select all | TOGGLE FULL SIZE
ls -l /etc/sudoers.tmp

to see if the tempfile created by the installer still exists.

If both those tests come up "no", I'm going to have to teach you 'vi' editor syntax, which is Not A Fun Thing To Do.

'vi' predates the window-mouse user interface, so it uses keyboard commands to alter text files. It evolved in the hands of code geeks building tools for their own use, so it's dang near impenetrable to normal humans.

Hopefully it won't come to that.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 9163
Joined: Thu Feb 11, 2010 1:51 pm

Re: Unable to install WebIDE

by CleoQc on Sun Apr 14, 2013 4:54 pm

If both those tests come up "no", I'm going to have to teach you 'vi' editor syntax, which is Not A Fun Thing To Do.

'vi' predates the window-mouse user interface, so it uses keyboard commands to alter text files. It evolved in the hands of code geeks building tools for their own use, so it's dang near impenetrable to normal humans.

Hopefully it won't come to that.


Not adding anything useful, but this above quote made me smile... My unix skills are 20 years old and rusty, but 'vi' is still implemented in my fingers :lol: If I don't think, the commands just come back naturally. That said, I can't get WebIDE to work either.
User avatar
CleoQc
 
Posts: 3
Joined: Sun Apr 14, 2013 4:44 pm