stacks-network / stacks-blockchain-docker

Stacks-blockchain with API using docker compose
GNU General Public License v3.0
28 stars 38 forks source link

Import failed #65

Closed friedger closed 1 year ago

friedger commented 2 years ago

The import failed with the following message. Is there a way to recover from it?

{"level":"error","message":"Error processing new attachment message Could not find tx index for subdomain entry: {\"name\":\"id.stx\",\"namespace_id\":\"stx\",\"fully_qualified_subdomain\":\"shityfgugf.id.stx\",\"owner\":\"SP2B3ZYBT8BT45KMNTZWF21RMWC2J7WYD4HT1YCJN\",\"zonefile_hash\":\"a95a6a2aa0b1d8899faae0085abfc6ae\",\"zonefile\":\"$ORIGIN shityfgugf.id.stx\\n$TTL 3600\\n_http._tcp\\tIN\\tURI\\t10\\t1\\t\\\"https://gaia.blockstack.org/hub/1EhSzoXpYdqwhbabp2yEgwvzSzwguvxu1b/profile.json\\\"\\n\\n\",\"tx_id\":\"0x9893694d2998ee02eef542c3e53e57a68eaba46a03710bac4b62d83bce53e805\",\"tx_index\":-1,\"canonical\":true,\"parent_zonefile_hash\":\"9c813f5cb5d2376aa07f60e3561e817487daf71a\",\"parent_zonefile_index\":0,\"block_height\":49172,\"zonefile_offset\":1,\"resolver\":\"https://registrar.stacks.co\"}","stack":"Error: Could not find tx index for subdomain entry: {\"name\":\"id.stx\",\"namespace_id\":\"stx\",\"fully_qualified_subdomain\":\"shityfgugf.id.stx\",\"owner\":\"SP2B3ZYBT8BT45KMNTZWF21RMWC2J7WYD4HT1YCJN\",\"zonefile_hash\":\"a95a6a2aa0b1d8899faae0085abfc6ae\",\"zonefile\":\"$ORIGIN shityfgugf.id.stx\\n$TTL 3600\\n_http._tcp\\tIN\\tURI\\t10\\t1\\t\\\"https://gaia.blockstack.org/hub/1EhSzoXpYdqwhbabp2yEgwvzSzwguvxu1b/profile.json\\\"\\n\\n\",\"tx_id\":\"0x9893694d2998ee02eef542c3e53e57a68eaba46a03710bac4b62d83bce53e805\",\"tx_index\":-1,\"canonical\":true,\"parent_zonefile_hash\":\"9c813f5cb5d2376aa07f60e3561e817487daf71a\",\"parent_zonefile_index\":0,\"block_height\":49172,\"zonefile_offset\":1,\"resolver\":\"https://registrar.stacks.co\"}\n    at PgDataStore.updateBatchSubdomains (/app/src/datastore/postgres-store.ts:3930:17)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)\n    at /app/src/datastore/postgres-store.ts:1818:7\n    at /app/src/datastore/postgres-store.ts:716:24\n    at PgDataStore.query (/app/src/datastore/postgres-store.ts:702:22)\n    at PgDataStore.queryTx (/app/src/datastore/postgres-store.ts:713:12)\n    at PgDataStore.resolveBnsSubdomains (/app/src/datastore/postgres-store.ts:1817:5)\n    at handleNewAttachmentMessage (/app/src/event-stream/event-server.ts:647:11)\n    at run (/app/node_modules/p-queue/dist/index.js:163:29)","timestamp":"2022-03-12T11:21:12.024Z"}
stacks-blockchain-api    | {"level":"error","message":"error processing core-node /attachments/new: Error: Could not find tx index for subdomain entry: {\"name\":\"id.stx\",\"namespace_id\":\"stx\",\"fully_qualified_subdomain\":\"shityfgugf.id.stx\",\"owner\":\"SP2B3ZYBT8BT45KMNTZWF21RMWC2J7WYD4HT1YCJN\",\"zonefile_hash\":\"a95a6a2aa0b1d8899faae0085abfc6ae\",\"zonefile\":\"$ORIGIN shityfgugf.id.stx\\n$TTL 3600\\n_http._tcp\\tIN\\tURI\\t10\\t1\\t\\\"https://gaia.blockstack.org/hub/1EhSzoXpYdqwhbabp2yEgwvzSzwguvxu1b/profile.json\\\"\\n\\n\",\"tx_id\":\"0x9893694d2998ee02eef542c3e53e57a68eaba46a03710bac4b62d83bce53e805\",\"tx_index\":-1,\"canonical\":true,\"parent_zonefile_hash\":\"9c813f5cb5d2376aa07f60e3561e817487daf71a\",\"parent_zonefile_index\":0,\"block_height\":49172,\"zonefile_offset\":1,\"resolver\":\"https://registrar.stacks.co\"} Could not find tx index for subdomain entry: {\"name\":\"id.stx\",\"namespace_id\":\"stx\",\"fully_qualified_subdomain\":\"shityfgugf.id.stx\",\"owner\":\"SP2B3ZYBT8BT45KMNTZWF21RMWC2J7WYD4HT1YCJN\",\"zonefile_hash\":\"a95a6a2aa0b1d8899faae0085abfc6ae\",\"zonefile\":\"$ORIGIN shityfgugf.id.stx\\n$TTL 3600\\n_http._tcp\\tIN\\tURI\\t10\\t1\\t\\\"https://gaia.blockstack.org/hub/1EhSzoXpYdqwhbabp2yEgwvzSzwguvxu1b/profile.json\\\"\\n\\n\",\"tx_id\":\"0x9893694d2998ee02eef542c3e53e57a68eaba46a03710bac4b62d83bce53e805\",\"tx_index\":-1,\"canonical\":true,\"parent_zonefile_hash\":\"9c813f5cb5d2376aa07f60e3561e817487daf71a\",\"parent_zonefile_index\":0,\"block_height\":49172,\"zonefile_offset\":1,\"resolver\":\"https://registrar.stacks.co\"}","stack":"Error: Could not find tx index for subdomain entry: {\"name\":\"id.stx\",\"namespace_id\":\"stx\",\"fully_qualified_subdomain\":\"shityfgugf.id.stx\",\"owner\":\"SP2B3ZYBT8BT45KMNTZWF21RMWC2J7WYD4HT1YCJN\",\"zonefile_hash\":\"a95a6a2aa0b1d8899faae0085abfc6ae\",\"zonefile\":\"$ORIGIN shityfgugf.id.stx\\n$TTL 3600\\n_http._tcp\\tIN\\tURI\\t10\\t1\\t\\\"https://gaia.blockstack.org/hub/1EhSzoXpYdqwhbabp2yEgwvzSzwguvxu1b/profile.json\\\"\\n\\n\",\"tx_id\":\"0x9893694d2998ee02eef542c3e53e57a68eaba46a03710bac4b62d83bce53e805\",\"tx_index\":-1,\"canonical\":true,\"parent_zonefile_hash\":\"9c813f5cb5d2376aa07f60e3561e817487daf71a\",\"parent_zonefile_index\":0,\"block_height\":49172,\"zonefile_offset\":1,\"resolver\":\"https://registrar.stacks.co\"}\n    at PgDataStore.updateBatchSubdomains (/app/src/datastore/postgres-store.ts:3930:17)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)\n    at /app/src/datastore/postgres-store.ts:1818:7\n    at /app/src/datastore/postgres-store.ts:716:24\n    at PgDataStore.query (/app/src/datastore/postgres-store.ts:702:22)\n    at PgDataStore.queryTx (/app/src/datastore/postgres-store.ts:713:12)\n    at PgDataStore.resolveBnsSubdomains (/app/src/datastore/postgres-store.ts:1817:5)\n    at handleNewAttachmentMessage (/app/src/event-stream/event-server.ts:647:11)\n    at run (/app/node_modules/p-queue/dist/index.js:163:29)","timestamp":"2022-03-12T11:21:12.025Z"}
stacks-blockchain-api    | {"req":{"url":"/attachments/new","headers":{"content-length":"1478","content-type":"application/json","host":"127.0.0.1:46615","connection":"close"},"method":"POST","httpVersion":"1.1","originalUrl":"/attachments/new","query":{}},"res":{"statusCode":500},"responseTime":139,"level":"error","message":"HTTP POST /attachments/new","timestamp":"2022-03-12T11:21:12.025Z"}
wileyj commented 2 years ago

hmm. i've seen similar messages like this from the import myself - but ultimately the import logs that it was successful.

if you can share the full output, we might have to add it as an issue in the api repo, or ask the devs in the discord channel if it's something to look at.

friedger commented 2 years ago

@wileyj Here is the full log:

stacks-blockchain-api    | Raw event requests processed: 59% (127400 / 215780)
stacks-blockchain-api    | {"message":"Could not find transaction 0x83fb772fb07c494395cfe3c8ab90872ab3c8c7d9f7a92a7f411cc293357f22eb associated with attachment","level":"warn","timestamp":"2022-03-31T12:25:59.327Z"}
stacks-blockchain-api    | {"level":"error","message":"Error processing new attachment message Could not find tx index for subdomain entry: {\"name\":\"id.stx\",\"namespace_id\":\"stx\",\"fully_qualified_subdomain\":\"beyondhuman.id.stx\",\"owner\":\"SP3QKWXJAMBH7BKXWW84SQ832KVF4ZZ0PDH41PZXH\",\"zonefile_hash\":\"d5901aad7c6677c0e1b7ab5fc8d2b1ea\",\"zonefile\":\"$ORIGIN beyondhuman.id.stx\\n$TTL 3600\\n_http._tcp\\tIN\\tURI\\t10\\t1\\t\\\"https://gaia.blockstack.org/hub/1Np1KnjvE5cCf5ZwDK8u8DfET2pyWbUpnt/profile.json\\\"\\n\\n\",\"tx_id\":\"0x83fb772fb07c494395cfe3c8ab90872ab3c8c7d9f7a92a7f411cc293357f22eb\",\"tx_index\":-1,\"canonical\":true,\"parent_zonefile_hash\":\"543e5f2ec70349cdd6e4c30ba70dbdc3694fafc5\",\"parent_zonefile_index\":0,\"block_height\":46198,\"zonefile_offset\":1,\"resolver\":\"https://registrar.stacks.co\"}","stack":"Error: Could not find tx index for subdomain entry: {\"name\":\"id.stx\",\"namespace_id\":\"stx\",\"fully_qualified_subdomain\":\"beyondhuman.id.stx\",\"owner\":\"SP3QKWXJAMBH7BKXWW84SQ832KVF4ZZ0PDH41PZXH\",\"zonefile_hash\":\"d5901aad7c6677c0e1b7ab5fc8d2b1ea\",\"zonefile\":\"$ORIGIN beyondhuman.id.stx\\n$TTL 3600\\n_http._tcp\\tIN\\tURI\\t10\\t1\\t\\\"https://gaia.blockstack.org/hub/1Np1KnjvE5cCf5ZwDK8u8DfET2pyWbUpnt/profile.json\\\"\\n\\n\",\"tx_id\":\"0x83fb772fb07c494395cfe3c8ab90872ab3c8c7d9f7a92a7f411cc293357f22eb\",\"tx_index\":-1,\"canonical\":true,\"parent_zonefile_hash\":\"543e5f2ec70349cdd6e4c30ba70dbdc3694fafc5\",\"parent_zonefile_index\":0,\"block_height\":46198,\"zonefile_offset\":1,\"resolver\":\"https://registrar.stacks.co\"}\n    at PgDataStore.updateBatchSubdomains (/app/src/datastore/postgres-store.ts:3930:17)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)\n    at /app/src/datastore/postgres-store.ts:1818:7\n    at /app/src/datastore/postgres-store.ts:716:24\n    at PgDataStore.query (/app/src/datastore/postgres-store.ts:702:22)\n    at PgDataStore.queryTx (/app/src/datastore/postgres-store.ts:713:12)\n    at PgDataStore.resolveBnsSubdomains (/app/src/datastore/postgres-store.ts:1817:5)\n    at handleNewAttachmentMessage (/app/src/event-stream/event-server.ts:647:11)\n    at run (/app/node_modules/p-queue/dist/index.js:163:29)","timestamp":"2022-03-31T12:25:59.474Z"}
stacks-blockchain-api    | {"level":"error","message":"error processing core-node /attachments/new: Error: Could not find tx index for subdomain entry: {\"name\":\"id.stx\",\"namespace_id\":\"stx\",\"fully_qualified_subdomain\":\"beyondhuman.id.stx\",\"owner\":\"SP3QKWXJAMBH7BKXWW84SQ832KVF4ZZ0PDH41PZXH\",\"zonefile_hash\":\"d5901aad7c6677c0e1b7ab5fc8d2b1ea\",\"zonefile\":\"$ORIGIN beyondhuman.id.stx\\n$TTL 3600\\n_http._tcp\\tIN\\tURI\\t10\\t1\\t\\\"https://gaia.blockstack.org/hub/1Np1KnjvE5cCf5ZwDK8u8DfET2pyWbUpnt/profile.json\\\"\\n\\n\",\"tx_id\":\"0x83fb772fb07c494395cfe3c8ab90872ab3c8c7d9f7a92a7f411cc293357f22eb\",\"tx_index\":-1,\"canonical\":true,\"parent_zonefile_hash\":\"543e5f2ec70349cdd6e4c30ba70dbdc3694fafc5\",\"parent_zonefile_index\":0,\"block_height\":46198,\"zonefile_offset\":1,\"resolver\":\"https://registrar.stacks.co\"} Could not find tx index for subdomain entry: {\"name\":\"id.stx\",\"namespace_id\":\"stx\",\"fully_qualified_subdomain\":\"beyondhuman.id.stx\",\"owner\":\"SP3QKWXJAMBH7BKXWW84SQ832KVF4ZZ0PDH41PZXH\",\"zonefile_hash\":\"d5901aad7c6677c0e1b7ab5fc8d2b1ea\",\"zonefile\":\"$ORIGIN beyondhuman.id.stx\\n$TTL 3600\\n_http._tcp\\tIN\\tURI\\t10\\t1\\t\\\"https://gaia.blockstack.org/hub/1Np1KnjvE5cCf5ZwDK8u8DfET2pyWbUpnt/profile.json\\\"\\n\\n\",\"tx_id\":\"0x83fb772fb07c494395cfe3c8ab90872ab3c8c7d9f7a92a7f411cc293357f22eb\",\"tx_index\":-1,\"canonical\":true,\"parent_zonefile_hash\":\"543e5f2ec70349cdd6e4c30ba70dbdc3694fafc5\",\"parent_zonefile_index\":0,\"block_height\":46198,\"zonefile_offset\":1,\"resolver\":\"https://registrar.stacks.co\"}","stack":"Error: Could not find tx index for subdomain entry: {\"name\":\"id.stx\",\"namespace_id\":\"stx\",\"fully_qualified_subdomain\":\"beyondhuman.id.stx\",\"owner\":\"SP3QKWXJAMBH7BKXWW84SQ832KVF4ZZ0PDH41PZXH\",\"zonefile_hash\":\"d5901aad7c6677c0e1b7ab5fc8d2b1ea\",\"zonefile\":\"$ORIGIN beyondhuman.id.stx\\n$TTL 3600\\n_http._tcp\\tIN\\tURI\\t10\\t1\\t\\\"https://gaia.blockstack.org/hub/1Np1KnjvE5cCf5ZwDK8u8DfET2pyWbUpnt/profile.json\\\"\\n\\n\",\"tx_id\":\"0x83fb772fb07c494395cfe3c8ab90872ab3c8c7d9f7a92a7f411cc293357f22eb\",\"tx_index\":-1,\"canonical\":true,\"parent_zonefile_hash\":\"543e5f2ec70349cdd6e4c30ba70dbdc3694fafc5\",\"parent_zonefile_index\":0,\"block_height\":46198,\"zonefile_offset\":1,\"resolver\":\"https://registrar.stacks.co\"}\n    at PgDataStore.updateBatchSubdomains (/app/src/datastore/postgres-store.ts:3930:17)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)\n    at /app/src/datastore/postgres-store.ts:1818:7\n    at /app/src/datastore/postgres-store.ts:716:24\n    at PgDataStore.query (/app/src/datastore/postgres-store.ts:702:22)\n    at PgDataStore.queryTx (/app/src/datastore/postgres-store.ts:713:12)\n    at PgDataStore.resolveBnsSubdomains (/app/src/datastore/postgres-store.ts:1817:5)\n    at handleNewAttachmentMessage (/app/src/event-stream/event-server.ts:647:11)\n    at run (/app/node_modules/p-queue/dist/index.js:163:29)","timestamp":"2022-03-31T12:25:59.475Z"}
stacks-blockchain-api    | {"req":{"url":"/attachments/new","headers":{"content-length":"1480","content-type":"application/json","host":"127.0.0.1:33415","connection":"close"},"method":"POST","httpVersion":"1.1","originalUrl":"/attachments/new","query":{}},"res":{"statusCode":500},"responseTime":154,"level":"error","message":"HTTP POST /attachments/new","timestamp":"2022-03-31T12:25:59.476Z"}
postgres                 | 2022-03-31 12:25:59.482 UTC [37] LOG:  unexpected EOF on client connection with an open transaction
stacks-blockchain-api    | Error: Bad status response status code 500: Internal Server Error
stacks-blockchain-api    |     at IncomingMessage.<anonymous> (/app/src/helpers.ts:359:29)
stacks-blockchain-api    |     at IncomingMessage.emit (events.js:412:35)
stacks-blockchain-api    |     at endReadableNT (internal/streams/readable.js:1334:12)
stacks-blockchain-api    |     at processTicksAndRejections (internal/process/task_queues.js:82:21) {
stacks-blockchain-api    |   requestUrl: 'http://127.0.0.1:33415/attachments/new',
stacks-blockchain-api    |   statusCode: 500,
stacks-blockchain-api    |   response: '{"error":{}}'
stacks-blockchain-api    | }
stacks-blockchain-api exited with code 1
rafaelcr commented 2 years ago

@friedger I've also seen similar attachment errors during event import but also it ends up being a successful process.

The 500 error I've never seen, though. Can you share the TSV you're using to import? Perhaps there's some corruption in there.

Also, could you transfer/clone this issue into the API repo? Thanks

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 1 year ago

This issue has been automatically closed. Please reopen if needed.