3

Since a few days I have been getting email reports saying Error downloading USN pickle from https://usn.ubuntu.com/usn-db/database.pickle.bz2.

I am using Landscape On-Premise 16.04. When I try to debug and run the command sudo -u landscape bash -x /opt/canonical/landscape/scripts/update_security_db.sh through the shell, it passes without any error! So I can't seem to find, nor reproduce the error by hand.

In the /var/log/landscape-server/update-security-db.log I can only see the following:

Mar  7 09:35:52 update-security-db INFO  Error downloading USN pickle from https://usn.ubuntu.com/usn-db/database.pickle.bz2
Mar  7 09:35:52 update-security-db INFO    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current#012                                 Dload  Upload   Total   Spent    Left  Speed#012#015  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0#015  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0#015  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0#015  0 14.8M    0 13517    0     0   4452      0  0:58:22  0:00:03  0:58:19  4453#015  0 14.8M    0 86311    0     0  22262      0  0:11:40  0:00:03  0:11:37 22262#015  1 14.8M    1  185k    0     0  37634      0  0:06:54  0:00:05  0:06:49 37636#015  1 14.8M    1  295k    0     0  51507      0  0:05:02  0:00:05  0:04:57 66578#015  2 14.8M    2  357k    0     0  49863      0  0:05:12  0:00:07  0:05:05 73109#015  2 14.8M    2  390k    0     0  50970      0  0:05:05  0:00:07  0:04:58 80371#015  3 14.8M    3  487k    0     0  54439      0  0:04:46  0:00:09  0:04:37 78048#015  3 14.8M    3  543k    0     0  56501      0  0:04:35  0:00:09  0:04:26 76
Mar  7 10:36:53 update-security-db INFO  Error downloading USN pickle from https://usn.ubuntu.com/usn-db/database.pickle.bz2
Mar  7 10:36:53 update-security-db INFO    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current#012                                 Dload  Upload   Total   Spent    Left  Speed#012#015  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0#015  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0#015  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0#015  0 14.8M    0 31201    0     0  12083      0  0:21:30  0:00:02  0:21:28 12079#015  0 14.8M    0 51681    0     0  14274      0  0:18:12  0:00:03  0:18:09 14272#015  0 14.8M    0   99k    0     0  21777      0  0:11:55  0:00:04  0:11:51 21773#015  1 14.8M    1  155k    0     0  28559      0  0:09:05  0:00:05  0:09:00 35439#015  1 14.8M    1  235k    0     0  36916      0  0:07:02  0:00:06  0:06:56 48526#015  1 14.8M    1  303k    0     0  40709      0  0:06:22  0:00:07  0:06:15 55327#015  2 14.8M    2  403k    0     0  47877      0  0:05:25  0:00:08  0:05:17 72133#015  3 14.8M    3  503k    0     0  54085      0  0:04:48  0:00:09  0:04:39 85

And the email I am receiving states:

Cron <landscape@server> /opt/canonical/landscape/scripts/update_security_db.sh
Cron Daemon <root@server>
  Reply all|
Today, 5:35 PM
landscape@server 
To help protect your privacy, some content in this message has been blocked. To re-enable the blocked features, click here.
To always show content from this sender, click here.
Error downloading USN pickle from https://usn.ubuntu.com/usn-db/database.pickle.bz2
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  1 14.8M    1  193k    0     0   233k      0  0:01:05 --:--:--  0:01:05  233k
  2 14.8M    2  383k    0     0   203k      0  0:01:14  0:00:01  0:01:13  203k
  3 14.8M    3  472k    0     0   167k      0  0:01:31  0:00:02  0:01:29  167k
  3 14.8M    3  605k    0     0   157k      0  0:01:36  0:00:03  0:01:33  157k
  5 14.8M    5  776k    0     0   140k      0  0:01:48  0:00:05  0:01:43  140k
  5 14.8M    5  776k    0     0   118k      0  0:02:08  0:00:06  0:02:02  102k
  5 14.8M    5  777k    0     0   108k      0  0:02:20  0:00:07  0:02:13 76115
  5 14.8M    5  829k    0     0   100k      0  0:02:31  0:00:08  0:02:23 67728
  5 14.8M    5  876k    0     0  98958      0  0:02:37  0:00:09  0:02:28 52976
  5 14.8M    5  892k    0     0  92987      0  0:02:47  0:00:09  0:02:38 27718
  6 14.8M    6  981k    0     0  87481      0  0:02:58  0:00:11  0:02:47 42415
  6 14.8M    6  988k    0     0  85540      0  0:
 03:02  0:00:11  0:02:51 46429
  7 14.8M    7 1154k    0     0  92147      0  0:02:49  0:00:12  0:02:37 72304
  8 14.8M    8 1295k    0     0  95906      0  0:02:42  0:00:13  0:02:29 90089
  8 14.8M    8 1358k    0     0  93755      0  0:02:46  0:00:14  0:02:32 95267
  9 14.8M    9 1468k    0     0  94938      0  0:02:44  0:00:15  0:02:29  111k
 10 14.8M   10 1594k    0     0  96827      0  0:02:41  0:00:16  0:02:25  120k
 11 14.8M   11 1677k    0     0  93909      0  0:02:46  0:00:18  0:02:28 98064
 11 14.8M   11 1678k    0     0  90593      0  0:02:52  0:00:18  0:02:34 76323
 11 14.8M   11 1704k    0     0  88041      0  0:02:57  0:00:19  0:02:38 71059
 12 14.8M   12 1914k    0     0  94104      0  0:02:45  0:00:20  0:02:25 91442
 13 14.8M   13 2099k    0     0  94852      0  0:02:44  0:00:22  0:02:22 89122
 13 14.8M   13 2100k    0     0  91888      0  0:02:49  0:00:23  0:02:26 84677
 14 14.8M   14 2144k    0     0  92037      0  0:02:49  0:00:23  0:02:26 97648
 15 14.8M   15 2302
 k    0     0  94381      0  0:02:45  0:00:24  0:02:21  115k
 15 14.8M   15 2374k    0     0  93215      0  0:02:47  0:00:26  0:02:21 89704
 16 14.8M   16 2480k    0     0  94473      0  0:02:45  0:00:26  0:02:19 92425
 16 14.8M   16 2538k    0     0  92711      0  0:02:48  0:00:28  0:02:20 96861
 16 14.8M   16 2541k    0     0  89576      0  0:02:54  0:00:29  0:02:25 78279
 17 14.8M   17 2589k    0     0  89385      0  0:02:54  0:00:29  0:02:25 62730
curl: (18) transfer closed with 12941684 bytes remaining to read

So basically it ends with curl: (18) transfer closed with 12941684 bytes remaining to read.

And just now got the same error with the following error: curl: (56) GnuTLS recv error (-9): A TLS packet with unexpected length was received.

Does anyone have an idea where to look for the error? I don't use any proxy settings for connecting to the internet. And basically there hasn't been any changes for the last month or so regarding to updates, so it kind of happened out of the blue.

2 Answers2

4

I've been getting this too with the same kind of setup.

Not definitive yet, since I just changed it this morning, but I noticed that the cron job runs at 35 minutes past the hour for everyone. The errors look like timeouts or communication errors but my connectivity has been normal otherwise. I'm thinking maybe the server is just getting overloaded when all of the installs try to grab the file at the same time.

I edited the /etc/cron.d/landscape-server file and changed it to a different time and haven't had an error since, but like I said it's only been 5-6 hrs.

Doogie
  • 56
  • Always good to know that I'm not the only one that has this problem :) May I ask what interval you chose for the cronjob? – ChrisVanMeer Mar 08 '18 at 05:54
  • The original crontab had it set for 35 * * * * landscape /opt/canonical/landscape/scripts/update_security_db.sh which runs the script at the 35th minute of every hour. I just changed the 35 to another number, so mine isn't running at the same time as all of the others. If you set it to 14, it'll run at the 14th minute of every hour, for example. Also I haven't had another error since I did this yesterday. Have you continued to receive the errors without this change? – Doogie Mar 09 '18 at 06:48
  • I changed 35 to 45 and since then (more than 12 hours ago) haven't received an error since! Thanks! – ChrisVanMeer Mar 09 '18 at 09:15
3

The way the Ubuntu Security Notice website is published was changed recently. As a result of this, if the Security Team published a new USN while the Landscape cron job was downloading the existing database, that download connection would get dropped. We believe this issue has been addressed.

The issue was tracked in https://github.com/canonical-websites/usn.ubuntu.com/issues/36 ; if you continue to see problems with Landscape's download, please comment on that issue. Thanks and our apologies for the inconvenience.