Reverted with reason string 'Governor: unknown proposal id

I using Governor contract from Openzeppelin. I have created and voted on the proposal. The state of proposal is succeeded. When I am trying to queue the proposal I am getting error

Reverted with reason string 'Governor: unknown proposal id

Here’s the queue data:

    const box = await ethers.getContract("Box");
    const encodedFunctionCall = box.interface.encodeFunctionData(STORE_FUNCTION, args);
    const descriptionHash = ethers.hashMessage(PROPOSAL_DESCRIPTION);

    const governance = await ethers.getContract("GovernorContract");
    console.log("Queueing...");
    const queueTx = await governance.getFunction("queue")(
        [await box.getAddress()],
        [0],
        [encodedFunctionCall],
        descriptionHash
    ); ```

The constants are correct. I think there could be something wrong with the hashMessage for description but not sure.

Please share a link to your contract (etherscan, github, etc).

Governor Contract:

Here’s the link to GitHub:

Note some of the ethersv6 methods haven’t been pushed to GitHub.

Please share these values as well.

export const STORE_FUNCTION = "store";
export const NEW_STORE_VALUE = 77;
export const PROPOSAL_DESCRIPTION = "This proposal shall execute the box store function to save the uint256 passed through proposal";

Please share the address of this contract, and if it's not verified, then also the relevant source code (of function store).

I have updated the codebase on github:

I am also getting the error-message unknown proposal id (using web3.js instead of ethers.js).

When replacing the call to function queue with a call to function hashProposal, I get the proposal ID:

3305017473121473530677496787189256930579673951344400163483606192674066961933

I have fetched all ProposalCreated events emitted on your contract, then printed their proposal IDs:

78200510593864238487692413528044418147351996167436432816965808706752306636557
68324702618435287546566225058326033655813071979791565699133978362957942069179
23670505454445824923619623170717269597749117747358593403776194495705034041949
82605036490429841284270784935956661701664080931123134183195205190816283128987
23750871644678753158591412962538059476262346703489738639735527685928527317119

None of these IDs corresponds with the one that you are trying to process, hence the error-message.

1 Like

Ok! Is it the problem with hashMessage ethers' method. Yes it worked after changing const descriptionHash = ethers.hashMessage((PROPOSAL_DESCRIPTION)); to const descriptionHash = ethers.id((PROPOSAL_DESCRIPTION));

Could be any of the parameters that you pass to function queue (or to function hashProposal).

I have printed all the rest of the relevant information in those events:

proposalId : 78200510593864238487692413528044418147351996167436432816965808706752306636557
targets    : [ '0xFF35DE2b1eb182Afa3205C9a3C283ef02135f8a6' ]
values     : [ '0' ]
calldatas  : [ '0x6057361d000000000000000000000000000000000000000000000000000000000000004d' ]
description: Proposal #1 in the governance contract

proposalId : 68324702618435287546566225058326033655813071979791565699133978362957942069179
targets    : [ '0xFF35DE2b1eb182Afa3205C9a3C283ef02135f8a6' ]
values     : [ '1' ]
calldatas  : [ '0x6057361d000000000000000000000000000000000000000000000000000000000000004d' ]
description: Proposal #1 in the governance contract

proposalId : 23670505454445824923619623170717269597749117747358593403776194495705034041949
targets    : [ '0xFF35DE2b1eb182Afa3205C9a3C283ef02135f8a6' ]
values     : [ '256' ]
calldatas  : [ '0x6057361d000000000000000000000000000000000000000000000000000000000000004d' ]
description: This is hilarious string is not going through

proposalId : 82605036490429841284270784935956661701664080931123134183195205190816283128987
targets    : [ '0xFF35DE2b1eb182Afa3205C9a3C283ef02135f8a6' ]
values     : [ '2409' ]
calldatas  : [ '0x6057361d000000000000000000000000000000000000000000000000000000000000004d' ]
description: This proposal shall execute the box store function to save the uint256 passed through proposal

proposalId : 23750871644678753158591412962538059476262346703489738639735527685928527317119
targets    : [ '0xFF35DE2b1eb182Afa3205C9a3C283ef02135f8a6' ]
values     : [ '1992' ]
calldatas  : [ '0x6057361d000000000000000000000000000000000000000000000000000000000000004d' ]
description: This proposal shall execute the box store function to save the uint256 passed through proposal

As you can see, there are actually two proposals baring this description, so it is not the problem.

However, you may notice that one of them has used:

values = [ '2409' ]`

And the other one has used:

values = [ '1992' ]`

When I try 2409, I get the error-message proposal not successful.
And when I try 1992, the function call completes successfully.
Trying it again, I get the error-message proposal not successful.
Probably due to this transaction, which has just been executed.

1 Like