Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Thread 'offchain-worker' panicked at 'Accessing a forbidden API: timestamp. No: HTTP capability. #4238

Closed
HCastano opened this issue Nov 8, 2021 · 2 comments · Fixed by paritytech/substrate#10220

Comments

@HCastano
Copy link
Contributor

HCastano commented Nov 8, 2021

I'm running polkadot --dev on an Ubuntu 20.04 machine and am getting the following panic:

hernando in Ubuntu-2004-focal-64-minimal in polkadot on  master is 📦 v0.9.12 via 🦀 v1.58.0-nightly
❯ ./target/release/polkadot --dev
2021-11-08 12:45:14 Running in --dev mode, RPC CORS has been disabled.
2021-11-08 12:45:14 Parity Polkadot
2021-11-08 12:45:14 ✌️  version 0.9.12-e5530856c-x86_64-linux-gnu
2021-11-08 12:45:14 ❤️  by Parity Technologies <admin@parity.io>, 2017-2021
2021-11-08 12:45:14 📋 Chain specification: Development
2021-11-08 12:45:14 🏷 Node name: auspicious-oatmeal-4854
2021-11-08 12:45:14 👤 Role: AUTHORITY
2021-11-08 12:45:14 💾 Database: RocksDb at /tmp/substrate7DaggH/chains/dev/db/full
2021-11-08 12:45:14 ⛓  Native runtime: polkadot-9130 (parity-polkadot-0.tx8.au0)
2021-11-08 12:45:14 [0] 💸 generated 1 npos voters, 1 from validators and 0 nominators
2021-11-08 12:45:14 Took active validators from set with wrong size
2021-11-08 12:45:14 Took active validators from set with wrong size.
2021-11-08 12:45:14 Took active validators from set with wrong size
2021-11-08 12:45:14 🔨 Initializing Genesis block/state (state: 0x7600…5d9e, header-hash: 0x1bba…41d6)
2021-11-08 12:45:14 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2021-11-08 12:45:14 ⏱  Loaded block-time = 6s from block 0x1bbaa2c0bad67997e923a3f7f1bb5fb7dfc7bbb7823d152be49d193a076c41d6
2021-11-08 12:45:14 👶 Creating empty BABE epoch changes on what appears to be first startup.
2021-11-08 12:45:14 🏷 Local node identity is: 12D3KooWM17afbvEt2cZEJe3gM9zKbzYjbhD63udj84mVqC8VNCC
2021-11-08 12:45:14 📦 Highest known block at #0
2021-11-08 12:45:14 〽️ Prometheus exporter started at 127.0.0.1:9615
2021-11-08 12:45:14 Listening for new connections on 127.0.0.1:9944.
2021-11-08 12:45:14 👶 Starting BABE Authorship worker
2021-11-08 12:45:18 🙌 Starting consensus session on top of parent 0x1bbaa2c0bad67997e923a3f7f1bb5fb7dfc7bbb7823d152be49d193a076c41d6
2021-11-08 12:45:18 🎁 Prepared block for proposing at 1 [hash: 0x1220fe52feec8e35a4abf9b5f2eef12ead9dd403138fc9b3d3cc3df6c2704039; parent_hash: 0x1bba…41d6; extrinsics (2): [0x237a…c3c4, 0x1c4a…598b]]
2021-11-08 12:45:18 🔖 Pre-sealed block for proposal at 1. Hash now 0x935bdaedb262c919fe1d408a9d56d708f76204388c6153ce5098f51c9a74fe58, previously 0x1220fe52feec8e35a4abf9b5f2eef12ead9dd403138fc9b3d3cc3df6c2704039.
2021-11-08 12:45:18 👶 New epoch 0 launching at block 0x935b…fe58 (block slot 272728653 >= start slot 272728653).
2021-11-08 12:45:18 👶 Next epoch starts at slot 272731053
2021-11-08 12:45:18 ✨ Imported #1 (0x935b…fe58)

====================

Version: 0.9.12-e5530856c-x86_64-linux-gnu

   0: sp_panic_handler::set::{{closure}}
   1: std::panicking::rust_panic_with_hook
             at /rustc/46b8e7488eae116722196e8390c1bd2ea2e396cf/library/std/src/panicking.rs:610:17
   2: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/46b8e7488eae116722196e8390c1bd2ea2e396cf/library/std/src/panicking.rs:502:13
   3: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/46b8e7488eae116722196e8390c1bd2ea2e396cf/library/std/src/sys_common/backtrace.rs:139:18
   4: rust_begin_unwind
             at /rustc/46b8e7488eae116722196e8390c1bd2ea2e396cf/library/std/src/panicking.rs:498:5
   5: core::panicking::panic_fmt
             at /rustc/46b8e7488eae116722196e8390c1bd2ea2e396cf/library/core/src/panicking.rs:106:14
   6: <sp_core::offchain::LimitedExternalities<T> as sp_core::offchain::Externalities>::timestamp
   7: std::thread::local::LocalKey<T>::with
   8: sp_io::offchain::timestamp_version_1
   9: <(TupleElement0,TupleElement1) as frame_support::traits::misc::OffchainWorker<BlockNumber>>::offchain_worker
  10: frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPallets,COnRuntimeUpgrade>::offchain_worker
  11: std::panicking::try
  12: std::thread::local::LocalKey<T>::with
  13: sc_executor::native_executor::WasmExecutor::with_instance::{{closure}}
  14: sc_executor::wasm_runtime::RuntimeCache::with_instance
  15: <sc_executor::native_executor::NativeElseWasmExecutor<D> as sp_core::traits::CodeExecutor>::call
  16: sp_state_machine::execution::StateMachine<B,H,N,Exec>::execute_aux
  17: sp_state_machine::execution::StateMachine<B,H,N,Exec>::execute_using_consensus_failure_handler
  18: <sc_service::client::call_executor::LocalCallExecutor<Block,B,E> as sc_client_api::call_executor::CallExecutor<Block>>::contextual_call
  19: <sc_service::client::client::Client<B,E,Block,RA> as sp_api::CallApiAt<Block>>::call_api_at
  20: sp_offchain::runtime_decl_for_OffchainWorkerApi::offchain_worker_call_api_at
  21: <polkadot_runtime::RuntimeApiImpl<__SR_API_BLOCK__,RuntimeApiImplCall> as sp_offchain::OffchainWorkerApi<__SR_API_BLOCK__>>::OffchainWorkerApi_offchain_worker_runtime_api_impl
  22: <F as threadpool::FnBox>::call_box
  23: std::sys_common::backtrace::__rust_begin_short_backtrace
  24: core::ops::function::FnOnce::call_once{{vtable.shim}}
  25: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/46b8e7488eae116722196e8390c1bd2ea2e396cf/library/alloc/src/boxed.rs:1691:9
      <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/46b8e7488eae116722196e8390c1bd2ea2e396cf/library/alloc/src/boxed.rs:1691:9
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/46b8e7488eae116722196e8390c1bd2ea2e396cf/library/std/src/sys/unix/thread.rs:106:17
  26: start_thread
             at /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477:8
  27: clone


Thread 'offchain-worker' panicked at 'Accessing a forbidden API: timestamp. No: HTTP capability.', /home/hernando/.cargo/git/checkouts/substrate-7e08433d4c370a21/a946572/primitives/core/src/offchain/mod.rs:527

This is a bug. Please report it at:

	https://github.com/paritytech/polkadot/issues/new

2021-11-08 12:45:18 Error running offchain workers at BlockId::Hash(0x935bdaedb262c919fe1d408a9d56d708f76204388c6153ce5098f51c9a74fe58): Application(Execution(RuntimePanicked("Accessing a forbidden API: timestamp. No: HTTP capability.")))
2021-11-08 12:45:19 💤 Idle (0 peers), best: #1 (0x935b…fe58), finalized #0 (0x1bba…41d6), ⬇ 0 ⬆ 0

@bkchr Could this be related to the changes introduced in #4188?

@ordian
Copy link
Member

ordian commented Nov 8, 2021

We don't use any http requests in the polkadot offchain workers.

you lied :P

@bkchr
Copy link
Member

bkchr commented Nov 8, 2021

We don't use any http requests in the polkadot offchain workers.

you lied :P

I did not :P

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants