hiero-ledger / hiero-ledger/hiero-consensus-node

`PREPARED_UPDATE_FILE_IS_IMMUTABLE` error when attempting to upload network artifact after an upgrade

Open
#4,899 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
406
Forks
226
Avg merge
3d 4h
Merged PRs (30d)
210

Description

### Description

When doing migration testing for a config-only upgrade as done in 2023-01-20 maintenance window, we discovered that an upload of the network artifact fails after the network upgrades fails with this message in yahcli:

```
docker run -it -v $(pwd):/launch gcr.io/hedera-registry/yahcli:0.3.0 -f 100000000 -a 4 -n mainnet -p 58 sysfiles upload software-zip --bytes-per-append 5140 --appends-per-burst 512
Log level is WARN
Targeting mainnet, paying with 0.0.58
Please enter the passphrase for key file mainnet/keys/account58.pem:
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
.i. Beginning upload for 0.0.150 (14144 appends required)
.i. Submitting initial update for file 0.0.150
2023-02-07 15:52:25.585 ERROR 61 CustomSpecAssert - Operation 'HapiFileUpdate{sigs=1, payer=DEFAULT_PAYER, node=0.0.4, fileName=0.0.150}' :: Wrong status! Expected SUCCESS, was PREPARED_UPDATE_FILE_IS_IMMUTABLE
2023-02-07 15:52:25.595 WARN 205 HapiSpecOperation - 'UploadSystemFile-150' - CustomSpecAssert failed com.hedera.services.bdd.spec.exceptions.HapiTxnCheckStateException: Wrong status! Expected SUCCESS, was PREPARED_UPDATE_FILE_IS_IMMUTABLE!
2023-02-07 15:52:25.596 ERROR 61 CustomSpecAssert - Operation 'CustomSpecAssert' :: com.hedera.services.bdd.spec.exceptions.HapiTxnCheckStateException: Wrong status! Expected SUCCESS, was PREPARED_UPDATE_FILE_IS_IMMUTABLE
2023-02-07 15:52:25.596 WARN 205 HapiSpecOperation - 'UploadSystemFile-150' - SourcedOp failed java.lang.IllegalStateException: com.hedera.services.bdd.spec.exceptions.HapiTxnCheckStateException: Wrong status! Expected SUCCESS, was PREPARED_UPDATE_FILE_IS_IMMUTABLE!
.!. FAILED Uploading requested system files
```

This required a freeze-abort to be triggered before upload could succeed.

The root cause is that "we only 'discard prepared upgrade metadata' when the software version actually increases. We desire to discard upgrade metadata without a version bump.

### Steps to reproduce

1. Create config-only upgrade
2. Start hedera network on your favorite preproducution network
3. Upload artifacts, issue freeze-prepare, freeze-upgrade commands
4. Great success
5. Upload artifact again

Expect: Great success
Observe: PREPARED_UPDATE_FILE_IS_IMMUTABLE

### Additional context

_No response_

### Hedera network

mainnet, testnet, previewnet, other

### Version

v0.33.3

### Operating system

None

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the config-only upgrade sequence described in the issue: upload artifacts, run freeze-prepare and freeze-upgrade, then upload the artifact again. Trace the handling of prepared upgrade metadata after a config-only upgrade; done means the second upload succeeds without requiring a freeze-abort.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.