user80246: I'm seeking help in redeeming a p2sh transaction using the standard tools from bitcoin core, e.g., bitcoin-cli or using directly the RPC commands via curl would also be fine.
Creating the P2SH address
locking funds in a p2sh address is not the problem I assume, e.g., I handled it that way:
intput
bitcoin-cli -regtest decodescript "935787"

output
{
  "asm": "OP_ADD 7 OP_EQUAL",
  "type": "nonstandard",
  "p2sh": "2N2Mn4F9tUVy9cRTzBQhQTiMpi2Kpwzkyn6"
}

in order to redeem that script I would need two numbers equaling 7 right, e.g., 
1 6
Locking some funding in a p2sh
so let's spend some funds into the p2sh
input
bitcoin-cli -regtest sendtoaddress 2N2Mn4F9tUVy9cRTzBQhQTiMpi2Kpwzkyn6 40

output
5589b316dc210174d988bfab333f93101cea40f5914a1ab833a9bbe56faf55ca```

here is the raw transaction 
input
bitcoin-cli --regtest getrawtransaction 5589b316dc210174d988bfab333f93101cea40f5914a1ab833a9bbe56faf55ca

output
0200000001cef241d611112f7f9c98a8e825eb801dad923767126bee7c9ec190950c06ba24000000004847304402202d25bc67043c3cc2ec5fbf6b0bfe7e49b0a5f29e3891f5da005f3350188bc79502202ca014de3b60ede7f3b3bf2080ed33a06c9cb39f588178907f48b09caa0b1bca01feffffff0200286bee0000000017a91463f665a76eef10e84662c82bec9aff641edf42ec8750bb9a3b0000000017a914c12b3404c4e13900c5bfefc886533d7eb59524228766000000

or decoded it is:
{
  "txid": "5589b316dc210174d988bfab333f93101cea40f5914a1ab833a9bbe56faf55ca",
  "hash": "5589b316dc210174d988bfab333f93101cea40f5914a1ab833a9bbe56faf55ca",
  "version": 2,
  "size": 187,
  "vsize": 187,
  "locktime": 102,
  "vin": [
    {
      "txid": "24ba060c9590c19e7cee6b12673792ad1d80eb25e8a8989c7f2f1111d641f2ce",
      "vout": 0,
      "scriptSig": {
        "asm": "304402202d25bc67043c3cc2ec5fbf6b0bfe7e49b0a5f29e3891f5da005f3350188bc79502202ca014de3b60ede7f3b3bf2080ed33a06c9cb39f588178907f48b09caa0b1bca[ALL]",
        "hex": "47304402202d25bc67043c3cc2ec5fbf6b0bfe7e49b0a5f29e3891f5da005f3350188bc79502202ca014de3b60ede7f3b3bf2080ed33a06c9cb39f588178907f48b09caa0b1bca01"
      },
      "sequence": 4294967294
    }
  ],
  "vout": [
    {
      "value": 40.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_HASH160 63f665a76eef10e84662c82bec9aff641edf42ec OP_EQUAL",
        "hex": "a91463f665a76eef10e84662c82bec9aff641edf42ec87",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "2N2Mn4F9tUVy9cRTzBQhQTiMpi2Kpwzkyn6"
        ]
      }
    },
    {
      "value": 9.99996240,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_HASH160 c12b3404c4e13900c5bfefc886533d7eb5952422 OP_EQUAL",
        "hex": "a914c12b3404c4e13900c5bfefc886533d7eb595242287",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "2NArcA7oJfBkH6ZWBfh2TaTQkvKYMoK9xhd"
        ]
      }
    }
  ]
}

Creating a new UTXO spending from that p2sh transaction
now I want to redeem that tx, so first create a raw transaction with the old tx as input
input
bitcoin-cli -regtest createrawtransaction "[{\"txid\":\"5589b316dc210174d988bfab333f93101cea40f5914a1ab833a9bbe56faf55ca\",\"vout\":0}]" "{\"2NACSKxqUhLRHTwaSN3xaJpti6BEPyDFSUJ\":39}"

output
0200000001ca55af6fe5bba933b81a4a91f540ea1c10933f33abbf88d9740121dc16b389550000000000ffffffff01004775e80000000017a914b9f330d64c88295017c651d2117785f212cb59938700000000

Signing that UTXO to redeem it
and I figure in the next step I assume I'd have to sign the transaction using the redeemScript, i.e., the redeemScript is:
515603935787 
which is the hex form of:
1 6 PUSH 935787
I tried to sign the tx using: 
input
bitcoin-cli -regtest signrawtransaction "0200000001ca55af6fe5bba933b81a4a91f540ea1c10933f33abbf88d9740121dc16b389550000000000ffffffff01004775e80000000017a914b9f330d64c88295017c651d2117785f212cb59938700000000" "[{\"txid\":\"5589b316dc210174d988bfab333f93101cea40f5914a1ab833a9bbe56faf55ca\",\"vout\":0,\"scriptPubKey\":\"a91463f665a76eef10e84662c82bec9aff641edf42ec87\",\"redeemscript\":\"515603935787\"}]"

Output
{
  "hex": "0200000001ca55af6fe5bba933b81a4a91f540ea1c10933f33abbf88d9740121dc16b389550000000000ffffffff01004775e80000000017a914b9f330d64c88295017c651d2117785f212cb59938700000000",
  "complete": false,
  "errors": [
    {
      "txid": "5589b316dc210174d988bfab333f93101cea40f5914a1ab833a9bbe56faf55ca",
      "vout": 0,
      "witness": [
      ],
      "scriptSig": "",
      "sequence": 4294967295,
      "error": "Unable to sign input, invalid stack size (possibly missing key)"
    }
  ]
}

and that's where I don't know any further. 
I always get the error Unable to sign input, invalid stack size (possibly missing key) any idea what I am missing? 
kind regards,
Jagoda
note: I already had a look at various links here on stackexchange/stackoverflow and the official developer wiki but couldn't find an easy to follow tutorial.
Tutorials I had a look at which might be useful for future references:

2 out of 3 multi sig (outdated) 
p2sh step by step example
sign raw transaction


user12983: You do not need to sign transaction because your redeemScript "OP_ADD 7 OP_EQUAL" does not contain OP_CHECKSIG* operations
Just fill the scriptSig
0200000001ca55af6fe5bba933b81a4a91f540ea1c10933f33abbf88d9740121dc16b389550000000006515603935787ffffffff01004775e80000000017a914b9f330d64c88295017c651d2117785f212cb59938700000000

user48884: You cannot use Bitcoin Core to create your transaction because it does not know what to do with non-standard inputs. There is no need to use signrawtransaction because you are not signing anything. In order to make your transaction spendable, you will need to do it manually by inserting the scriptSig that you figured out yourself.

80246: <p>I'm seeking help in redeeming a p2sh transaction using the standard tools from bitcoin core, e.g., bitcoin-cli or using directly the RPC commands via curl would also be fine.</p>

<h2>Creating the P2SH address</h2>

<p>locking funds in a p2sh address is not the problem I assume, e.g., I handled it that way:</p>

<h3>intput</h3>

<pre><code>bitcoin-cli -regtest decodescript "935787"
</code></pre>

<h3>output</h3>

<pre><code>{
  "asm": "OP_ADD 7 OP_EQUAL",
  "type": "nonstandard",
  "p2sh": "2N2Mn4F9tUVy9cRTzBQhQTiMpi2Kpwzkyn6"
}
</code></pre>

<p>in order to redeem that script I would need two numbers equaling 7 right, e.g., 
<code>1 6</code></p>

<h2>Locking some funding in a p2sh</h2>

<p>so let's spend some funds into the p2sh</p>

<h3>input</h3>

<pre><code>bitcoin-cli -regtest sendtoaddress 2N2Mn4F9tUVy9cRTzBQhQTiMpi2Kpwzkyn6 40
</code></pre>

<h3>output</h3>

<pre><code>5589b316dc210174d988bfab333f93101cea40f5914a1ab833a9bbe56faf55ca```
</code></pre>

<p>here is the raw transaction </p>

<h3>input</h3>

<pre><code>bitcoin-cli --regtest getrawtransaction 5589b316dc210174d988bfab333f93101cea40f5914a1ab833a9bbe56faf55ca
</code></pre>

<h3>output</h3>

<pre><code>0200000001cef241d611112f7f9c98a8e825eb801dad923767126bee7c9ec190950c06ba24000000004847304402202d25bc67043c3cc2ec5fbf6b0bfe7e49b0a5f29e3891f5da005f3350188bc79502202ca014de3b60ede7f3b3bf2080ed33a06c9cb39f588178907f48b09caa0b1bca01feffffff0200286bee0000000017a91463f665a76eef10e84662c82bec9aff641edf42ec8750bb9a3b0000000017a914c12b3404c4e13900c5bfefc886533d7eb59524228766000000
</code></pre>

<p>or decoded it is:</p>

<pre><code>{
  "txid": "5589b316dc210174d988bfab333f93101cea40f5914a1ab833a9bbe56faf55ca",
  "hash": "5589b316dc210174d988bfab333f93101cea40f5914a1ab833a9bbe56faf55ca",
  "version": 2,
  "size": 187,
  "vsize": 187,
  "locktime": 102,
  "vin": [
    {
      "txid": "24ba060c9590c19e7cee6b12673792ad1d80eb25e8a8989c7f2f1111d641f2ce",
      "vout": 0,
      "scriptSig": {
        "asm": "304402202d25bc67043c3cc2ec5fbf6b0bfe7e49b0a5f29e3891f5da005f3350188bc79502202ca014de3b60ede7f3b3bf2080ed33a06c9cb39f588178907f48b09caa0b1bca[ALL]",
        "hex": "47304402202d25bc67043c3cc2ec5fbf6b0bfe7e49b0a5f29e3891f5da005f3350188bc79502202ca014de3b60ede7f3b3bf2080ed33a06c9cb39f588178907f48b09caa0b1bca01"
      },
      "sequence": 4294967294
    }
  ],
  "vout": [
    {
      "value": 40.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_HASH160 63f665a76eef10e84662c82bec9aff641edf42ec OP_EQUAL",
        "hex": "a91463f665a76eef10e84662c82bec9aff641edf42ec87",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "2N2Mn4F9tUVy9cRTzBQhQTiMpi2Kpwzkyn6"
        ]
      }
    },
    {
      "value": 9.99996240,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_HASH160 c12b3404c4e13900c5bfefc886533d7eb5952422 OP_EQUAL",
        "hex": "a914c12b3404c4e13900c5bfefc886533d7eb595242287",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "2NArcA7oJfBkH6ZWBfh2TaTQkvKYMoK9xhd"
        ]
      }
    }
  ]
}
</code></pre>

<h2>Creating a new UTXO spending from that p2sh transaction</h2>

<p>now I want to redeem that tx, so first create a raw transaction with the old tx as input</p>

<h3>input</h3>

<pre><code>bitcoin-cli -regtest createrawtransaction "[{\"txid\":\"5589b316dc210174d988bfab333f93101cea40f5914a1ab833a9bbe56faf55ca\",\"vout\":0}]" "{\"2NACSKxqUhLRHTwaSN3xaJpti6BEPyDFSUJ\":39}"
</code></pre>

<h3>output</h3>

<pre><code>0200000001ca55af6fe5bba933b81a4a91f540ea1c10933f33abbf88d9740121dc16b389550000000000ffffffff01004775e80000000017a914b9f330d64c88295017c651d2117785f212cb59938700000000
</code></pre>

<h2>Signing that UTXO to redeem it</h2>

<p>and I figure in the next step I assume I'd have to sign the transaction using the redeemScript, i.e., the redeemScript is:</p>

<p><code>515603935787</code> 
which is the hex form of:
<code>1 6 PUSH 935787</code></p>

<p>I tried to sign the tx using: </p>

<h3>input</h3>

<pre><code>bitcoin-cli -regtest signrawtransaction "0200000001ca55af6fe5bba933b81a4a91f540ea1c10933f33abbf88d9740121dc16b389550000000000ffffffff01004775e80000000017a914b9f330d64c88295017c651d2117785f212cb59938700000000" "[{\"txid\":\"5589b316dc210174d988bfab333f93101cea40f5914a1ab833a9bbe56faf55ca\",\"vout\":0,\"scriptPubKey\":\"a91463f665a76eef10e84662c82bec9aff641edf42ec87\",\"redeemscript\":\"515603935787\"}]"
</code></pre>

<p>Output</p>

<pre><code>{
  "hex": "0200000001ca55af6fe5bba933b81a4a91f540ea1c10933f33abbf88d9740121dc16b389550000000000ffffffff01004775e80000000017a914b9f330d64c88295017c651d2117785f212cb59938700000000",
  "complete": false,
  "errors": [
    {
      "txid": "5589b316dc210174d988bfab333f93101cea40f5914a1ab833a9bbe56faf55ca",
      "vout": 0,
      "witness": [
      ],
      "scriptSig": "",
      "sequence": 4294967295,
      "error": "Unable to sign input, invalid stack size (possibly missing key)"
    }
  ]
}
</code></pre>

<p>and that's where I don't know any further. 
I always get the error <code>Unable to sign input, invalid stack size (possibly missing key)</code> any idea what I am missing? </p>

<p>kind regards,
Jagoda</p>

<p>note: I already had a look at various links here on stackexchange/stackoverflow and the official developer wiki but couldn't find an easy to follow tutorial.
Tutorials I had a look at which might be useful for future references:</p>

<ul>
<li><a href="https://gist.githubusercontent.com/gavinandresen/3966071/raw/ca21870c190ba0e90c1a30673e790ef5acd207d2/TwoOfThree.sh" rel="noreferrer">2 out of 3 multi sig (outdated)</a> </li>
<li><a href="https://bitcoin.stackexchange.com/questions/66197/step-by-step-example-to-redeem-a-p2sh-output-required">p2sh step by step example</a></li>
<li><a href="https://bitcoin.stackexchange.com/questions/29955/how-to-sign-bitcoin-transaction-with-bitcoind-and-non-bitcoind-wallet-private">sign raw transaction</a></li>
</ul>
 12983: <p>You do not need to sign transaction because your redeemScript <code>"OP_ADD 7 OP_EQUAL"</code> does not contain <code>OP_CHECKSIG*</code> operations</p>

<p>Just fill the scriptSig</p>

<p>0200000001ca55af6fe5bba933b81a4a91f540ea1c10933f33abbf88d9740121dc16b3895500000000<strong>06515603935787</strong>ffffffff01004775e80000000017a914b9f330d64c88295017c651d2117785f212cb59938700000000</p>
 48884: <p>You cannot use Bitcoin Core to create your transaction because it does not know what to do with non-standard inputs. There is no need to use <code>signrawtransaction</code> because you are not signing anything. In order to make your transaction spendable, you will need to do it manually by inserting the scriptSig that you figured out yourself.</p>
