Unhandled rejection NoSuchKey exception



  • Hi guys!
    We are using custom jsreport@2.7.2 docker container along with jsreport-fs-store@2.7.2 and jsreport-fs-store-aws-s3-persistence@1.4.0 plugins.

    Here is the content of jsreport.config.json file:

      "extensions": {
        "fs-store": {
          "persistence": {
            "provider": "aws-s3"
          },
          "compactionInterval": 20000
        },
        "fs-store-aws-s3-persistence": {
          "lock": {
            "queueName": "jsreport-lock.fifo"
          }
        },
        "scripts": {
          "timeout": 40000,
          "strategy": "http-server"
        }
      },
      "httpPort": 5488,
      "store": {
        "provider": "fs"
      },
      "allowLocalFilesAccess": true,
      "templatingEngines": {
        "strategy": "http-server"
      },
      "reportTimeout": 40000
    }
    

    In general, everything works well.
    One thing which bothers me - our log is full of Unhandled rejection NoSuchKey: The specified key does not exist. stacktraces.

    Full log from the very beginning:

    2020-03-25T14:50:49.558Z - info: Initializing jsreport@2.7.2 in production mode using configuration file: jsreport.config.json
    2020-03-25T14:50:49.561Z - info: Searching for available extensions in /app/
    2020-03-25T14:50:49.566Z - info: Extensions location cache not found, crawling directories
    2020-03-25T14:50:49.799Z - info: Found 36 extensions
    2020-03-25T14:50:49.956Z - info: Setting http-server strategy for rendering
    2020-03-25T14:50:50.054Z - info: Using extension authentication@2.4.2
    2020-03-25T14:50:50.076Z - info: Using extension cli@2.2.2
    2020-03-25T14:50:50.078Z - info: Using extension debug@2.1.3
    2020-03-25T14:50:50.079Z - info: Using extension express@2.6.0
    2020-03-25T14:50:50.138Z - info: Using extension freeze@2.0.0
    2020-03-25T14:50:50.139Z - info: Using extension handlebars@2.1.0
    2020-03-25T14:50:50.140Z - info: Using extension import-export@1.5.1
    2020-03-25T14:50:50.167Z - info: Using extension jsrender@2.1.1
    2020-03-25T14:50:50.168Z - info: Using extension tags@2.3.0
    2020-03-25T14:50:50.171Z - info: Using extension templates@2.3.2
    2020-03-25T14:50:50.173Z - info: Using extension authorization@2.2.6
    2020-03-25T14:50:50.174Z - info: Using extension base@2.0.2
    2020-03-25T14:50:50.175Z - info: Using extension browser-client@2.2.2
    2020-03-25T14:50:50.177Z - info: Using extension child-templates@1.3.1
    2020-03-25T14:50:50.179Z - info: Using extension chrome-pdf@1.7.1
    2020-03-25T14:50:50.214Z - info: Using extension data@2.2.0
    2020-03-25T14:50:50.214Z - info: Using extension docx@2.5.0
    2020-03-25T14:50:50.218Z - info: Using extension fs-store@2.7.2
    2020-03-25T14:50:50.294Z - info: Using extension licensing@2.2.1
    2020-03-25T14:50:50.297Z - info: Using extension pdf-utils@1.6.1
    2020-03-25T14:50:50.388Z - info: Using extension pptx@0.5.0
    2020-03-25T14:50:50.389Z - info: Using extension reports@2.2.1
    2020-03-25T14:50:50.391Z - info: Using extension static-pdf@0.3.1
    2020-03-25T14:50:50.393Z - info: Using extension studio@2.7.0
    2020-03-25T14:50:50.439Z - info: Using extension text@2.0.0
    2020-03-25T14:50:50.441Z - info: Using extension version-control@1.3.2
    2020-03-25T14:50:50.473Z - info: Using extension assets@1.5.2
    2020-03-25T14:50:50.479Z - info: Using extension fs-store-aws-s3-persistence@1.4.0
    2020-03-25T14:50:50.527Z - info: Using extension html-to-xlsx@2.6.0
    2020-03-25T14:50:50.654Z - info: html-to-xlsx detected chrome as available html engine
    2020-03-25T14:50:50.655Z - info: Using extension scheduling@2.2.0
    2020-03-25T14:50:50.672Z - info: Using extension scripts@2.3.0
    2020-03-25T14:50:50.675Z - info: Using extension studio-theme-dark@0.3.0
    2020-03-25T14:50:50.675Z - info: Using extension xlsx@2.3.0
    2020-03-25T14:50:50.740Z - info: Using extension public-templates@2.1.0
    2020-03-25T14:50:50.740Z - info: Using extension resources@2.0.3
    2020-03-25T14:50:50.741Z - info: Using extension sample-template@2.5.1
    2020-03-25T14:50:50.742Z - info: Using general timeout for rendering (reportTimeout: 40000)
    2020-03-25T14:50:50.742Z - info: Using fs provider for template store.
    2020-03-25T14:50:50.745Z - info: fs store is persisting using aws-s3
    2020-03-25T14:50:50.766Z - info: fs store sync is disabled
    2020-03-25T14:50:50.766Z - info: fs store is verifying aws s3 <AWS S3 bucket> exists and is accessible
    2020-03-25T14:50:50.789Z - info: fs store underlying changes synchronization with studio is disabled
    2020-03-25T14:50:50.820Z - info: fs store is verifying SQS for locking in <AWS S3 region> with name jsreport-lock.fifo
    2020-03-25T14:50:51.296Z - info: fs store is loading data
    2020-03-25T14:50:55.870Z - info: fs store is initialized successfully
    2020-03-25T14:50:55.886Z - info: Creating default express app.
    2020-03-25T14:50:55.898Z - info: jsreport server successfully started on http port: 5488
    2020-03-25T14:50:55.900Z - info: Verifying license key <license key>
    2020-03-25T14:50:56.269Z - info: Storing license verification information to jsreport.license.json
    2020-03-25T14:50:56.274Z - info: reporter initialized
    Unhandled rejection NoSuchKey: The specified key does not exist.
        at Request.extractError (/app/node_modules/aws-sdk/lib/services/s3.js:585:35)
        at Request.callListeners (/app/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
        at Request.emit (/app/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
        at Request.emit (/app/node_modules/aws-sdk/lib/request.js:683:14)
        at Request.transition (/app/node_modules/aws-sdk/lib/request.js:22:10)
        at AcceptorStateMachine.runTo (/app/node_modules/aws-sdk/lib/state_machine.js:14:12)
        at /app/node_modules/aws-sdk/lib/state_machine.js:26:10
        at Request.<anonymous> (/app/node_modules/aws-sdk/lib/request.js:38:9)
        at Request.<anonymous> (/app/node_modules/aws-sdk/lib/request.js:685:12)
        at Request.callListeners (/app/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
        at Request.emit (/app/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
        at Request.emit (/app/node_modules/aws-sdk/lib/request.js:683:14)
        at Request.transition (/app/node_modules/aws-sdk/lib/request.js:22:10)
        at AcceptorStateMachine.runTo (/app/node_modules/aws-sdk/lib/state_machine.js:14:12)
        at /app/node_modules/aws-sdk/lib/state_machine.js:26:10
        at Request.<anonymous> (/app/node_modules/aws-sdk/lib/request.js:38:9)
        at Request.<anonymous> (/app/node_modules/aws-sdk/lib/request.js:685:12)
        at Request.callListeners (/app/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
        at callNextListener (/app/node_modules/aws-sdk/lib/sequential_executor.js:96:12)
        at IncomingMessage.onEnd (/app/node_modules/aws-sdk/lib/event_listeners.js:299:13)
        at IncomingMessage.emit (events.js:323:22)
        at IncomingMessage.EventEmitter.emit (domain.js:482:12)
        at endReadableNT (_stream_readable.js:1204:12)
        at processTicksAndRejections (internal/process/task_queues.js:84:21)
    

    AWS S3 credentials are correct as we see templates on the S3 bucket.
    Does anyone know how to fix this exception?
    Thanks,
    Sergey



  • I have found in the logs the same exception but with a bit different message:

    2020-03-25T12:59:09.441Z - error: Error when processing OData POST: /odata/folders NoSuchKey: The specified key does not exist.
        at Request.extractError (/app/node_modules/aws-sdk/lib/services/s3.js:585:35)
        at Request.callListeners (/app/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
        at Request.emit (/app/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
        at Request.emit (/app/node_modules/aws-sdk/lib/request.js:683:14)
        at Request.transition (/app/node_modules/aws-sdk/lib/request.js:22:10)
        at AcceptorStateMachine.runTo (/app/node_modules/aws-sdk/lib/state_machine.js:14:12)
        at /app/node_modules/aws-sdk/lib/state_machine.js:26:10
        at Request.<anonymous> (/app/node_modules/aws-sdk/lib/request.js:38:9)
        at Request.<anonymous> (/app/node_modules/aws-sdk/lib/request.js:685:12)
        at Request.callListeners (/app/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
        at Request.emit (/app/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
        at Request.emit (/app/node_modules/aws-sdk/lib/request.js:683:14)
        at Request.transition (/app/node_modules/aws-sdk/lib/request.js:22:10)
        at AcceptorStateMachine.runTo (/app/node_modules/aws-sdk/lib/state_machine.js:14:12)
        at /app/node_modules/aws-sdk/lib/state_machine.js:26:10
        at Request.<anonymous> (/app/node_modules/aws-sdk/lib/request.js:38:9)
        at Request.<anonymous> (/app/node_modules/aws-sdk/lib/request.js:685:12)
        at Request.callListeners (/app/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
        at callNextListener (/app/node_modules/aws-sdk/lib/sequential_executor.js:96:12)
        at IncomingMessage.onEnd (/app/node_modules/aws-sdk/lib/event_listeners.js:299:13)
        at IncomingMessage.emit (events.js:323:22)
        at IncomingMessage.EventEmitter.emit (domain.js:482:12)
        at endReadableNT (_stream_readable.js:1204:12)
        at processTicksAndRejections (internal/process/task_queues.js:84:21)
    


  • I have the same issue, can anyone from jsreport team provide info what potential issue could initiate this log



  • Ups, I missed this. I take a look today.



  • Unfortunately, I'm not able to replicate this even I tried for quite some time doing as many operations that came to my mind with s3 fs store. I'll need some more information because the stack doesn't say anything. Mainly we need to isolate the problem.


    Is it happening during some specific operation and you are able to deterministically replicate the error?

    When is it happening in intervals out of nowhere, can you try to disable the scheduling? And check if the error occurs at the same interval as the compactionInterval is set to?

    Can it be related to your specific templates/folders structure? What if you start a new blank instance of jsreport with just a hello world template persisted in the s3 fs store? Does it also log the error? If it turns out it is happening just for your specific templates/folders structure, are you allowed to email us the templates export?


    Thank you with helping us to find the problem.



  • @jan_blaha Hi Jan! Thank you for the response. I will try to check and provide some data.
    But I also found another stacktrace in the log that might be related to this issue

    2020-04-16T13:07:01.275Z - error: unable to load planned schedules Error: Timeout during waiting for file system, try it again later.
        at Object.rejectItemsWithTimeout (/app/node_modules/jsreport-fs-store/lib/queue.js:53:23)
        at Timeout._onTimeout (/app/node_modules/jsreport-fs-store/lib/transaction.js:10:11)
        at listOnTimeout (internal/timers.js:549:17)
        at processTimers (internal/timers.js:492:7)
    

    Could you please give me a hint on how I can disable scheduling?
    Thank you!



  • Seems like I can disable scheduling through:

    {
      "extensions": {
        "scheduling": {
          "enabled": false
        }
      }
    }
    


  • BTW, there is a typo in the documentation on this https://jsreport.net/learn/fs-store page

    {  
      "extensions":     
        "fs-store": { "compactionInterval": 60000 }     
        "studio": { "flushLogsInterval": 60000 },
        "scheduling": { "intreval": 60000 }  
      }
    }
    

    intreval should be interval



  • BTW, there is a typo in the documentation on this https://jsreport.net/learn/fs-store page

    Thanks, I fixed it.

    2020-04-16T13:07:01.275Z - error: unable to load planned schedules Error: Timeout during waiting for file system, try it again later.

    This isn't a big problem, the file system, in your case s3, was too slow to respond so scheduling wasn't able to check planned schedules. It will just try the next time again.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.