# Error when querying the balance of an address on testnet

**URL:** <https://forum.cardano.org/t/error-when-querying-the-balance-of-an-address-on-testnet/50532>\
**Category:** Setup a Stake Pool\
**Created:** [28 February 2021 00:48 UTC](https://forum.cardano.org/t/error-when-querying-the-balance-of-an-address-on-testnet/50532 "2021-02-28T00:48:01Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![MIkko](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mikko/32/28758_2.png) [@MIkko](https://forum.cardano.org/u/MIkko)\
**Post date:** [28 February 2021 00:48 UTC](https://forum.cardano.org/t/error-when-querying-the-balance-of-an-address-on-testnet/50532/1 "2021-02-28T00:48:01Z")

</div>

Hello, I am following the stake pool course and have found a road block. Under the transactions section → generating permanent keys and address, I am unable to query the balance. I am receiving the following error:  
`Shelley command failed: query utxo Error: A query from a certain era was applied to a ledger from a different era: EraMismatch {ledgerEraName = "Byron", otherEraName = "Allegra"}`

The command I ran was:

> cardano-cli query utxo \  
> –address $(cat payment.addr) \  
> –testnet-magic 1097911063 \  
> –allegra-era

I verified that all the steps on the documentation were followed properly. Does anyone here have a clue of what may be causing this issue?

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [28 February 2021 01:00 UTC](https://forum.cardano.org/t/error-when-querying-the-balance-of-an-address-on-testnet/50532/2 "2021-02-28T01:00:23Z")

</div>

Hello,

Being in Mary era, u will need to add the subcommand --mary-era to ur command

Cheers,

---

<div class="post-metadata">

**Author:** ![MIkko](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mikko/32/28758_2.png) [@MIkko](https://forum.cardano.org/u/MIkko)\
**Post date:** [28 February 2021 01:01 UTC](https://forum.cardano.org/t/error-when-querying-the-balance-of-an-address-on-testnet/50532/3 "2021-02-28T01:01:31Z")

</div>

Hi @Alexd1985,

I tried your suggestion and got:

> Shelley command failed: query utxo Error: A query from a certain era was applied to a ledger from a different era: EraMismatch {ledgerEraName = “Byron”, otherEraName = “Mary”}

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [28 February 2021 01:03 UTC](https://forum.cardano.org/t/error-when-querying-the-balance-of-an-address-on-testnet/50532/4 "2021-02-28T01:03:04Z")

</div>

What command did u ran? Can u share it?

---

<div class="post-metadata">

**Author:** ![MIkko](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mikko/32/28758_2.png) [@MIkko](https://forum.cardano.org/u/MIkko)\
**Post date:** [28 February 2021 01:04 UTC](https://forum.cardano.org/t/error-when-querying-the-balance-of-an-address-on-testnet/50532/5 "2021-02-28T01:04:01Z")

</div>

Sure,

> cardano-cli query utxo \  
> –address $(cat payment.addr) \  
> –testnet-magic 1097911063 \  
> –mary-era

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [28 February 2021 01:10 UTC](https://forum.cardano.org/t/error-when-querying-the-balance-of-an-address-on-testnet/50532/6 "2021-02-28T01:10:12Z")

</div>

Can u try with Mary-era? Perhaps it’s case sensitive…

---

<div class="post-metadata">

**Author:** ![MIkko](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mikko/32/28758_2.png) [@MIkko](https://forum.cardano.org/u/MIkko)\
**Post date:** [28 February 2021 13:32 UTC](https://forum.cardano.org/t/error-when-querying-the-balance-of-an-address-on-testnet/50532/8 "2021-02-28T13:32:22Z")

</div>

Thanks,

After reading similar posts, discovered that the pool needed to sync completely before being able to access that transaction. I left the server running over night and boom! it’s working now. Thanks.

---

<div class="post-metadata">

**Author:** ![kitawb](https://avatars.discourse-cdn.com/v4/letter/k/ec9cab/32.png) [@kitawb](https://forum.cardano.org/u/kitawb)\
**Post date:** [12 March 2021 05:16 UTC](https://forum.cardano.org/t/error-when-querying-the-balance-of-an-address-on-testnet/50532/9 "2021-03-12T05:16:10Z")

</div>

Hi@MIkko ,  
Which command worked after the pool synced?

---

<div class="post-metadata">

**Author:** ![kitawb](https://avatars.discourse-cdn.com/v4/letter/k/ec9cab/32.png) [@kitawb](https://forum.cardano.org/u/kitawb)\
**Post date:** [12 March 2021 05:26 UTC](https://forum.cardano.org/t/error-when-querying-the-balance-of-an-address-on-testnet/50532/10 "2021-03-12T05:26:39Z")

</div>

[quote=“MIkko, post:5, topic:50532”]  
cardano-cli query utxo   
–address $(cat payment.addr)   
–testnet-magic 1097911063   
–mary-era  
[/quote] this worked for me as well! Thanks!

---

<div class="post-metadata">

**Author:** ![KrakenStaking](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/krakenstaking/32/29369_2.png) [@KrakenStaking](https://forum.cardano.org/u/KrakenStaking)\
**Post date:** [12 March 2021 14:59 UTC](https://forum.cardano.org/t/error-when-querying-the-balance-of-an-address-on-testnet/50532/11 "2021-03-12T14:59:40Z")

</div>

yea needs to be mary now that we have “forked” over

---

<div class="post-metadata">

**Author:** ![MIkko](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mikko/32/28758_2.png) [@MIkko](https://forum.cardano.org/u/MIkko)\
**Post date:** [12 March 2021 22:18 UTC](https://forum.cardano.org/t/error-when-querying-the-balance-of-an-address-on-testnet/50532/12 "2021-03-12T22:18:14Z")

</div>

That command you posted. It’s to query the blockchain.

> ```
> cardano-cli query utxo \
> --address $(cat payment.addr) \
> --testnet-magico OR --mainnett \
> --mary-era
> 
> ```

The payment.addr is the address you make with the keys when creating your stake pool.
