Permission denied when signing transaction on testnet

Hi there,

I am trying to sign a transaction on the testnet which is sending 1 Ada from one address to another. I used the following commands:

 cardano-cli transaction build-raw \
 --tx-in ce75fae122908ab08900188f87e5ff43a2ffd4bc66fdd3a7cd03581918a6bdd2#0 \
 --tx-out $(cat addr1/payment1.addr)+998471113 \
 --tx-out $(cat addr2/payment2.addr)+1000000 \
 --ttl 31082159 \
 --fee 174609 \
 --out-file tx3.raw \
 --mary-era
 cardano-cli transaction sign \
 --tx-body-file tx3.raw \
 --signing-key-file $(addr1/payment1.skey) \
 --testnet-magic 1097911063 \
 --out-file tx3.signed \
 --mary-era

However I get the following message when I attempt to sign the transaction.

bash: addr1/payment1.skey: Permission denied
Invalid argument `1097911063'

I could build and sign transactions just fine before, and then I sent some testcoin from the faucet to that input address, does that change anything. I’ve noticed that I now need to include the --mary-era flag now for some transaction commands.

Does anyone know what I am doing wrong?

Thanks.

Edit:
When I change the build-raw command to:

 cardano-cli transaction build-raw \
 --tx-in ce75fae122908ab08900188f87e5ff43a2ffd4bc66fdd3a7cd03581918a6bdd2#0 \
 --tx-out $(cat addr2/payment2.addr)+1000000 \
 --tx-out $(cat addr1/payment1.addr)+998471113 \
 --ttl 31082159 \
 --fee 174609 \
 --out-file tx3.raw \
 --mary-era

I get a different message when attempting to sign:

Invalid argument `"type":'

query utxo gives the following:

                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
307ad8b1c96516dd97a5fbee97e1b43c3dc8763db0509b6863046c266bad7a9a     0        1407406 lovelace + 2 6b8d07d69639e9413dd637a1a815a7323c69c86abbafb66dbfdb1aa7
ce75fae122908ab08900188f87e5ff43a2ffd4bc66fdd3a7cd03581918a6bdd2     0        999645722 lovelace

It is the second utxo that is the input for the transaction. Ever since I sent tADA (the 2 tokens in the first utxo) to this address I have had problems whether it has to do with the shelley vs. mary or the error above. Can anyone explain what changed when I sent the tokens and how I am meant to build and sign transactions now because following the tutorial from cardano foundation doesn’t work.

I had a problem with my --signing-key-file $(addr1/payment1.skey) flag because it is missing cat.
Should’ve looked like this: --signing-key-file $(cat addr1/payment1.skey).

Now I get the following problem:

Shelley command failed: transaction sign  Error: Error reading signing key: {
    "type": "PaymentSigningKeyShelley_ed25519",
    "description": "Payment Signing Key",
    "cborHex": "5820afd61ccfc71a4ae44987caebc7fcdb89dddead58c80ccb98a82069e5c80dea96"
}: {
    "type": "PaymentSigningKeyShelley_ed25519",
    "description": "Payment Signing Key",
    "cborHex": "5820afd61ccfc71a4ae44987caebc7fcdb89dddead58c80ccb98a82069e5c80dea96"
}: openBinaryFile: does not exist (No such file or directory)

I see this issue was posted in this forum here but was never solved.

Now I feel stupid but I hope this thread helps other people not make the same mistake…

My mistake was in how I was passing in the singing key to the command: I should not be using $(cat addr1/payment1.skey) but rather I am meant to just pass in the file.