Streamsheet cannot access "ip:8081" on anther device (returned 502 badgateway)

Hello, all

I installed the streamsheets on my Raspberry Pi via “curl -fsSL raw.githubusercontent.com/cedalo/streamsheets-installer/master/pi-installer.sh -o get-streamsheets.sh && sh get-streamsheets.sh” but I can’t access the webui of streamsheets via url “ip:8081” using my PC in the same network. It returned 502 badgateway page of Nginx.

I tried to find the nginx log file but I can’t find it. And everything goes well, but there is an error “streamsheets-internal-mongodb exited with code 132” when I run start.sh. I am guessing whether it is this error results the “inaccessible” error.

Device: Raspberry Pi 3B+ and 4B
OS: Ubuntu 20.04LTS

Thinks!!!

LOG:
management-center_1 | Starting Management Center for Eclipse Mosquitto
streamsheets_1 | Password for default Mosquitto exists
mosquitto_1 | 1663660865: mosquitto version 2.0.15 starting
mosquitto_1 | 1663660865: Config loaded from /mosquitto/config/mosquitto.conf.
mosquitto_1 | 1663660865: Loading plugin: /usr/lib/mosquitto_dynamic_security.so
streamsheets_1 | 2022-09-20 08:01:10,678 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
streamsheets-internal-mongodb exited with code 132
mosquitto_1 | 1663660865: Opening ipv4 listen socket on port 1883.
mosquitto_1 | 1663660865: Opening ipv6 listen socket on port 1883.
streamsheets_1 | 2022-09-20 08:01:10,711 INFO supervisord started with pid 8
mosquitto_1 | 1663660865: mosquitto version 2.0.15 running
streamsheets_1 | 2022-09-20 08:01:11,716 INFO spawned: ‘mosquitto’ with pid 10
streamsheets_1 | 2022-09-20 08:01:11,721 INFO spawned: ‘mosquitto-default’ with pid 11
streamsheets_1 | 2022-09-20 08:01:11,726 INFO spawned: ‘nginx’ with pid 12
streamsheets_1 | 2022-09-20 08:01:11,732 INFO spawned: ‘redis’ with pid 13
streamsheets_1 | 2022-09-20 08:01:11,739 INFO spawned: ‘gateway’ with pid 14
streamsheets_1 | 2022-09-20 08:01:11,746 INFO spawned: ‘service-graphs’ with pid 15
streamsheets_1 | 2022-09-20 08:01:11,753 INFO spawned: ‘service-machines’ with pid 16
streamsheets_1 | 2022-09-20 08:01:11,760 INFO spawned: ‘service-streams’ with pid 17
streamsheets_1 | 2022-09-20 08:01:12,843 INFO success: mosquitto entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
streamsheets_1 | 2022-09-20 08:01:12,843 INFO success: mosquitto-default entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
streamsheets_1 | 2022-09-20 08:01:12,844 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
streamsheets_1 | 2022-09-20 08:01:12,844 INFO success: redis entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
streamsheets_1 | 2022-09-20 08:01:12,844 INFO success: gateway entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
streamsheets_1 | 2022-09-20 08:01:12,844 INFO success: service-graphs entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
streamsheets_1 | 2022-09-20 08:01:12,844 INFO success: service-machines entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
streamsheets_1 | 2022-09-20 08:01:12,845 INFO success: service-streams entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
management-center_1 | [Error: ENOENT: no such file or directory, access ‘/management-center/src/license/utils/config/license.lic’] {
management-center_1 | errno: -2,
management-center_1 | code: ‘ENOENT’,
management-center_1 | syscall: ‘access’,
management-center_1 | path: ‘/management-center/src/license/utils/config/license.lic’
management-center_1 | }
management-center_1 | /management-center/src/license/utils
management-center_1 | undefined
management-center_1 | Tue, 20 Sep 2022 08:01:22 GMT express-session deprecated undefined resave option; provide resave option at start.js:179:10
management-center_1 | Tue, 20 Sep 2022 08:01:22 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at start.js:179:10
management-center_1 | Connecting to “Mosquitto 2.0” on mqtt://mosquitto:1883
management-center_1 | Started Mosquitto proxy at http://localhost:8088
management-center_1 | “CEDALO_MC_PLUGIN_DIR” is not set. Skipping loading of plugins
management-center_1 | Mosquitto proxy server started on port 8088
mosquitto_1 | 1663660882: New connection from …:57844 on port 1883.
mosquitto_1 | 1663660882: New client connected from …:57844 as mqttjs_ebae09f3 (p2, c1, k60, u’cedalo’).
management-center_1 | Connected to ‘Mosquitto 2.0’ at mqtt://mosquitto:1883

Hi Oliver,

we are using arm32 images. If you are using an Ubuntu 64 arch, then this might be the problem at hand.
If not, can you please have a look into your mongodb logs:

docker logs streamsheets-internal-mongodb

Let me know what you find, and I can see how I can help you further :slight_smile:

Hi,
Thanks for your kindly reply.

About mongodb

When I run docker logs streamsheets-internal-mongodb, there is nothing.

More

But I find another message when I run start.sh:

streamsheets_1 | sed: can’t move ‘streamsheets/packages/gateway/config/init.jsonKiMnPN’ to ‘streamsheets/packages/gateway/config/init.json’: Resource busy

I was wondering whether if this may be related to the 502 bad gateway error? And how I can find
the logs of nginx service or its config file?

Thanks again for your great help!!!


Logs of streamsheets

Here are logs of streamsheets(run docker logs cedalo_platform_streamsheets_1):
assword for default Mosquitto does not exist, will create one.
sed: can’t move ‘streamsheets/packages/gateway/config/init.jsonKiMnPN’ to ‘streamsheets/packages/gateway/config/init.json’: Resource busy
Password for default Mosquitto created successfully.
Hashed password for Mosquitto broker is located inside the installation directory in the file settings/mosquitto/pw.txt.
Clear text password for Mosquitto broker is located inside the installation directory in the file settings/mosquitto/pw_clear.txt.
Warning: for security reasons please copy the password from settings/mosquitto/pw_clear.txt and delete that file afterwards.
2022-09-21 02:24:20,027 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
2022-09-21 02:24:20,053 INFO supervisord started with pid 15
2022-09-21 02:24:21,062 INFO spawned: ‘mosquitto’ with pid 17
2022-09-21 02:24:21,072 INFO spawned: ‘mosquitto-default’ with pid 18
2022-09-21 02:24:21,081 INFO spawned: ‘nginx’ with pid 19
2022-09-21 02:24:21,093 INFO spawned: ‘redis’ with pid 20
2022-09-21 02:24:21,107 INFO spawned: ‘gateway’ with pid 21
2022-09-21 02:24:21,123 INFO spawned: ‘service-graphs’ with pid 22
2022-09-21 02:24:21,137 INFO spawned: ‘service-machines’ with pid 23
2022-09-21 02:24:21,152 INFO spawned: ‘service-streams’ with pid 24
2022-09-21 02:24:22,177 INFO success: mosquitto entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-09-21 02:24:22,178 INFO success: mosquitto-default entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-09-21 02:24:22,179 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-09-21 02:24:22,180 INFO success: redis entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-09-21 02:24:22,180 INFO success: gateway entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-09-21 02:24:22,181 INFO success: service-graphs entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-09-21 02:24:22,182 INFO success: service-machines entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-09-21 02:24:22,182 INFO success: service-streams entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Hi Oliver,

you can find the nginx logs inside the docker container at /var/log/nginx/.
But this will probably not help you.
Streamsheets waits for the MongoDB to be ready before it starts, so you’ll have to get the MongoDB running first.

To fix that, it would be good to know which Ubuntu version you are running: 32 or 64 bit.
You can check that with uname -a.
If you are running the 64-bit image you need to update the image used for the streamsheets-internal-mongodb in the docker-compose.yml. Replace andresvidal/rpi3-mongodb3 with mongo:4.2 and do a docker-compose pull followed by a docker-compose up -d.

Hi Andreas,

I checked the version of my OS. It is the 64bit arch. I replaced the andresvidal/rpi3-mongodb3 with mongo:4.2, and then it worked.

Thanks a lot for your help!!!