ECS Fargate task unable to acquire fs store filesystem lock



  • I'm trying to run jsreport 4.3.1 on an ECS cluster running Fargate. I'm currently getting the following error in the task logs:

    2024-04-25T14:16:51.143-04:00	2024-04-25T18:16:51.143Z - info: fs store is persisting using fs for /app/data
    	2024-04-25T14:16:51.465-04:00	2024-04-25T18:16:51.465Z - error: Error occurred during reporter init: Error: Failed to acquire fs store file system lock.
    	2024-04-25T14:16:51.465-04:00	at Object.lock (/app/node_modules/@jsreport/jsreport-fs-store/lib/fileSystem.js:126:13)
    	2024-04-25T14:16:51.465-04:00	at async lock (/app/node_modules/@jsreport/jsreport-fs-store/lib/customUtils.js:151:13)
    	2024-04-25T14:16:51.465-04:00	at async Object.load (/app/node_modules/@jsreport/jsreport-fs-store/lib/provider.js:121:7)
    	2024-04-25T14:16:51.465-04:00	at async Object.init (/app/node_modules/@jsreport/jsreport-core/lib/main/store/documentStore.js:162:9)
    	2024-04-25T14:16:51.465-04:00	at async MainReporter.init (/app/node_modules/@jsreport/jsreport-core/lib/main/reporter.js:228:7)
    	2024-04-25T14:16:51.467-04:00	Error: Failed to acquire fs store file system lock.
    	2024-04-25T14:16:51.467-04:00	at Object.lock (/app/node_modules/@jsreport/jsreport-fs-store/lib/fileSystem.js:126:13)
    	2024-04-25T14:16:51.467-04:00	at async lock (/app/node_modules/@jsreport/jsreport-fs-store/lib/customUtils.js:151:13)
    	2024-04-25T14:16:51.467-04:00	at async Object.load (/app/node_modules/@jsreport/jsreport-fs-store/lib/provider.js:121:7)
    	2024-04-25T14:16:51.467-04:00	at async Object.init (/app/node_modules/@jsreport/jsreport-core/lib/main/store/documentStore.js:162:9)
    	2024-04-25T14:16:51.467-04:00	at async MainReporter.init (/app/node_modules/@jsreport/jsreport-core/lib/main/reporter.js:228:7)
    

    jsconfig:

    {
      "logger": {
        "console": { "transport": "console", "level": "debug" }
      },
      "httpPort": 5488,
      "allowLocalFilesAccess": true,
      "store": {
        "provider": "fs"
      },
      "blobStorage": {
        "provider": "fs"
      },
      "templatingEngines": {
        "timeout": 300000
      },
      "chrome": {
        "timeout": 300000
      },
        "sample-template": {
          "createSamples": false
        },
        "scripts": {
          "timeout": 300000
        },
        "scheduling": {
          "misfireThreshold": 300000
        },
        "reports": {
          "cleanInterval": "1d",
          "cleanThreshold": "1w"
        }
      }
    
    

    Current Dockerfile

    FROM jsreport/jsreport:4.3.1
    
    WORKDIR /app
    
    COPY --chown=jsreport:jsreport data/ /app/data
    
    COPY --chown=jsreport:jsreport jsreport.config.json /app
    
    VOLUME [ "/app/data" ]
    
    

    Relevant ECS task definition configuration:

    ...
                "mountPoints": [
                    {
                        "sourceVolume": "data",
                        "containerPath": "/app/data",
                        "readOnly": false
                    }
                ],
    ...
        "volumes": [
            {
                "name": "data",
                "host": {}
            }
        ],
    ...
    


  • I'm running 4.3.1 at Fargate without any problem.

    We have some differences in config and Dockerfile, here are some:

    • I'm also copying my license file. This is probably not the problem, but I think you'd want to do this.
      COPY --chown=jsreport:jsreport license-key.txt /app

    • I don't have the `VOLUME ["/app/data"] in my Dockerfile

    • I'm not setting WORKDIR in my Dockerfile. But I do RUN cd /app which is almost the same

    • I have the following under Extensions in my config file:

        "fs-store": {
          "sync": {
            "usePolling": false
          }
        }
    

    If I recall correctly this was to mitigate some sync problem on MacOS with Docker, i.e. I don't think this is the problem either, but I added it here since it is FS-related.


Log in to reply
 

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