cumulocity string template expand issue - cumulocity

I am trying to expand string template for the cumulocity data.
example ex-03-measurement.
I changed like below
//===================================================================
10,103,POST,/measurement/measurements,application/json,,%%,NOW UNSIGNED NUMBER NUMBER NUMBER NUMBER,"{""time"":""%%"",""source"":{""id"":""%%""},""type"":""c8y_RHTMeasurement"",""c8y_RHTMeasurement"":{""RH"":{""value"":%%,""unit"":""%""},""Temperature"":{""value"":%%,""unit"":""C""},""Temperature1"":{""value"":%%,""unit"":""C""},""Temperature2"":{""value"":%%,""unit"":""C""}}}"
//==================================================================
And I use the code like below
//==================================================================
agent.send("103," + agent.ID() + "," + to_string(rh) + "," + to_string(temperature)+ "," + to_string(temperature)+"," + to_string(temperature));
//==================================================================
I always get response is
Is there have any one know how to expand the data on cumulocity server?
Add software debug log
Mar 30 11:17:28 DEBUG: HTTP recv:
Mar 30 11:17:28 INFO: reporter: listening...
==============Mar 30 11:17:29 DEBUG: HTTP post: 15,24555
103,78561,86.000000,83.000000,83.000000,83.000000
Mar 30 11:17:29 DEBUG: HTTP recv: 45,2,Wrong number of arguments
Mar 30 11:17:29 DEBUG: Drop Msg 45
==============Mar 30 11:17:30 DEBUG: HTTP post: 15,24555
103,78561,15.000000,77.000000,77.000000,77.000000
Mar 30 11:17:30 DEBUG: HTTP recv: 45,2,Wrong number of arguments
Mar 30 11:17:30 DEBUG: Drop Msg 45
==============Mar 30 11:17:31 DEBUG: HTTP post: 15,24555
103,78561,35.000000,93.000000,93.000000,93.000000
Mar 30 11:17:31 DEBUG: HTTP recv: 45,2,Wrong number of arguments
Mar 30 11:17:31 DEBUG: Drop Msg 45
==============Mar 30 11:17:32 DEBUG: HTTP post: 15,24555
103,78561,92.000000,86.000000,86.000000,86.000000
Mar 30 11:17:32 DEBUG: HTTP recv: 45,2,Wrong number of arguments
Mar 30 11:17:32 DEBUG: Drop Msg 45
==============Mar 30 11:17:33 DEBUG: HTTP post: 15,24555
103,78561,21.000000,49.000000,49.000000,49.000000
Mar 30 11:17:33 DEBUG: HTTP recv: 45,2,Wrong number of arguments
Mar 30 11:17:33 DEBUG: Drop Msg 45
==============Mar 30 11:17:34 DEBUG: HTTP post: 15,24555
103,78561,27.000000,62.000000,62.000000,62.000000
Mar 30 11:17:34 DEBUG: HTTP recv: 45,2,Wrong number of arguments

Finally
I found the problem is My program *srversion can't be the same as before i tried.
I learned a debug method for cumulocity.
1.changed your string template in your program.
2.Using curl to get the server recieved template.
$ curl -u https://.cumulocity.com/inventory/managedObjects/X-Id
and then check the template is the same as template in your code.
thanks for your help.

Related

while using signalr getting error in connection build

link:-https://github.com/jonathanzufi/SignalR-ReactNativeClient
using this library and getting error in building connection
error: [2021-10-21T11:37:44.853Z] Debug: Starting HubConnection.
[Thu Oct 21 2021 17:07:43.711] LOG [2021-10-21T11:37:44.854Z] Debug: Starting connection with transfer format 'Text'.
[Thu Oct 21 2021 17:07:43.712] LOG [2021-10-21T11:37:44.855Z] Debug: Sending negotiation request: https://signalrdemo.com/chatHub/negotiate?negotiateVersion=1.
[Thu Oct 21 2021 17:07:43.714] LOG {"_40": 0, "_55": null, "_65": 0, "_72": null} connect
[Thu Oct 21 2021 17:07:43.721] WARN [2021-10-21T11:37:44.887Z] Warning: Error from HTTP request. 0: undefined.
[Thu Oct 21 2021 17:07:43.772] LOG Global error handler
[Thu Oct 21 2021 17:07:43.818] LOG Global error handler
[Thu Oct 21 2021 17:07:43.820] LOG [2021-10-21T11:37:44.946Z] Debug: HubConnection failed to start successfully because of error 'Error'.
[Thu Oct 21 2021 17:07:43.820] LOG [Error] err::::::::::::::
[Thu Oct 21 2021 17:07:43.821] LOG Error starting the connection: Error
technology used :-react-native

How to fix: Varnish not enabling on Apache

New server setup, but testing Varnish, after installation, does not show the expected result. It does not look like Varnish is configured correctly for Apache.
The server is CentOS 7, running Apache 2.4, Redis, RabbitMQ and Varnish 5.2.
I have followed the instructions to change Varnish listening port to 80, and changed backend defaults to .port ="8080" in /etc/varnish/default.vcl and VARNISH_LISTEN_PORT=80 in /etc/varnish/varnish.params
backend default {
.host = "164.160.89.188";
.port = "8080";
}
when I restart Varnish and Apache and run the command
curl -I http://localhost
I get the following results:
HTTP/1.1 200 OK
Date: Wed, 12 Jun 2019 12:45:59 GMT
Last-Modified: Wed, 30 Jan 2019 02:03:25 GMT
Content-Type: text/html
Vary: Accept-Encoding
Pragma: no-cache
Expires: -1
Cache-Control: no-store, no-cache, must-revalidate, max-age=0
Accept-Ranges: bytes
Connection: keep-alive
I should be getting something like this
X-Varnish: 13
Age: 0
Via: 1.1 varnish-v5
Varnish Status shows the following
varnish.service - Varnish Cache, a high-performance HTTP accelerator
Loaded: loaded (/usr/lib/systemd/system/varnish.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2019-06-12 13:40:35 SAST; 3h 25min ago
Main PID: 4074 (varnishd)
CGroup: /system.slice/varnish.service
├─4074 /usr/sbin/varnishd -a :80 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
└─4084 /usr/sbin/varnishd -a :80 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
Jun 12 13:40:35 server2.co.za systemd[1]: Starting Varnish Cache, a high-performance HTTP accelerator...
Jun 12 13:40:35 server2.co.za varnishd[4074]: Platform: Linux,3.10.0,x86_64,-junix,-smalloc,-smalloc,-hcritbit
Jun 12 13:40:35 server2.co.za varnishd[4073]: Debug: Platform: Linux,3.10.0,x86_64,-junix,-smalloc,-smalloc,-hcritbit
Jun 12 13:40:35 server2.co.za varnishd[4074]: Child (4084) Started
Jun 12 13:40:35 server2.co.za varnishd[4073]: Debug: Child (4084) Started
Jun 12 13:40:35 server2.co.za varnishd[4074]: Child (4084) said Child starts
Jun 12 13:40:35 server2.co.za systemd[1]: Started Varnish Cache, a high-performance HTTP accelerator.
It seems Apache sends a Pragma header, the quick fix is to write "unset beresp.http.Pragma" in vcl_backend_response and it will unset the pragma header and start caching content, but you might want to check why Apache sends the header.

Error setting up Sauce Connect - Sauce Labs: Error checking overlapping tunnels

Tried setting up sauce connect, but get an error.
Details below:
(I also tried opening ports 443 (outbound), 80, 60, 4445 (inbound) - but nothing changed)
I run :
bin/sc -u [USERNAME] -k [KEY]
And Get:
> 15 Nov 18:30:42 - Sauce Connect 4.4.1, build 958 c1c1e98-dirty
> 15 Nov 18:30:42 - Starting up; pid 19768
> 15 Nov 18:30:42 - Command line arguments: C:\Users\[folder]\Desktop\sauce-connect\bin\sc.exe -u [username]
> 15 Nov 18:30:42 - Log file: /tmp/sc.log
> 15 Nov 18:30:42 - Pid file: C:\Users\[folder]\AppData\Roaming/sc_client.pid
> 15 Nov 18:30:42 - Timezone: Eastern Standard Time GMT OFfset: -5h
> 15 Nov 18:30:42 - Using no proxy for connecting to Sauce Labs REST API.
> 15 Nov 18:30:42 - Resolving saucelabs.com to 162.222.75.243 took 5 ms.
> 15 Nov 18:31:16 - Started scproxy on port 17809.
> 15 Nov 18:31:16 - Please wait for 'you may start your tests' to start your tests.
> 15 Nov 18:31:16 - Starting secure remote tunnel VM...
> 15 Nov 18:31:48 - GET https://saucelabs.com/rest/v1/[username]/tunnels?full=1: Timeout was
> reached.
> 15 Nov 18:31:48 - Error checking overlapping tunnels.
> 15 Nov 18:31:48 - Cleaning up.
> 15 Nov 18:31:48 - Sauce Connect could not establish a connection.
> 15 Nov 18:31:48 - Please check your firewall and proxy settings.
> 15 Nov 18:31:48 - You can also use sc --doctor to launch Sauce Connect in diagnostic mode.
> 15 Nov 18:31:48 - Goodbye.

PGAgent : Caught unhandled unknown exception; terminating

The trouble with constantly running jobs on postgre DB, which will never finished.
I have tried the following actions to fix it:
apt-get update & upgrade(postgresql was updated to latest)
/etc/init.d/postgresql restart
postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled)
Active: active (exited) since Fri 2015-10-16 10:06:04 UTC; 9s ago
Process: 6787 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 6787 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/postgresql.service
/etc/init.d/pgagent restart
pgagent.service - Postgres Job Agent Daemon
Loaded: loaded (/lib/systemd/system/pgagent.service; enabled)
Active: active (running) since Fri 2015-10-16 10:06:04 UTC; 1min 48s ago
Main PID: 6793 (pgagent)
CGroup: /system.slice/pgagent.service
└─6793 /usr/bin/pgagent -f -l 2 -s /var/log/pgagent hostaddr=localhost dbname=postgres user=postgresext
Oct 16 10:07:00 m-t-db-01 pgagent[6793]: *** Caught unhandled unknown exception; terminating
Oct 16 10:07:50 m-t-db-01 pgagent[6793]: *** Caught unhandled unknown exception; terminating
tried to enable debug mode on pgagent vim /etc/default/pgagent
EXTRA_OPTS="-f -l 2 -s /var/log/pgagent hostaddr=localhost dbname=postgres user=postgresext"
tried to reboot the machine
in /var/log/pgagent log I see only:
ERROR: Failed to query jobs table!
DEBUG: Creating primary connection
DEBUG: Connection Information:
DEBUG: user : postgresext
DEBUG: port : 0
DEBUG: host : localhost
DEBUG: dbname : postgres
DEBUG: password :
DEBUG: conn timeout : 0
DEBUG: Connection Information:
DEBUG: user : postgresext
DEBUG: port : 0
DEBUG: host : localhost
DEBUG: dbname : postgres
DEBUG: password :
DEBUG: conn timeout : 0
DEBUG: Creating DB connection: user=postgresext host=localhost dbname=postgres
DEBUG: Database sanity check
DEBUG: Clearing zombies
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
DEBUG: Clearing inactive connections
DEBUG: Connection stats: total - 1, free - 0, deleted - 0
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
DEBUG: Creating primary connection
DEBUG: Connection Information:
DEBUG: user : postgresext
DEBUG: port : 0
DEBUG: host : localhost
DEBUG: dbname : postgres
DEBUG: password :
DEBUG: conn timeout : 0
DEBUG: Connection Information:
DEBUG: user : postgresext
DEBUG: port : 0
DEBUG: host : localhost
DEBUG: dbname : postgres
DEBUG: password :
DEBUG: conn timeout : 0
DEBUG: Creating DB connection: user=postgresext host=localhost dbname=postgres
DEBUG: Database sanity check
DEBUG: Clearing zombies
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
DEBUG: Clearing inactive connections
DEBUG: Connection stats: total - 1, free - 0, deleted - 0
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
DEBUG: Clearing inactive connections
DEBUG: Connection stats: total - 1, free - 0, deleted - 0
DEBUG: Checking for jobs to run
DEBUG: Creating job thread for job 8
DEBUG: Creating DB connection: user=postgresext host=localhost dbname=postgres
DEBUG: Allocating new connection to database postgres
DEBUG: Starting job: 8
DEBUG: Creating job thread for job 5
DEBUG: Creating DB connection: user=postgresext host=localhost dbname=postgres
DEBUG: Allocating new connection to database postgres
DEBUG: Starting job: 5
DEBUG: Creating DB connection: user=postgresext host=localhost dbname=postgres dbname=testdb
DEBUG: Sleeping...
DEBUG: Allocating new connection to database testdb
DEBUG: Executing SQL step 23 (part of job 8)
DEBUG: Creating DB connection: user=postgresext host=localhost dbname=postgres dbname=testdb
DEBUG: Allocating new connection to database testdb
DEBUG: Executing SQL step 15 (part of job 5)
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
DEBUG: Clearing inactive connections
DEBUG: Connection stats: total - 5, free - 0, deleted - 0
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
DEBUG: Destroying job thread for job 8
DEBUG: Clearing inactive connections
DEBUG: Connection stats: total - 5, free - 0, deleted - 0
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
DEBUG: Clearing inactive connections
DEBUG: Connection stats: total - 5, free - 0, deleted - 0
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
DEBUG: Clearing inactive connections
DEBUG: Connection stats: total - 5, free - 0, deleted - 0
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
DEBUG: Clearing inactive connections
DEBUG: Connection stats: total - 5, free - 0, deleted - 0
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
in vim /var/log/postgresql/postgresql-9.4-main.log I see only:
[unknown]#[unknown] LOG: incomplete startup packet
LOG: MultiXact member wraparound protections are now enabled
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
postgresext#postgres LOG: could not receive data from client: Connection reset by peer
postgresext#testdb LOG: could not receive data from client: Connection reset by peer
postgresext#postgres LOG: could not receive data from client: Connection reset by peer
postgresext#postgres LOG: could not receive data from client: Connection reset by peer
postgresext#testdb LOG: could not receive data from client: Connection reset by peer
postgresext#postgres LOG: could not receive data from client: Connection reset by peer
postgresext#postgres LOG: could not receive data from client: Connection reset by peer
postgresext#testdb LOG: could not receive data from client: Connection reset by peer
postgresext#testdb LOG: could not receive data from client: Connection reset by peer
postgresext#testdb LOG: could not receive data from client: Connection reset by peer
postgresext#postgres LOG: could not receive data from client: Connection reset by peer
I cannot figure out what the actual problem and how to fix it actually?
One more thing I have investigated is that pgagent[6793]: *** Caught unhandled unknown exception; terminating can be invoked by incorrect connection termination...
A little bit late to answering this, but I ran into the same issues when using pgAgent, and it caused nothing but frustration. I even tried to dig into the source to fix it, but just trying to get it to compile on my server was a total nightmare due to the dependencies it requires (for no good reason).
So with that in mind, I decided to write a new job scheduler for Postgres as a drop in replacement for pgAgent. It's called jpgAgent, and i've been using it at my company for a couple months now with no issues at all. Much more stable now that we're using jpgAgent, don't have to worry about the agent just stopping on us randomly and jobs not getting run as they should, where as previously that was a common problem.
Anyways, hope it helps you out.

IE 11 shows "Page can't be displayed" on long running backend servlet processing

I have a servlet that takes more than 6 minutes to complete a operation. The application is hosted on weblogic 12c that is accessed via BIGIP F5 load balancer and then a apache server. Apache uses wl_proxy to communicate with weblogic. Whenever this servlet is called IE shows "This page can't be displayed". I turned on the wl_proxy log on apache server and found the following:
Exception type [READ_TIMEOUT] (no read after 300 seconds) raised at line 212 of ../nsapi/Reader.cpp
So I added the WLIOTimeout directive in wl_proxy.conf that fixed the one part of the problem. Still it shows the same error exactly after 5 minutes, and this time I saw the following error in wl_proxy log:
Fri Jul 31 12:49:05 2015 <396114383469453> created a new connection to preferred server 'xxx.x.xxx.xxx/5096' for '/getUserActivitiesReport.do?action=GENERATEREPORT', Local port:36249
Fri Jul 31 12:55:02 2015 <396114383469453> URL::parseHeaders: CompleteStatusLine set to [HTTP/1.1 200 OK]
Fri Jul 31 12:55:02 2015 <396114383469453> URL::parseHeaders: StatusLine set to [200 OK]
Fri Jul 31 12:55:02 2015 <396114383469453> parsed all headers OK
Fri Jul 31 12:55:02 2015 <396114383469453> sendResponse() : r->status = '200'
Fri Jul 31 12:55:02 2015 <396114383469453> Write to the browser failed: calling URL::close at line 680 of ap_proxy.cpp
Fri Jul 31 12:55:02 2015 <396114383469453> *******Exception type [WRITE_ERROR_TO_CLIENT] raised at line 681 of ap_proxy.cpp
Fri Jul 31 12:55:02 2015 <396114383469453> *NOT* failing over after sendResponse() exception: WRITE_ERROR_TO_CLIENT
Fri Jul 31 12:55:02 2015 <396114383469453> request [/getUserActivitiesReport.do?action=GENERATEREPORT] did NOT process successfully..................
Aapache access log for this request:
xxx.xxx.xxx.xxx - - [31/Jul/2015:12:49:05 +0000] "POST /getUserActivitiesReport.do?action=GENERATEREPORT HTTP/1.1" 200 10 "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko" "PsHK9qECrbkAAA95AFgAAAAG" 80 357322233
Now why the browser closed the connection! AFAIK the IE 11 times out after 60 minutes. Also in the IE developer I saw the connection as "Aborted".
Could any one faced this types of issue. Any idea if there is any timeout set at F5 level?
Thanks in advance,
Debojit
I have the same problem, the solution is add this two parameters in the Weblogic plug-in configuration:
WLIOTimeoutSecs 14400
WLSocketTimeoutSecs 14400
Be careful with the parameters (14400), this are only examples.
And restart your http server.
My configuration:
<IfModule mod_weblogic.c>
<Location />
WebLogicHost 172.x.x.x
WebLogicPort 7003
SetHandler weblogic-handler
WLIOTimeoutSecs 14400
WLSocketTimeoutSecs 14400
</Location>
</IfModule>
More info: Doc ID 2554989.1 and
https://docs.oracle.com/middleware/12211/webtier/develop-plugin/PLGWL.pdf