Startup: Time assert error #21019

issue Zetanova openend this issue on January 28, 2021
  1. Zetanova commented at 4:12 am on January 28, 2021: none

    I bump the version from 0.20.0 to 0.21.0. Error on startup:

    0bitcoind: util/time.cpp:69: int64_t GetTimeMicros(): Assertion `now > 0' failed.
    

    rolled back to 0.20.0 and the issue disappeared.

    See my docker repo: https://github.com/Zetanova/docker-bitcoin

    System information raspberry pi 3 arm64 ubuntu 20.04 docker

  2. Zetanova added the label Bug on Jan 28, 2021
  3. MarcoFalke commented at 6:43 am on January 28, 2021: member

    That looks sketchy…

    GetTimeMicros hasn’t changed since 2015:

    0ad49c256c33 src/utiltime.cpp  (Wladimir J. van der Laan 2014-08-21 16:11:09 +0200  65) int64_t GetTimeMicros()
    1ad49c256c33 src/utiltime.cpp  (Wladimir J. van der Laan 2014-08-21 16:11:09 +0200  66) {
    21bb289fe1b7 src/utiltime.cpp  (Patick Strateman         2015-11-24 18:39:19 -0800  67)     int64_t now = (boost::posix_time::microsec_clock::universal_time() -
    31bb289fe1b7 src/utiltime.cpp  (Patick Strateman         2015-11-24 18:39:19 -0800  68)                    boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_microseconds();
    41bb289fe1b7 src/utiltime.cpp  (Patick Strateman         2015-11-24 18:39:19 -0800  69)     assert(now > 0);
    51bb289fe1b7 src/utiltime.cpp  (Patick Strateman         2015-11-24 18:39:19 -0800  70)     return now;
    6ad49c256c33 src/utiltime.cpp  (Wladimir J. van der Laan 2014-08-21 16:11:09 +0200  71) }
    

    Also, the latest boost version in gitian builds (which you are using) is not changed between 0.20 and 0.21: commit 2620e24b83d

  4. MarcoFalke added the label Utils/log/libs on Jan 28, 2021
  5. MarcoFalke commented at 6:44 am on January 28, 2021: member
    Would you mind uploading the dockerfile to reproduce and the steps to reproduce?
  6. Zetanova commented at 10:06 am on January 28, 2021: none

    Yes, i looked at the code too and saw that it was not changed. Maybe something with c++ lib?

    The dockerfile can be found in the repo https://github.com/Zetanova/docker-bitcoin

    This is my build image
    https://hub.docker.com/repository/docker/zetanova/bitcoin

    I really only bump the bitcoin version up

  7. pstratem commented at 11:57 am on January 29, 2021: contributor

    What is the current time on the RPI 3?

    Is it… maybe before 1970?

  8. Zetanova commented at 4:03 pm on January 29, 2021: none

    Yes it is something to build on

    the system OS time is correct Fri Jan 29 15:57:40 UTC 2021

    I tried to start a blank 0.21.0 container it writes the more log lines including the timestamp:

     0$:/home/ubuntu# date
     1Fri Jan 29 15:57:40 UTC 2021
     2$:/home/ubuntu# docker run -d  --name btctest zetanova/bitcoin:0.21.0
     3c16d87bcab57f9e9926722ec39eb20122881df9caf31076f2e54c3f7f1444bb2
     4$:/home/ubuntu# docker logs btctest
     51970-12-24T11:40:50Z Bitcoin Core version v0.21.0 (release build)
     61970-12-24T13:38:10Z Assuming ancestors of block 0000000000000000000b9d2ec5a352ecba0592946514a92f14319dc2b367fc72 have valid signatures.
     71970-12-24T12:45:22Z Setting nMinimumChainWork=00000000000000000000000000000000000000001533efd8d716a517fe2c5008
     81970-12-25T00:19:54Z Using the 'standard' SHA256 implementation
     91970-12-24T11:43:22Z Default data directory /home/bitcoin/.bitcoin
    101970-12-24T11:43:22Z Using data directory /home/bitcoin/.bitcoin
    111970-12-24T12:25:14Z Config file: /home/bitcoin/.bitcoin/bitcoin.conf (not found, skipping)
    121970-12-11T03:52:03Z Command-line arg: debuglogfile="0"
    131970-12-11T03:52:05Z Command-line arg: printtoconsole="1"
    141970-01-01T00:00:10Z Using at most 125 automatic connections (1048576 file descriptors available)
    151970-02-28T00:14:47Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
    16bitcoind: util/time.cpp:69: int64_t GetTimeMicros(): Assertion `now > 0' failed.
    
     0$:/home/ubuntu# docker version
     1Client:
     2 Version:           19.03.8
     3 API version:       1.40
     4 Go version:        go1.13.8
     5 Git commit:        afacb8b7f0
     6 Built:             Wed Oct 14 19:44:21 2020
     7 OS/Arch:           linux/arm
     8 Experimental:      false
     9
    10Server:
    11 Engine:
    12  Version:          19.03.8
    13  API version:      1.40 (minimum version 1.12)
    14  Go version:       go1.13.8
    15  Git commit:       afacb8b7f0
    16  Built:            Wed Oct 14 16:41:21 2020
    17  OS/Arch:          linux/arm
    18  Experimental:     false
    19 containerd:
    20  Version:          1.3.3-0ubuntu2
    21  GitCommit:
    22 runc:
    23  Version:          spec: 1.0.1-dev
    24  GitCommit:
    25 docker-init:
    26  Version:          0.18.0
    27  GitCommit:
    
  9. laanwj commented at 4:11 pm on January 29, 2021: member

    1970-02-28T00:14:47Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements bitcoind: util/time.cpp:69: int64_t GetTimeMicros(): Assertion `now > 0’ failed.

    1970—That doesn’t look correct. Your system needs to have a correct clock time to run Bitcoin Core. If the host system has the correct time it might not be correctly propagated to the container.

    This is not a bug, removing the bug label.

  10. laanwj removed the label Bug on Jan 29, 2021
  11. Zetanova commented at 4:14 pm on January 29, 2021: none

    Yes updating docker right now

    Still very strange, why a new container of btc 0.20.0 can start and has the correct time and btc 0.21.0 does not

    will test again after the system upgrade and reboot

  12. Zetanova commented at 4:31 pm on January 29, 2021: none

    Same issue after update:

    bitcoin 0.21.0:

    0$:/home/ubuntu# date
    1Fri Jan 29 16:28:08 UTC 2021
    2$:/home/ubuntu# docker run -d  --name btctest zetanova/bitcoin:0.21.0
    36310f2dcd75119631ecf1f37441c4b94ad2753b591457db67cade0a8330e6ce0
    4$:/home/ubuntu# docker logs btctest
    5bitcoind: util/time.cpp:69: int64_t GetTimeMicros(): Assertion `now > 0' failed.
    

    bitcoin 0.20.0:

    0$:/home/ubuntu# docker start bitcoin
    1bitcoin
    2$:/home/ubuntu# docker logs bitcoin
    32021-01-28T03:43:23Z Bitcoin Core version v0.20.0 (release build)
    42021-01-28T03:43:23Z Assuming ancestors of block 0000000000000000000f2adce67e49b0b6bdeb9de8b7c3d7e93b21e7fc1e819d have valid signatures.
    52021-01-28T03:43:23Z Setting nMinimumChainWork=00000000000000000000000000000000000000000e1ab5ec9348e9f4b8eb8154
    62021-01-28T03:43:23Z Using the 'standard' SHA256 implementation
    7...
    
  13. Zetanova commented at 5:24 pm on January 29, 2021: none

    most be something in an update of ubuntu:20.04 (base image)

    I rebuild now the bitcoin 0.20.0 version and and it has the same issue as 0.21.0 now.

    0$ docker run --name btctest zetanova/bitcoin:0.20.0-2001291810
    1bitcoind: util/time.cpp:29: int64_t GetTime(): Assertion `now > 0' failed.
    
  14. MarcoFalke added the label Upstream on Jan 29, 2021
  15. Zetanova commented at 6:38 pm on January 29, 2021: none

    I tried now to start bitcoin 0.21.0 with the base images:

    • ubuntu:focal-20210119: Assertion ’now > 0’ failed.
    • ubuntu:focal-20201106: Assertion ’now > 0’ failed.
    • ubuntu:focal-20201008: Assertion ’now > 0’ failed.
    • (version skipped)
    • ubuntu:focal-20200703: Assertion ’now > 0’ failed.
    • (no arm/v7 => skipped)
    • ubuntu:focal-20200115: WORKING

    WIN for containerization

    I found only an update of boost on the 16.04.2020, it should be for “risc”, can be related to the issue. http://changelogs.ubuntu.com/changelogs/pool/main/b/boost-defaults/boost-defaults_1.71.0.0ubuntu2/changelog

    I could not find the change/commit for boost-defaults or the sourcecode to check if it introduced an bug for arm/v7 https://svn.boost.org/trac10/wiki/StartGitHub

  16. MarcoFalke commented at 8:24 am on January 30, 2021: member
    If you call date in the container, it will also print 1970?
  17. Zetanova commented at 12:59 pm on January 30, 2021: none

    Yes, date has same issue.

    Where to report this bug?

    Thx for your input.

    ubuntu 20.04 arm/v7

     0$ docker run zetanova/bitcoin:0.21.0-2101291856
     11971-05-16T15:46:09Z Bitcoin Core version v0.21.0 (release build)
     21971-05-16T17:43:29Z Assuming ancestors of block 0000000000000000000b9d2ec5a352ecba0592946514a92f14319dc2b367fc72 have valid signatures.
     31971-05-16T16:50:41Z Setting nMinimumChainWork=00000000000000000000000000000000000000001533efd8d716a517fe2c5008
     41971-05-17T04:25:13Z Using the 'standard' SHA256 implementation
     51971-05-16T15:48:41Z Default data directory /home/bitcoin/.bitcoin
     61971-05-16T15:48:41Z Using data directory /home/bitcoin/.bitcoin
     71971-05-16T16:30:33Z Config file: /home/bitcoin/.bitcoin/bitcoin.conf (not found, skipping)
     81971-05-03T07:57:22Z Command-line arg: debuglogfile="0"
     91971-05-03T07:57:24Z Command-line arg: printtoconsole="1"
    101970-01-01T00:00:10Z Using at most 125 automatic connections (1048576 file descriptors available)
    111970-02-22T00:53:06Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
    12bitcoind: util/time.cpp:69: int64_t GetTimeMicros(): Assertion `now > 0' failed.
    13$ docker run zetanova/bitcoin:0.21.0-2101291856 date
    14Wed Feb 25 20:57:31 UTC 1970
    15$ date
    16Sat Jan 30 12:48:13 UTC 2021
    

    ubuntu 20.04 arm64

    0$ docker run zetanova/bitcoin:0.21.0-2101291856 date
    1Sat Jan 30 12:54:34 UTC 2021
    
  18. Zetanova closed this on Jan 30, 2021

  19. MarcoFalke commented at 2:36 pm on January 30, 2021: member
    I don’t think this is related to boost if date shows the same issue. Does it happen in a vanilla container (without the bitcoin stuff packaged in)?
  20. Zetanova commented at 3:25 pm on January 30, 2021: none

    yes, it happend to vanilla and only on arm/v7 not arm64

    i opened an issue at boostorg https://github.com/boostorg/boost/issues/474

  21. MarcoFalke commented at 4:34 pm on January 30, 2021: member
    You’ll have to report the issue here: https://hub.docker.com/_/ubuntu/
  22. Zetanova commented at 4:45 pm on January 30, 2021: none
    Thanks found some open bug report, maybe my input will help https://bugs.launchpad.net/cloud-images/+bug/1896443
  23. DrahtBot locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-21 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me