error: Failed to load collection templates Error: Unable to read config.json, you are likely trying to use fs jsreport store provider on the data set

486 views
Skip to first unread message

Franklin Gauer

unread,
Mar 1, 2016, 4:17:45 PM3/1/16
to jsreport
Hi, this just started happening to me today running jsreport from Docker. I don't understand how to fix this because I think this is happening in the Docker container.

error: Failed to load collection templates Error: Unable to read config.json, you are likely trying to use fs jsreport store provider on the data set created with nedb provider. Please switch connection string name to nedb. 

Error: ENOTDIR, open '/home/jsreport/data/templates/.DS_Store/config.json'

    at /home/jsreport/node_modules/jsreport/node_modules/jsreport-fs-store/lib/persistence.js:257:17

    at /home/jsreport/node_modules/jsreport/node_modules/jsreport-fs-store/node_modules/fs-extra/node_modules/graceful-fs/graceful-fs.js:76:16

    at fs.js:207:20

    at Object.oncomplete (fs.js:107:15)


This just started happening... with no changes to my environment. Please help if you can.

Jan Blaha

unread,
Mar 1, 2016, 4:33:04 PM3/1/16
to jsreport
Hi, 

the error is saying basically everything. You have probably report templates created through older (nedb) jsreport data store provider and trying to read them with the newer (fs) one.
In other words your jsreport configuration has changed somehow. 

Can you give us more information? Which docker file / script are you using?
How do you start the container?



Franklin Gauer

unread,
Mar 2, 2016, 11:31:28 AM3/2/16
to jsreport
Just so it is logged here on this thread. Jan replied to me directly and helped me understand the issue. I really appreciated that support and personal attention. Thanks Jan!

davism...@gmail.com

unread,
Apr 29, 2016, 3:32:20 AM4/29/16
to jsreport
Hi, I had the same problem and it was due to the fact I give to some template a name with a '/' inside and in the filesystem it came as a subfolder...

Jan Blaha

unread,
Apr 29, 2016, 3:33:36 AM4/29/16
to jsreport
Ah thanks, we will add there validation.

das...@duosoftware.com

unread,
Jun 9, 2016, 9:04:06 AM6/9/16
to jsreport
This is the error what I am getting. Kindly help me on this.

2016-06-09T12:57:59.083Z - error: Failed to load collection images Error: Unable to read config.json, you are likely trying to use fs jsreport store provider on the data set created with nedb provider. Please switch connection string name to nedb.
Error: ENOTDIR, open '/home/dasitha/data/images/npm-debug.log/config.json'
    at /home/dasitha/node_modules/jsreport/node_modules/jsreport-fs-store/lib/persistence.js:258:17
    at /home/dasitha/node_modules/jsreport/node_modules/jsreport-fs-store/node_modules/fs-extra/node_modules/graceful-fs/graceful-fs.js:78:16
    at fs.js:208:20
    at Object.oncomplete (fs.js:108:15)
2016-06-09T12:57:59.084Z - error: Error occured during reporter init Error: Unable to read config.json, you are likely trying to use fs jsreport store provider on the data set created with nedb provider. Please switch connection string name to nedb.
Error: ENOTDIR, open '/home/dasitha/data/images/npm-debug.log/config.json'
    at /home/dasitha/node_modules/jsreport/node_modules/jsreport-fs-store/lib/persistence.js:258:17
    at /home/dasitha/node_modules/jsreport/node_modules/jsreport-fs-store/node_modules/fs-extra/node_modules/graceful-fs/graceful-fs.js:78:16
    at fs.js:208:20
    at Object.oncomplete (fs.js:108:15)
From previous event:
    at /home/dasitha/node_modules/jsreport/node_modules/jsreport-core/lib/reporter.js:78:8
From previous event:
    at Reporter.init (/home/dasitha/node_modules/jsreport/node_modules/jsreport-core/lib/reporter.js:57:30)
    at Reporter.reporter.init (/home/dasitha/node_modules/jsreport/lib/extendInit.js:8:21)
    at Object.<anonymous> (/home/dasitha/server.js:1:85)
^C
root@reportsvr-live:/home/dasitha# mkdir /home/dasitha/data/images/npm-debug.log/config.json
mkdir: cannot create directory ‘/home/dasitha/data/images/npm-debug.log/config.json’: Not a directory

Jan Blaha

unread,
Jun 9, 2016, 9:14:05 AM6/9/16
to jsreport
Looks that for some reasons you have npm-debug.log here /home/dasitha/data/images/npm-debug.log 
Please delete it and start again

das...@duosoftware.com

unread,
Jun 9, 2016, 11:18:46 AM6/9/16
to jsreport
Thanks for the feedback. I deleted the log. Now it shows the below error when I am starting the service. (sudo npm start --production)

2016-06-09T15:17:00.582Z - error: Failed to load collection images Error: Unable to read config.json, you are likely trying to use fs jsreport store provider on the data set created with nedb provider. Please switch connection string name to nedb.
Error: ENOENT: no such file or directory, open '/home/dasitha/data/images/rockland_logo_large/config.json'
    at ReadFileContext.<anonymous> (/home/dasitha/node_modules/jsreport/node_modules/jsreport-fs-store/lib/persistence.js:258:17)
    at ReadFileContext.callback (/home/dasitha/node_modules/jsreport/node_modules/jsreport-fs-store/node_modules/fs-extra/node_modules/graceful-fs/graceful-fs.js:78:16)
    at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:303:13)
2016-06-09T15:17:00.584Z - error: Error occured during reporter init Error: Unable to read config.json, you are likely trying to use fs jsreport store provider on the data set created with nedb provider. Please switch connection string name to nedb.
Error: ENOENT: no such file or directory, open '/home/dasitha/data/images/rockland_logo_large/config.json'
    at ReadFileContext.<anonymous> (/home/dasitha/node_modules/jsreport/node_modules/jsreport-fs-store/lib/persistence.js:258:17)
    at ReadFileContext.callback (/home/dasitha/node_modules/jsreport/node_modules/jsreport-fs-store/node_modules/fs-extra/node_modules/graceful-fs/graceful-fs.js:78:16)
    at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:303:13)

Jan Blaha

unread,
Jun 9, 2016, 11:24:06 AM6/9/16
to jsreport
This started to occur suddenly? Or after upgrading jsreport? Can you attach your zipped data folder? I would take a look what is wrong there

Franklin Gauer

unread,
Jun 9, 2016, 11:43:14 AM6/9/16
to jsreport
2016-06-09T15:17:00.582Z - error: Failed to load collection images Error: Unable to read config.json, you are likely trying to use fs jsreport store provider on the data set created with nedb provider. Please switch connection string name to nedb.
Error: ENOENT: no such file or directory, open '/home/dasitha/data/images/rockland_logo_large/config.json'
    at ReadFileContext.<anonymous> (/home/dasitha/node_modules/jsreport/node_modules/jsreport-fs-store/lib/p...etc.

I've had this problem before when deleting report templates and such. We have our files in a git repo and if we revert using Git, it leaves the parent folder in-tact. In other words if you delete the files within the folder, and not the parent folder itself, you will get this error. If the rockland_logo_large folder is empty, and you don't need it anymore, just delete that folder. If the rockland_logo_large has files in it, then it may be another issue...

das...@duosoftware.com

unread,
Jun 9, 2016, 1:19:38 PM6/9/16
to jsreport
ThanksJan for the support. This happened when I tried to upload the image suddenly jsreports when down. then I tried to up and ended up with this error. What I did was deleted the rockland_logo_larg folder. Now this is working. Is there any thing I did wrong ? 

das...@duosoftware.com

unread,
Jun 9, 2016, 1:20:25 PM6/9/16
to jsreport
Thanks Franklin Gauer . It works :)

bart.ve...@ugentec.com

unread,
Aug 30, 2016, 6:00:17 AM8/30/16
to jsreport
I'll throw in another issue with "Error occured during reporter init Error: Unable to parse config.json..."

What I'm trying to do is run JsReport using Docker, and install (copy) some static images using the following docker line:

COPY images/check-icon.png /jsreport/data/images/check-icon.png

Adding this line will give the error described. Looks like this error is incorrect - and in fact JsReport is simply not expecting for there already to be a directory at that location, right? How would I add static images through docker?

Thanks,

Bart

Op dinsdag 1 maart 2016 22:17:45 UTC+1 schreef Franklin Gauer:

Jan Blaha

unread,
Aug 30, 2016, 6:10:36 AM8/30/16
to jsreport, bart.ve...@ugentec.com
The file system structure for images used by images extension is not that simple. You can try to upload the file using jsreport studio and check it out on the disk. It is like this:

data / images / [image name without extension]
  config.json  (json configuration includes id, permissions ... )
  content.png  (actual image)

Also you may take a look at the static resources extension - https://github.com/jsreport/jsreport-static-resources
This should let you to simply copy the image file and reference it.

We'll provide better support for referencing static files in the next months. We are aware that the solution above is not perfect.
Reply all
Reply to author
Forward
0 new messages