call to /db/backup results to 500 response

23 views
Skip to first unread message

Yannick G

unread,
Jan 9, 2022, 9:58:50 AM1/9/22
to rqlite
I have troubles making backup by calling
$ curl -X GET leader-ip:4001/db/backup --output whatever.sqlite3

The error msg is :
500 backup database: database or disk is full

DB is only 50MB on a disk of 20GB

A call to http://10.0.4.20:4001/db/backup?fmt=sql gives the output correct

I tried to clean up tmp files on node but without success

My host has free disk space far enough

Please help :)

Philip O'Toole

unread,
Jan 9, 2022, 12:23:36 PM1/9/22
to rql...@googlegroups.com
Hmmm, this is an error from SQLite, not your operating system. It has nothing to do with the disk space on your machine.

I need the following information:
  • Are you running with an in-memory SQLite database (the default) or an on-disk database (-on-disk)?
  • Show me the output of 'curl leader-ip:4001/status?pretty' when this happens.
Philip

--
You received this message because you are subscribed to the Google Groups "rqlite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rqlite+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rqlite/722b2848-d414-4aad-924f-ed14a538ba64n%40googlegroups.com.

Yannick G

unread,
Jan 9, 2022, 6:37:03 PM1/9/22
to rql...@googlegroups.com
All right. For now I can't reproduce. 3 nodes on-disk. I re-initialized the cluster by wiping up ~/node and restarting everything. Maybe it's possible I made bad things, such as accessing files to check if data is correctly written [still in experimentation]. In this kind of situation, does it help adding a new write node and stop the current leader ?

Philip O'Toole

unread,
Jan 10, 2022, 5:31:55 PM1/10/22
to rql...@googlegroups.com
On Sun, Jan 9, 2022 at 6:37 PM Yannick G <yannic...@gmail.com> wrote:
All right. For now I can't reproduce. 3 nodes on-disk. I re-initialized the cluster by wiping up ~/node and restarting everything. Maybe it's possible I made bad things, such as accessing files to check if data is correctly written [still in experimentation]. In this kind of situation, does it help adding a new write node and stop the current leader ?

Adding a new node to replace the leader will have no effect on this issue, as it's completely unrelated to the Raft (Leader) system.

Philip

Yannick G

unread,
Jan 11, 2022, 5:23:31 AM1/11/22
to rql...@googlegroups.com
Hello Philip,

I listened to your talk on youtube. From my understanding one could optimize and be less error-prone by passing sqlite in-memory to keep raft I/O on the SSD.

So if I mount a linux ramdisk, I can set the db without size limitation (only the ramdisk size) and I should launch the "-on-disk" command.

Under 2GB limitation, it should be performance optimal to use in-memory and a fast nvme (without "-on-disk" option).

Over 2 GB correct me if I'm wrong, but there's no possibility to tell raft to use the SSD and SQLite the ramdisk ?

Best regards

--
You received this message because you are subscribed to the Google Groups "rqlite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rqlite+un...@googlegroups.com.

Philip O'Toole

unread,
Jan 11, 2022, 9:10:32 AM1/11/22
to rql...@googlegroups.com
On Tue, Jan 11, 2022 at 5:23 AM Yannick G <yannic...@gmail.com> wrote:
Hello Philip,

I listened to your talk on youtube. From my understanding one could optimize and be less error-prone by passing sqlite in-memory to keep raft I/O on the SSD.

So if I mount a linux ramdisk, I can set the db without size limitation (only the ramdisk size) and I should launch the "-on-disk" command.

Under 2GB limitation, it should be performance optimal to use in-memory and a fast nvme (without "-on-disk" option).

Over 2 GB correct me if I'm wrong, but there's no possibility to tell raft to use the SSD and SQLite the ramdisk ?

Sure there is, put your data directory on your SSD,  and then set the `-on-disk-path` option to put your SQLite database on the RAM disk. See:


Philip

Philip O'Toole

unread,
Jan 11, 2022, 9:23:23 AM1/11/22
to rql...@googlegroups.com
Please note the following:

rqlite was not designed for very large datasets: While there are no hardcoded limits in the rqlite software, the nature of Raft means that the entire SQLite database is periodically copied to disk, and occasionally copied, in full, between nodes. Your hardware may not be able to process those large data operations successfully. You should test your system carefully when working with multi-GB databases.

Philip O'Toole

unread,
Jan 11, 2022, 9:54:58 AM1/11/22
to rqlite
Also, please note that if you make any changes to the SQLite file directly, you may break rqlite. Reading the SQLite file is fine, but changing it it anyway, except via the HTTP API, is not supported.

Philip

Yannick G

unread,
Jan 11, 2022, 12:45:09 PM1/11/22
to rql...@googlegroups.com
Ok I understand. Btw, how do you pass null values in json payload to be interpreted as a null in DB ?
I tried blank, "NULL" or "null" without success.

--
You received this message because you are subscribed to a topic in the Google Groups "rqlite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rqlite/qw5dPDu-NCs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rqlite+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rqlite/ec8403be-145f-4eb9-87bd-a9bea2a59e2cn%40googlegroups.com.

Philip O'Toole

unread,
Jan 11, 2022, 1:00:37 PM1/11/22
to rql...@googlegroups.com
Can you show me the exact requests you are sending? 'curl' commands?

You received this message because you are subscribed to the Google Groups "rqlite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rqlite+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rqlite/CA%2BT3qxV9xhNTrAxzAofK5T0Xk5eh1iYbT5vPiuu2xhAXypP9DA%40mail.gmail.com.

Yannick G

unread,
Jan 11, 2022, 1:20:02 PM1/11/22
to rql...@googlegroups.com
Sending correctly an empty char results indeed in a null representation. Pb existed between chair and keyboard.


Yannick G

unread,
Jan 11, 2022, 2:23:44 PM1/11/22
to rql...@googlegroups.com

In fact it's kind of weird. The same payload fails via curl and success via postman (http client)
Here test data :

[["INSERT INTO Influencer(id,fb_id,full_name,link,phone,social_networks,hash_tags,verified,profile_verified,follower_last_count,followers_last_count_dt,business_category,profile_id,username,email,fullname,profile_picture,gender,birth_year,country,location,last_update,media_count,added_at) VALUES (:id,:fb_id,:full_name,:link,:phone,:social_networks,:hash_tags,:verified,:profile_verified,:follower_last_count,:followers_last_count_dt,:business_category,:profile_id,:username,:email,:fullname,:profile_picture,:gender,:birth_year,:country,:location,:last_update,:media_count,:added_at)",{"id":"21af00a7-c0f1-4361-89aa-f4aed9538da9","fb_id":"1695391035","full_name":"Alexandria Hoareau","link":"http:\/\/www.mahe.fr\/aperiam-fugiat-eius-omnis-non-facilis-consectetur-sapiente-eos","phone":"+33 (0)5 06 88 10 03","social_networks":"[\"tiktok\",\"mastodon\"]","hash_tags":"[\"#toto\",\"#tata\"]","verified":"false","profile_verified":"false","follower_last_count":0,"followers_last_count_dt":1641928321,"business_category":"dumont","profile_id":"2830622","username":"maurice.laine","email":"isabell...@wanadoo.fr","fullname":"Alexandria Hoareau","profile_picture":"","gender":0,"birth_year":1971,"country":"Territoire britannique de l'oc\u00e9an Indien","location":"","last_update":"","media_count":"","added_at":1641928321}]]

This command fails :
curl -X POST "http://10.0.4.20:4001/db/execute"-H "Content-Type: application/json" -d "[["INSERT INTO Influencer(id,fb_id,full_name,link,phone,social_networks,hash_tags,verified,profile_verified,follower_last_count,followers_last_count_dt,business_category,profile_id,username,email,fullname,profile_picture,gender,birth_year,country,location,last_update,media_count,added_at) VALUES (:id,:fb_id,:full_name,:link,:phone,:social_networks,:hash_tags,:verified,:profile_verified,:follower_last_count,:followers_last_count_dt,:business_category,:profile_id,:username,:email,:fullname,:profile_picture,:gender,:birth_year,:country,:location,:last_update,:media_count,:added_at)",{"id":"21af00a7-c0f1-4361-89aa-f4aed9538da9","fb_id":"1695391035","full_name":"Alexandria Hoareau","link":"http:\/\/www.mahe.fr\/aperiam-fugiat-eius-omnis-non-facilis-consectetur-sapiente-eos","phone":"+33 (0)5 06 88 10 03","social_networks":"[\"tiktok\",\"mastodon\"]","hash_tags":"[\"#toto\",\"#tata\"]","verified":"false","profile_verified":"false","follower_last_count":0,"followers_last_count_dt":1641928321,"business_category":"dumont","profile_id":"2830622","username":"maurice.laine","email":"isabell...@wanadoo.fr","fullname":"Alexandria Hoareau","profile_picture":"","gender":0,"birth_year":1971,"country":"Territoire britannique de l'oc\u00e9an Indien","location":"","last_update":"","media_count":"","added_at":1641928321}]]"

But sent as http body it runs ok. Nevermind, i'll use http client :)
I spent some hours to figure out how to properly generate statements, it looked ok and then now it's ok with http client, when I quote properly and when i don't let the client itself do the json encoding.

Ty for your support

Philip O'Toole

unread,
Jan 11, 2022, 3:23:11 PM1/11/22
to rql...@googlegroups.com
Your curl command looks wrong. You're not nesting " (quotes) correctly. Don't do:

curl -X POST "http://10.0.4.20:4001/db/execute"-H "Content-Type: application/json" -d "[["INSERT INTO

Do:

curl -X POST "http://10.0.4.20:4001/db/execute"-H "Content-Type: application/json" -d '[["INSERT INTO

You also need to escape quotes if needed.



Reply all
Reply to author
Forward
0 new messages