Tele-Op Web Interface: "Not authorized to get robot.html"

I was having issues similar to a previous post regarding an unauthorized login. I ran mongorestore and checked MongoDB-Compass if node-auth appeared:

I then tried logging in but was met with a “Not authorized to get robot.html” screen instead:

I’ve attached the output from running web_interface_installation.sh however if there’s anything else I can provide feel free to let me know.

hello-robot@stretch-re1-1010:~$ '/home/hello-robot/catkin_ws/src/stretch_web_interface/bash_scripts/web_interface_installation.sh' 

Starting web interface installation script.

Updating with apt.
[sudo] password for hello-robot: 
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease                     
Hit:3 https://deb.nodesource.com/node_10.x bionic InRelease                    
Get:4 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]   
Hit:5 http://packages.ros.org/ros/ubuntu bionic InRelease                      
Hit:6 https://typora.io/linux ./ InRelease                                     
Get:7 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Hit:8 http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic InRelease
Fetched 252 kB in 1s (255 kB/s)                   
Reading package lists... Done
Done.

Installing rosbridge
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ros-melodic-rosbridge-server is already the newest version (0.11.13-1bionic.20210112.195018).
The following packages were automatically installed and are no longer required:
  libc-ares2 libhttp-parser2.7.1 libllvm9 linux-headers-4.15.0-106
  linux-headers-4.15.0-106-generic linux-image-4.15.0-106-generic
  linux-modules-4.15.0-106-generic linux-modules-extra-4.15.0-106-generic
  nodejs-doc ros-melodic-dynamixel-workbench-single-manager
  ros-melodic-dynamixel-workbench-single-manager-gui
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 179 not upgraded.
Done.

Installing Node.js 10
Downloading from the Internet via curl.

## Installing the NodeSource Node.js 10.x repo...


## Populating apt-get cache...

+ apt-get update
Hit:1 https://deb.nodesource.com/node_10.x bionic InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease                     
Get:3 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]   
Hit:4 http://packages.ros.org/ros/ubuntu bionic InRelease                      
Get:5 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] 
Get:6 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]    
Hit:7 http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic InRelease
Hit:8 https://typora.io/linux ./ InRelease                                     
Fetched 252 kB in 1s (235 kB/s)                                                
Reading package lists... Done

## Confirming "bionic" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_10.x/dists/bionic/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
OK

## Creating apt sources list file for the NodeSource Node.js 10.x repo...

+ echo 'deb https://deb.nodesource.com/node_10.x bionic main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src https://deb.nodesource.com/node_10.x bionic main' >> /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
Hit:1 https://deb.nodesource.com/node_10.x bionic InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease                     
Get:3 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]   
Hit:4 http://packages.ros.org/ros/ubuntu bionic InRelease                      
Hit:5 https://typora.io/linux ./ InRelease                                     
Get:6 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] 
Get:7 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]    
Hit:8 http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic InRelease
Fetched 252 kB in 1s (442 kB/s)                                                
Reading package lists... Done

## Run `sudo apt-get install -y nodejs` to install Node.js 10.x and npm
## You may also need development tools to build native addons:
     sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
     echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn


Installing nodejs with apt-get
Reading package lists... Done
Building dependency tree       
Reading state information... Done
nodejs is already the newest version (10.23.2-1nodesource1).
The following packages were automatically installed and are no longer required:
  libc-ares2 libhttp-parser2.7.1 libllvm9 linux-headers-4.15.0-106
  linux-headers-4.15.0-106-generic linux-image-4.15.0-106-generic
  linux-modules-4.15.0-106-generic linux-modules-extra-4.15.0-106-generic
  nodejs-doc ros-melodic-dynamixel-workbench-single-manager
  ros-melodic-dynamixel-workbench-single-manager-gui
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 179 not upgraded.
Done.

Installing web-interface Node packages using npm.
audited 275 packages in 1.215s

6 packages are looking for funding
  run `npm fund` for details

found 1 high severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details
Done.

Installing MongoDB, which is used to store credentials for robot and operator logins.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mongodb is already the newest version (1:3.6.3-0ubuntu1.1).
The following packages were automatically installed and are no longer required:
  libc-ares2 libhttp-parser2.7.1 libllvm9 linux-headers-4.15.0-106
  linux-headers-4.15.0-106-generic linux-image-4.15.0-106-generic
  linux-modules-4.15.0-106-generic linux-modules-extra-4.15.0-106-generic
  nodejs-doc ros-melodic-dynamixel-workbench-single-manager
  ros-melodic-dynamixel-workbench-single-manager-gui
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 179 not upgraded.
Done.

Look at the following output to make sure the mongodb service is working.
● mongodb.service - An object/document-oriented database
   Loaded: loaded (/lib/systemd/system/mongodb.service; enabled; vendor preset: 
   Active: active (running) since Fri 2021-02-05 09:21:26 PST; 35min ago
     Docs: man:mongod(1)
 Main PID: 918 (mongod)
    Tasks: 24 (limit: 4915)
   CGroup: /system.slice/mongodb.service
           └─918 /usr/bin/mongod --unixSocketPrefix=/run/mongodb --config /etc/m

Feb 05 09:21:26 stretch-re1-1010 systemd[1]: Started An object/document-oriented

Hi @lgaloso, welcome to the forum! This “unauthorized login” error looks different than the one I’ve seen before. I’ve updated some NodeJS dependencies first. Can you perform an update using the following steps and try again.

roscd stretch_web_interface
git pull
rm -rf node_modules/
sudo ./bash_scripts/web_interface_installation.sh

If you continue to see the issue, please attach a log of everything printed in the terminal in which the start_desktop_dev_env.sh script was run. As you run through the login steps, additional print outs will show in the terminal.

Hi Binit,

Thank you so much for your help. I followed the steps you outline however I’m still running into the same “Not authorized to get robot.html” error. Below is the output from the terminal when running start_desktop_dev_env.sh:

leo@stretch-re1-1010:~$ roscd stretch_web_interface/bash_scripts/
leo@stretch-re1-1010:~/catkin_ws/src/stretch_web_interface/bash_scripts$ ./start_desktop_dev_env.sh 
****************************************
attempt to bring up desktop development environment

first making sure that the system is fully shutdown prior to bringing it up
./stop_desktop_dev_env.sh
****************************************
attempt to shutdown desktop development environment

remove environment variable for development environment
unset HELLO_ROBOT_ENV
[sudo] password for leo: 
sudo: unset: command not found

attempting to stop MongoDB...
sudo systemctl stop mongod.service
Failed to stop mongod.service: Unit mongod.service not loaded.

attempting to stop Redis...
sudo systemctl stop redis.service
Failed to stop redis.service: Unit redis.service not loaded.

attempting to stop the web server...
pkill -f "node ./bin/www"

finished attempt at shutting down the desktop development environment
****************************************

set environment variable for development environment
export HELLO_ROBOT_ENV="development"

attempting to start MongoDB...
sudo systemctl start mongod.service
Failed to start mongod.service: Unit mongod.service not found.

attempting to start Redis...
sudo systemctl start redis.service
Failed to start redis.service: Unit redis.service not found.

attempting to start the web server...
cd ../
sudo --preserve-env node ./bin/www &

finished attempt at bringing up the desktop development environment
****************************************
leo@stretch-re1-1010:~/catkin_ws/src/stretch_web_interface/bash_scripts$ start mongoose
WARNING: The `useMongoClient` option is no longer necessary in mongoose 5.x, please remove it.
    at handleUseMongoClient (/home/leo/catkin_ws/src/stretch_web_interface/node_modules/mongoose/lib/connection.js:957:17)
    at NativeConnection.Connection.openUri (/home/leo/catkin_ws/src/stretch_web_interface/node_modules/mongoose/lib/connection.js:728:7)
    at Mongoose.connect (/home/leo/catkin_ws/src/stretch_web_interface/node_modules/mongoose/lib/index.js:339:15)
    at Object.<anonymous> (/home/leo/catkin_ws/src/stretch_web_interface/app.js:41:10)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/leo/catkin_ws/src/stretch_web_interface/bin/www:4:21)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
use helmet
require https
set up the view engine
set up passport
make public directory contents available to everyone
configure passport
set up error handling
set port number to 443
listen to port 80
(node:11197) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
(node:11197) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
connection successful
GET / 200 252.616 ms - 1200
GET /stylesheets/style.css 200 2.036 ms - 777
GET /login 200 28.206 ms - 1621
GET /stylesheets/style.css 304 0.888 ms - -
POST /login 302 243.098 ms - 78
GET /robot/robot.html 403 0.570 ms - 32

It seems like MongoDB and Redis were not installed correctly. Could you run through the stretch_web_interface installation instructions once more, before sending a log of the “start_desktop_env.sh” script. The installation steps are:

roscd stretch_web_interface
git pull
rm -rf node_modules
sudo ./bash_scripts/web_interface_installation.sh

I ran through the installation instructions again and afterwords still received the same “Not authorized to get robot.html” error. See the attached output:

leo@stretch-re1-1010:~/catkin_ws/src/stretch_web_interface$ roscd stretch_web_interface/bash_scripts/
leo@stretch-re1-1010:~/catkin_ws/src/stretch_web_interface/bash_scripts$ ./start_desktop_dev_env.sh
****************************************
attempt to bring up desktop development environment

first making sure that the system is fully shutdown prior to bringing it up
./stop_desktop_dev_env.sh
****************************************
attempt to shutdown desktop development environment

remove environment variable for development environment
unset HELLO_ROBOT_ENV
[sudo] password for leo: 
Sorry, try again.
[sudo] password for leo: 
sudo: unset: command not found

attempting to stop MongoDB...
sudo systemctl stop mongod.service
Failed to stop mongod.service: Unit mongod.service not loaded.

attempting to stop Redis...
sudo systemctl stop redis.service
Failed to stop redis.service: Unit redis.service not loaded.

attempting to stop the web server...
pkill -f "node ./bin/www"

finished attempt at shutting down the desktop development environment
****************************************

set environment variable for development environment
export HELLO_ROBOT_ENV="development"

attempting to start MongoDB...
sudo systemctl start mongod.service
Failed to start mongod.service: Unit mongod.service not found.

attempting to start Redis...
sudo systemctl start redis.service
Failed to start redis.service: Unit redis.service not found.

attempting to start the web server...
cd ../
sudo --preserve-env node ./bin/www &

finished attempt at bringing up the desktop development environment
****************************************
leo@stretch-re1-1010:~/catkin_ws/src/stretch_web_interface/bash_scripts$ start mongoose
WARNING: The `useMongoClient` option is no longer necessary in mongoose 5.x, please remove it.
    at handleUseMongoClient (/home/leo/catkin_ws/src/stretch_web_interface/node_modules/mongoose/lib/connection.js:957:17)
    at NativeConnection.Connection.openUri (/home/leo/catkin_ws/src/stretch_web_interface/node_modules/mongoose/lib/connection.js:728:7)
    at Mongoose.connect (/home/leo/catkin_ws/src/stretch_web_interface/node_modules/mongoose/lib/index.js:339:15)
    at Object.<anonymous> (/home/leo/catkin_ws/src/stretch_web_interface/app.js:41:10)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/leo/catkin_ws/src/stretch_web_interface/bin/www:4:21)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
use helmet
require https
set up the view engine
set up passport
make public directory contents available to everyone
configure passport
set up error handling
set port number to 443
listen to port 80
(node:15510) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
(node:15510) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
connection successful
GET / 200 238.154 ms - 1200
GET /stylesheets/style.css 200 2.960 ms - 777
GET /login 200 32.848 ms - 1621
GET /stylesheets/style.css 200 0.889 ms - 777
POST /login 302 241.065 ms - 78
GET /robot/robot.html 403 0.810 ms - 32

Also when I ran stretch_web_interface web_interface.launch (prior to running start_desktop_env.sh) I received the following error: IOError: [Errno 2] No such file or directory: u'/home/leo/catkin_ws/src/stretch_ros/stretch_description/urdf/stretch.urdf'

The full terminal output is as follows:

Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 332, in main
    p.start()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/parent.py", line 289, in start
    self._start_infrastructure()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/parent.py", line 238, in _start_infrastructure
    self._load_config()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/parent.py", line 144, in _load_config
    roslaunch_strs=self.roslaunch_strs, verbose=self.verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/config.py", line 461, in load_config_default
    loader.load(f, config, argv=args, verbose=verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 761, in load
    self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 733, in _load_launch
    self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 699, in _recurse_load
    val = self._include_tag(tag, context, ros_config, default_machine, is_core, verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 96, in call
    return f(*args, **kwds)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 634, in _include_tag
    default_machine, is_core, verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 679, in _recurse_load
    self._param_tag(tag, context, ros_config, verbose=verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 96, in call
    return f(*args, **kwds)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 271, in _param_tag
    value = self.param_value(verbose, name, ptype, *vals)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/loader.py", line 476, in param_value
    with open(textfile, 'r') as f:
IOError: [Errno 2] No such file or directory: u'/home/leo/catkin_ws/src/stretch_ros/stretch_description/urdf/stretch.urdf'

Hi @lgaloso, I see a couple issues at play. Since you’ve created a new user, there’s a needed setup step that will place the “stretch.urdf” in the right place, and prevent the “No Such File” error you’re seeing. Additionally, the Redis and MongoDB services seem to be missing, despite the fact that you’ve run the install script.

To complete setup steps and debug the missing Linux services, I suggest we try a video call. I will ping you.

For anyone who finds this thread in the future, there were two issues at play here that we resolved offline.


If you are running a ROS command and see a URDF load error that looks like:

File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/loader.py", line 476, in param_value
    with open(textfile, 'r') as f:
IOError: [Errno 2] No such file or directory: u'/home/<user>/catkin_ws/src/stretch_ros/stretch_description/urdf/stretch.urdf'

This error occurs because some ROS node(s) is looking for a universal robot description file (URDF) called “stretch.urdf” to be in the stretch_description package. ROS software uses a URDF for many purposes, including robot visualization and determining frame transforms. You can regenerate this file using the following command:

rosrun stretch_calibration update_with_most_recent_calibration.sh

If you are creating a new user, you may use the instructions described here to setup a new user on the robot. This will automate the generation of the URDF as well as other setup steps.


If you see the “Not authorized to get robot.html” error that originally started this thread, one possible cause is explored here. Look for the following errors from the output when running the start_desktop_dev_env.sh command:

attempting to stop Redis...
sudo systemctl stop redis.service
Failed to stop redis.service: Unit redis.service not loaded.
[...]
attempting to start Redis...
sudo systemctl start redis.service
Failed to start redis.service: Unit redis.service not found.

This error is caused from the Redis database not being installed. You can install the software by running the following command:

sudo apt-get update
sudo apt-get --yes install redis