Startup: Time assert error #21019

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

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

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

    bitcoind: 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

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    System information raspberry pi 3 arm64 ubuntu 20.04 docker

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    <!-- GUI-related issue? What is your operating system and its version? If Linux, what is your desktop environment and graphical shell? -->

    <!-- Any extra information that might be useful in the debugging process. -->

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  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:

    ad49c256c33 src/utiltime.cpp  (Wladimir J. van der Laan 2014-08-21 16:11:09 +0200  65) int64_t GetTimeMicros()
    ad49c256c33 src/utiltime.cpp  (Wladimir J. van der Laan 2014-08-21 16:11:09 +0200  66) {
    1bb289fe1b7 src/utiltime.cpp  (Patick Strateman         2015-11-24 18:39:19 -0800  67)     int64_t now = (boost::posix_time::microsec_clock::universal_time() -
    1bb289fe1b7 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();
    1bb289fe1b7 src/utiltime.cpp  (Patick Strateman         2015-11-24 18:39:19 -0800  69)     assert(now > 0);
    1bb289fe1b7 src/utiltime.cpp  (Patick Strateman         2015-11-24 18:39:19 -0800  70)     return now;
    ad49c256c33 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:

    $:/home/ubuntu# date
    Fri Jan 29 15:57:40 UTC 2021
    $:/home/ubuntu# docker run -d  --name btctest zetanova/bitcoin:0.21.0
    c16d87bcab57f9e9926722ec39eb20122881df9caf31076f2e54c3f7f1444bb2
    $:/home/ubuntu# docker logs btctest
    1970-12-24T11:40:50Z Bitcoin Core version v0.21.0 (release build)
    1970-12-24T13:38:10Z Assuming ancestors of block 0000000000000000000b9d2ec5a352ecba0592946514a92f14319dc2b367fc72 have valid signatures.
    1970-12-24T12:45:22Z Setting nMinimumChainWork=00000000000000000000000000000000000000001533efd8d716a517fe2c5008
    1970-12-25T00:19:54Z Using the 'standard' SHA256 implementation
    1970-12-24T11:43:22Z Default data directory /home/bitcoin/.bitcoin
    1970-12-24T11:43:22Z Using data directory /home/bitcoin/.bitcoin
    1970-12-24T12:25:14Z Config file: /home/bitcoin/.bitcoin/bitcoin.conf (not found, skipping)
    1970-12-11T03:52:03Z Command-line arg: debuglogfile="0"
    1970-12-11T03:52:05Z Command-line arg: printtoconsole="1"
    1970-01-01T00:00:10Z Using at most 125 automatic connections (1048576 file descriptors available)
    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.
    
    $:/home/ubuntu# docker version
    Client:
     Version:           19.03.8
     API version:       1.40
     Go version:        go1.13.8
     Git commit:        afacb8b7f0
     Built:             Wed Oct 14 19:44:21 2020
     OS/Arch:           linux/arm
     Experimental:      false
    
    Server:
     Engine:
      Version:          19.03.8
      API version:      1.40 (minimum version 1.12)
      Go version:       go1.13.8
      Git commit:       afacb8b7f0
      Built:            Wed Oct 14 16:41:21 2020
      OS/Arch:          linux/arm
      Experimental:     false
     containerd:
      Version:          1.3.3-0ubuntu2
      GitCommit:
     runc:
      Version:          spec: 1.0.1-dev
      GitCommit:
     docker-init:
      Version:          0.18.0
      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:

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

    bitcoin 0.20.0:

    $:/home/ubuntu# docker start bitcoin
    bitcoin
    $:/home/ubuntu# docker logs bitcoin
    2021-01-28T03:43:23Z Bitcoin Core version v0.20.0 (release build)
    2021-01-28T03:43:23Z Assuming ancestors of block 0000000000000000000f2adce67e49b0b6bdeb9de8b7c3d7e93b21e7fc1e819d have valid signatures.
    2021-01-28T03:43:23Z Setting nMinimumChainWork=00000000000000000000000000000000000000000e1ab5ec9348e9f4b8eb8154
    2021-01-28T03:43:23Z Using the 'standard' SHA256 implementation
    ...
    
  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.

    $ docker run --name btctest zetanova/bitcoin:0.20.0-2001291810
    bitcoind: 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

    $ docker run zetanova/bitcoin:0.21.0-2101291856
    1971-05-16T15:46:09Z Bitcoin Core version v0.21.0 (release build)
    1971-05-16T17:43:29Z Assuming ancestors of block 0000000000000000000b9d2ec5a352ecba0592946514a92f14319dc2b367fc72 have valid signatures.
    1971-05-16T16:50:41Z Setting nMinimumChainWork=00000000000000000000000000000000000000001533efd8d716a517fe2c5008
    1971-05-17T04:25:13Z Using the 'standard' SHA256 implementation
    1971-05-16T15:48:41Z Default data directory /home/bitcoin/.bitcoin
    1971-05-16T15:48:41Z Using data directory /home/bitcoin/.bitcoin
    1971-05-16T16:30:33Z Config file: /home/bitcoin/.bitcoin/bitcoin.conf (not found, skipping)
    1971-05-03T07:57:22Z Command-line arg: debuglogfile="0"
    1971-05-03T07:57:24Z Command-line arg: printtoconsole="1"
    1970-01-01T00:00:10Z Using at most 125 automatic connections (1048576 file descriptors available)
    1970-02-22T00:53:06Z 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.
    $ docker run zetanova/bitcoin:0.21.0-2101291856 date
    Wed Feb 25 20:57:31 UTC 1970
    $ date
    Sat Jan 30 12:48:13 UTC 2021
    

    ubuntu 20.04 arm64

    $ docker run zetanova/bitcoin:0.21.0-2101291856 date
    Sat 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: 2026-04-13 15:14 UTC

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