This project has moved and is read-only. For the latest updates, please go here.

Upload error with SQLite

Topics: 1. General
Sep 4, 2014 at 9:26 PM
Hello,
I try to upload my data from the sqlite database to PVoutput but I get an error. Only the first 29 records where uploaded. After that I get the following error in the Daemonlog:
[19:10:51] INFO: : Starting...
[19:10:52] WARNING: :  is not yet member of SBFspot Team. Consider joining at http://pvoutput.org/listteam.jsp?tid=613
[19:10:53] ERROR: : addBatchStatus() returned Failed writing received data to disk/application
[19:11:59] ERROR: : addBatchStatus() returned Failed writing received data to disk/application
[19:13:04] ERROR: : addBatchStatus() returned Failed writing received data to disk/application
[19:14:10] ERROR: : addBatchStatus() returned Failed writing received data to disk/application
[19:15:16] ERROR: : addBatchStatus() returned Failed writing received data to disk/application
[19:16:22] ERROR: : addBatchStatus() returned Failed writing received data to disk/application
[19:17:27] ERROR: : addBatchStatus() returned Failed writing received data to disk/application
[19:18:33] ERROR: : addBatchStatus() returned Failed writing received data to disk/application
[19:19:39] ERROR: : addBatchStatus() returned Failed writing received data to disk/application
Sep 4, 2014 at 10:14 PM
I really don't have an idea...
Maybe a reboot to start with?
Sep 5, 2014 at 8:01 PM
A reboot did not help.

I did build it on a RaspberryPi with Raspbian Jessie. It uses g++ 4.9.1.
After building the code on a RaspberryPi with Wheezy and copy it to the RaspberryPi with Jessie there where no problems.

The build on Jessie reported no error, not even a warning on the swp{b}.
Sep 5, 2014 at 8:25 PM
hetkasteel wrote:
After building the code on a RaspberryPi with Wheezy and copy it to the RaspberryPi with Jessie there where no problems.
good to know!
The build on Jessie reported no error, not even a warning on the swp{b}.
The swp{b} warning is caused by boost
Raspbian wheezy has 1.49, raspbian jessie has 1.52.

Thanks for the feedback
Sep 9, 2014 at 3:24 PM
I am using openSUSE 13.1 on the Raspberry Pi and so far SBFspot runs fine. Now I am trying to use 3.0 and SBFspot seems to run fine. However SBFspotUploadDaemon gives the same error messages as above. I found that standard g++ 4.8 was used. So now I am trying to compile with g++ 4.9. But I have the same error message.
Sep 9, 2014 at 7:49 PM
Edited Sep 11, 2014 at 12:04 PM
pi@raspberrypi ~ $ gcc --version
gcc (Debian 4.6.3-14+rpi1) 4.6.3

pi@raspberrypi ~ $ curl --version
curl 7.26.0 (arm-unknown-linux-gnueabihf) libcurl/7.26.0 OpenSSL/1.0.1e zlib/1.2.7 libidn/1.25 libssh2/1.4.2 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: Debug GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP
Sep 9, 2014 at 8:40 PM
 sma@smahp:~> gcc --version
 gcc (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision 202388]
 Copyright (C) 2013 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO 
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 sma@smahp:~> curl --version
 curl 7.32.0 (armv6hl-suse-linux-gnueabi) libcurl/7.32.0 OpenSSL/1.0.1e zlib/1.2.8 libidn/1.25 libssh2/1.4.3
 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp 
 Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP 
 sma@smahp:~>
Sep 9, 2014 at 8:44 PM
Edited Sep 9, 2014 at 8:45 PM
I found some parameters read from the config file, SBFspotUpload.cfg, like verbose_level and debug_level which I gave the values 5, but I don't see any extra output. A bogus parameter does produce a warning.
Sep 10, 2014 at 10:37 AM
Using wireshark I analyzed the traffic from SBFspotUploadDaemon. It appears that it is repeatedly uploading the first entries in the SQLite database. It receives a 200 OK and stops the upload. After about 1 minute it repeats this. I am still uploading measurements using SBFspot 2.4.5, but I tried stopping this upload for 15 minutes, but still the same problem.
Sep 10, 2014 at 12:32 PM
Edited Sep 11, 2014 at 12:05 PM
Seems daemon is failing after upload and is unable to set the pvoutput flag, causing to re-upload every time
Sep 10, 2014 at 2:39 PM
Below is content of the TCPstream from/to SBFspotUploadDaemon:
After one minute the same is send apart from the Date: and Set-Cookie:
I have the feeling SBFspotUploadDaemon is not processing the returned data properly.
Does the 1 in the response from pvoutput.org after the date,time mean it is present?

POST /service/r2/addbatchstatus.jsp HTTP/1.1
Host: pvoutput.org
Accept: /
X-Pvoutput-SystemId: xxxxx
X-Pvoutput-Apikey: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
Content-Length: 810
Content-Type: application/x-www-form-urlencoded

c1=1&data=20140908,07:35,2015560,0;20140908,07:40,2015562,24;20140908,07:45,2015565,36;20140908,07:50,2015569,48;20140908,07:55,2015574,60;20140908,08:00,2015579,60;20140908,08:05,2015586,84;20140908,08:10,2015594,96;20140908,08:15,2015603,108;20140908,08:20,2015615,144;20140908,08:25,2015629,168;20140908,08:30,2015645,192;20140908,08:35,2015664,228;20140908,08:40,2015686,264;20140908,08:45,2015711,300;20140908,08:50,2015740,348;20140908,08:55,2015770,360;20140908,09:00,2015804,408;20140908,09:05,2015841,444;20140908,09:10,2015881,480;20140908,09:15,2015926,540;20140908,09:20,2015974,576;20140908,09:25,2016026,624;20140908,09:30,2016081,660;20140908,09:35,2016140,708;20140908,09:40,2016202,744;20140908,09:45,2016266,768;20140908,09:50,2016334,816;20140908,09:55,2016409,900;20140908,10:00,2016484,900

HTTP/1.1 200 OK
Date: Wed, 10 Sep 2014 08:36:36 GMT
Set-Cookie: JSESSIONID=ohwwpo8de3tj1ndhxx0yld9nl;Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 509
Server: Jetty(7.6.3.v20120416)

20140908,07:35,1;20140908,07:40,1;20140908,07:45,1;20140908,07:50,1;20140908,07:55,1;20140908,08:00,1;20140908,08:05,1;20140908,08:10,1;20140908,08:15,1;20140908,08:20,1;20140908,08:25,1;20140908,08:30,1;20140908,08:35,1;20140908,08:40,1;20140908,08:45,1;20140908,08:50,1;20140908,08:55,1;20140908,09:00,1;20140908,09:05,1;20140908,09:10,1;20140908,09:15,1;20140908,09:20,1;20140908,09:25,1;20140908,09:30,1;20140908,09:35,1;20140908,09:40,1;20140908,09:45,1;20140908,09:50,1;20140908,09:55,1;20140908,10:00,1
Sep 10, 2014 at 3:42 PM
Yes, 1 means "The status was successfully added"
I suppose it is visible in PVO?
I'll try to setup a system with recent gcc to see if I can reproduce it.
This will take some time, so maybe it's better to roll-back to 2.4.5
Sep 10, 2014 at 9:47 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Sep 11, 2014 at 12:02 PM
You can find the solution here
Marked as answer by SBF on 9/12/2014 at 3:44 AM