Open dkastl opened 6 months ago
I have not been able to reproduce this error. The hash value of the letsfiware.sh
file is different from the original one of 0.37.0. Please make a FIWARE instance again using the official release file.
$ cd FIWARE-Big-Bang-0.37.0/
$ cp -a config.sh{,.bak}
$ vi config.sh
$ diff config.sh config.sh.bak
97c97
< CYGNUS=cygnus
---
> CYGNUS=
100c100
< CYGNUS_MONGO=true
---
> CYGNUS_MONGO=
$ ./lets-fiware.sh letsfiware.jp
$ ngsi version --host cygnus.letsfiware.jp
{"success":"true","version":"3.2.0.9b21eae9095e3250ba8799e61411905d1c756191"}
$ make collect
./config/script/collect.sh
Sat May 25 18:16:53 JST 2024
Version: 0.37.0
OS: Ubuntu 2204
Docker: Docker version 26.1.3, build b72abbb
Docker compose: Docker Compose version v2.27.0
uid=1000(letsfiware) gid=1000(letsfiware) groups=1000(letsfiware),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),122(lpadmin),135(lxd),136(sambashare),999(docker)
Hash: af89b60a9483d6a8ac4a0a709c6638d909cf3773f0b1bb035d1548e994b4ef7a lets-fiware.sh
App list: KEYROCK ORION CYGNUS
Install: completed
WILMA_AUTH_ENABLED: false
Docker containers:
make[1]: Entering directory '/home/letsfiware/FIWARE-Big-Bang-0.37.0'
sudo ./setup/ps.sh
WARN[0000] /home/letsfiware/FIWARE-Big-Bang-0.37.0/docker-compose.yml: `version` is obsolete
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
fiware-big-bang-0370-cygnus-1 telefonicaiot/fiware-cygnus:3.2.0 "/cygnus-entrypoint.…" cygnus 2 hours ago Up 2 hours (healthy) 5050/tcp, 5080/tcp
fiware-big-bang-0370-keyrock-1 letsfiware/fiware-idm:8.4.0 "docker-entrypoint.s…" keyrock 2 hours ago Up 2 hours (healthy) 3000/tcp
fiware-big-bang-0370-mongo-1 mongo:4.4 "docker-entrypoint.s…" mongo 2 hours ago Up 2 hours 27017/tcp
fiware-big-bang-0370-mysql-1 mysql:8.1 "docker-entrypoint.s…" mysql 2 hours ago Up 2 hours 3306/tcp, 33060/tcp
fiware-big-bang-0370-nginx-1 nginx:1.25 "/docker-entrypoint.…" nginx 2 hours ago Up 2 hours 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp
fiware-big-bang-0370-orion-1 telefonicaiot/fiware-orion:3.10.1 "sh -c 'rm /tmp/cont…" orion 2 hours ago Up 2 hours (healthy) 1026/tcp
fiware-big-bang-0370-tokenproxy-1 letsfiware/tokenproxy:0.37.0 "docker-entrypoint.sh" tokenproxy 2 hours ago Up 2 hours 1029/tcp
fiware-big-bang-0370-wilma-1 letsfiware/fiware-pep-proxy:8.4.0 "docker-entrypoint.s…" wilma 2 hours ago Up 2 hours (unhealthy) 1027/tcp
make[1]: Leaving directory '/home/letsfiware/FIWARE-Big-Bang-0.37.0'
Keyrock:
{"keyrock":{"version":"8.4.0","release_date":"2023-06-09T13:19:25.000Z","uptime":"01:29:53.6","doc":"https://keyrock-fiware.github.io/","api":{"version":"v1","link":"https://keyrock.letsfiware.jp/v1"}}}
Thank you for taking a look!
I can confirm that it works with only postgres
enabled in a setup, where only "orion" and "cygnus" are configured with subdomain.
Before I tried with my original setup, that has many more services enabled, and the failure happend with main
, v37.0
and an updated Cygnus as I saw in your pull request.
So the problem must occur with more services enabled, and I can try to enable one by one.
Which would be the best log file to look at? Or, is there eventually a minimum requirement for server hardware, that prevents Cygnus to start correctly? Eventually 4GB RAM is not sufficient?
Just as a reference, the config.sh
I used has the following modifications:
diff --git a/config.sh b/config.sh
index 67b7d60..67e74e4 100755
--- a/config.sh
+++ b/config.sh
@@ -94,12 +94,12 @@ IMAGE_TIMESCALE=timescale/timescaledb-postgis:1.7.5-pg12
# Cygnus
#
# Set a sub-domain name of Cygnus
-CYGNUS=
+CYGNUS=cygnus
# Use Cygnus sink (true or false) Default: false
CYGNUS_MONGO=
CYGNUS_MYSQL=
-CYGNUS_POSTGRES=
+CYGNUS_POSTGRES=true
CYGNUS_ELASTICSEARCH=
# Expose port (none, local, all) Default: none
@@ -129,7 +129,7 @@ IMAGE_ELASTICSEARCH_DB=elasticsearch:7.6.2
# Comet
#
# Set a sub-domain name of Comet
-COMET=
+COMET=comet
# Expose port (none, local, all) Default: none
COMET_EXPOSE_PORT=
@@ -145,7 +145,7 @@ IMAGE_COMET=telefonicaiot/fiware-sth-comet:2.10.0
#
# Perseo
#
-PERSEO=
+PERSEO=perseo
# Perseo Max age (default: 6000)
PERSEO_MAX_AGE=
@@ -189,7 +189,7 @@ IMAGE_DRACO=ging/fiware-draco:2.1.0
# Quantumleap
#
# Set a sub-domain name of Quantumleap
-QUANTUMLEAP=
+QUANTUMLEAP=quantumleap
# Expose port (none, local, all) Default: none
QUANTUMLEAP_EXPOSE_PORT=
@@ -236,7 +236,7 @@ IMAGE_MEMCACHED=memcached:1
# IoT Agent over Mosquitto
#
# Set a sub-domain name of Mosquitto
-MOSQUITTO=
+MOSQUITTO=mosquitto
# Use MQTT (Port 1883). (true or false) Default: false
MQTT_1883=
@@ -261,7 +261,7 @@ IMAGE_MOSQUITTO=eclipse-mosquitto:1.6
# IoT Agent over HTTP
#
# Set a sub-domain name to use IoT Agent over HTTP.
-IOTAGENT_HTTP=
+IOTAGENT_HTTP=iotagent-http
# Authorization for IoT Agent over HTTP. (none, basic or bearer) Default: bearer
IOTA_HTTP_AUTH=
@@ -276,7 +276,7 @@ IOTA_HTTP_BASIC_PASS=
# IoT Agent for UltraLight 2.0
#
# Set a sub-domain name of IoT Agent for UltraLight 2.0
-IOTAGENT_UL=
+IOTAGENT_UL=iotagent-ul
IOTA_UL_DEFAULT_RESOURCE=/iot/ul
IOTA_UL_TIMESTAMP=true
@@ -292,7 +292,7 @@ IMAGE_IOTAGENT_UL=telefonicaiot/iotagent-ul:2.4.2
# IoT Agent for JSON
#
# Set a sub-domain name of IoT Agent for JSON
-IOTAGENT_JSON=
+IOTAGENT_JSON=iotagent-json
IOTA_JSON_DEFAULT_RESOURCE=/iot/json
IOTA_JSON_TIMESTAMP=true
@@ -308,11 +308,11 @@ IMAGE_IOTAGENT_JSON=telefonicaiot/iotagent-json:2.4.2
# Node-RED
#
# Set a sub-domain name of Node-RED
-NODE_RED=
+NODE_RED=nodered
# Node-RED multi instance
# Number of Node-RED instance. default: 1
-NODE_RED_INSTANCE_NUMBER=
+NODE_RED_INSTANCE_NUMBER=3
# username for Node-RED instance. default: node-red
NODE_RED_INSTANCE_USERNAME=
@@ -338,7 +338,7 @@ IMAGE_NODE_RED=letsfiware/node-red:0.37.0
# Grafana
#
# Set a sub-domain name of Grafana
-GRAFANA=
+GRAFANA=grafana
# Logging level for Grafana
# https://grafana.com/docs/grafana/latest/administration/configuration/#configure-with-environment-variables
Eventually Comet
makes a difference, beside enabling all database adapters.
The 502 Bad Gateway
error happens for Cygnus, when the default config.sh
is modified like
diff --git a/config.sh b/config.sh
index 67b7d60..7051045 100755
--- a/config.sh
+++ b/config.sh
@@ -94,12 +94,12 @@ IMAGE_TIMESCALE=timescale/timescaledb-postgis:1.7.5-pg12
# Cygnus
#
# Set a sub-domain name of Cygnus
-CYGNUS=
+CYGNUS=cygnus
# Use Cygnus sink (true or false) Default: false
CYGNUS_MONGO=
CYGNUS_MYSQL=
-CYGNUS_POSTGRES=
+CYGNUS_POSTGRES=true
CYGNUS_ELASTICSEARCH=
# Expose port (none, local, all) Default: none
@@ -129,7 +129,7 @@ IMAGE_ELASTICSEARCH_DB=elasticsearch:7.6.2
# Comet
#
# Set a sub-domain name of Comet
-COMET=
+COMET=comet
# Expose port (none, local, all) Default: none
COMET_EXPOSE_PORT=
This returns
$ sudo ngsi version --host cygnus.example.com | jq
cbVersion002 error 502 Bad Gateway <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
Cygnus works without comet
enabled:
diff --git a/config.sh b/config.sh
index 67b7d60..92fd770 100755
--- a/config.sh
+++ b/config.sh
@@ -94,12 +94,12 @@ IMAGE_TIMESCALE=timescale/timescaledb-postgis:1.7.5-pg12
# Cygnus
#
# Set a sub-domain name of Cygnus
-CYGNUS=
+CYGNUS=cygnus
# Use Cygnus sink (true or false) Default: false
CYGNUS_MONGO=
CYGNUS_MYSQL=
-CYGNUS_POSTGRES=
+CYGNUS_POSTGRES=true
CYGNUS_ELASTICSEARCH=
# Expose port (none, local, all) Default: none
And Cygnus works with Comet if all databases are set to true.
diff --git a/config.sh b/config.sh
index 67b7d60..5d16b4d 100755
--- a/config.sh
+++ b/config.sh
@@ -94,12 +94,12 @@ IMAGE_TIMESCALE=timescale/timescaledb-postgis:1.7.5-pg12
# Cygnus
#
# Set a sub-domain name of Cygnus
-CYGNUS=
+CYGNUS=cygnus
# Use Cygnus sink (true or false) Default: false
-CYGNUS_MONGO=
-CYGNUS_MYSQL=
-CYGNUS_POSTGRES=
+CYGNUS_MONGO=true
+CYGNUS_MYSQL=true
+CYGNUS_POSTGRES=true
CYGNUS_ELASTICSEARCH=
# Expose port (none, local, all) Default: none
@@ -129,7 +129,7 @@ IMAGE_ELASTICSEARCH_DB=elasticsearch:7.6.2
# Comet
#
# Set a sub-domain name of Comet
-COMET=
+COMET=comet
# Expose port (none, local, all) Default: none
COMET_EXPOSE_PORT=
Then the ngsi command return correctly
$ sudo ngsi version --host cygnus.example.com | jq
{
"success": "true",
"version": "3.2.0.9b21eae9095e3250ba8799e61411905d1c756191"
}
This error seems to occur when Cygnus mongodb and postgresql sinks are enabled.
CYGNUS_MONGO=true
CYGNUS_POSTGRES=true
CYGNUS_MONGO= | CYGNUS_MYSQL= | CYGNUS_POSTGRES= | OK/NG |
---|---|---|---|
true | true | NG | |
true | true | OK | |
true | true | OK | |
true | true | true | OK |
As a workaround, enable the cygnus mysql sink as well.
COMET=comet
CYGNUS=cygnus
CYGNUS_MONGO=
CYGNUS_MYSQL=true
CYGNUS_POSTGRES=true
Or disable STH-Comet.
COMET=
CYGNUS=cygnus
CYGNUS_MONGO=
CYGNUS_POSTGRES=true
Your configuration is bellow:
COMET=comet
CYGNUS=cygnus
CYGNUS_MONGO=
CYGNUS_POSTGRES=true
When enabled STH-Comet and Cygnus, the FIWARE Big Bang sets CYGNUS_MONGO to true
automatically
and support the formal mode (Cygnus + STH-Comet).
Therefore, your configuration is equivalent to:
COMET=comet
CYGNUS=cygnus
CYGNUS_MONGO=true
CYGNUS_POSTGRES=true
I see. That makes sense. And thank you for the suggestions!
I usually prefer PostgreSQL, if I have the choice. That's why I initially disabled the other alternatives. But there is no problem to enable all.
That said, I thought it may be helpful to report the problem here.
I put a question about this issue on the Stack Overflow site as shown: https://stackoverflow.com/questions/78565261/failed-to-connect-to-fiware-cygnus-3-8-0
Checklist Put an
x
in the boxes that applymake collect
command.Not sure I inspected all errors and logs, but unfortunately I already deleted my previous setup.
Describe the bug
When I run the sanity check for Cygnus I get a "502 Bad Gateway" response like
This happens, when only 1 sink is set to
true
. When 2 or more sinks are enabled, it seems to be working.Eventually there is a problem when
CYGNUS_MULTIAGENT
is not settrue
, see: https://github.com/lets-fiware/FIWARE-Big-Bang/blob/main/lets-fiware.sh#L2248-L2250Your system environment Run
make collect
in a directory where you ran the lets-fiware.sh script and paste the results here.To Reproduce Steps to reproduce the behavior:
true
. -> 502 Bad Gatewaytrue
. -> it worksExpected behavior A clear and concise description of what you expected to happen.
As descibed in the documentation it should return something like
Server (please complete the following information):