TypeError: Converting circular structure to JSON


  • Gamers

    I've just upgraded from v1.10.2 to v1.11.2 (luckily not on my live site) and when I try to view any categories, I get this error.

    I thought I would ask about it here, before posting on the bug tracker.

    2019-02-06T14:40:08.983Z [4999/26981] - error: uncaughtException: Converting circular structure to JSON
    TypeError: Converting circular structure to JSON
        at JSON.stringify (<anonymous>)
        at stringify (/var/****/node_modules/express/lib/response.js:1119:12)
        at ServerResponse.json (/var/****/node_modules/express/lib/response.js:260:14)
        at async.waterfall.str (/var/****/src/middleware/render.js:74:18)
        at nextTask (/var/****/node_modules/async/dist/async.js:5324:14)
        at next (/var/****/node_modules/async/dist/async.js:5331:9)
        at /var/****/node_modules/async/dist/async.js:969:16
        at /var/****/node_modules/async/dist/async.js:473:16
        at next (/var/****/node_modules/async/dist/async.js:5329:29)
        at /var/****/node_modules/async/dist/async.js:969:16 {"error":{},"stack":"TypeError: Converting circular structure to JSON\n    at JSON.stringify (<anonymous>)\n    at stringify (/var/****/node_modules/express/lib/response.js:1119:12)\n    at ServerResponse.json (/var/****/node_modules/express/lib/response.js:260:14)\n    at async.waterfall.str (/var/****/src/middleware/render.js:74:18)\n    at nextTask (/var/****/node_modules/async/dist/async.js:5324:14)\n    at next (/var/****/node_modules/async/dist/async.js:5331:9)\n    at /var/****/node_modules/async/dist/async.js:969:16\n    at /var/****/node_modules/async/dist/async.js:473:16\n    at next (/var/****/node_modules/async/dist/async.js:5329:29)\n    at /var/****/node_modules/async/dist/async.js:969:16","exception":true,"date":"Wed Feb 06 2019 14:40:08 GMT+0000 (GMT)","process":{"pid":26981,"uid":1001,"gid":1001,"cwd":"/var/****","execPath":"/usr/bin/node","version":"v8.11.2","argv":["/usr/bin/node","/var/****/app.js"],"memoryUsage":{"rss":168038400,"heapTotal":132849664,"heapUsed":96406152,"external":36713046}},"os":{"loadavg":[1.1171875,0.72021484375,0.57958984375],"uptime":3294087},"trace":[{"column":null,"file":null,"function":"JSON.stringify","line":null,"method":"stringify","native":false},{"column":12,"file":"/var/****/node_modules/express/lib/response.js","function":"stringify","line":1119,"method":null,"native":false},{"column":14,"file":"/var/****/node_modules/express/lib/response.js","function":"ServerResponse.json","line":260,"method":"json","native":false},{"column":18,"file":"/var/****/src/middleware/render.js","function":"async.waterfall.str","line":74,"method":"str","native":false},{"column":14,"file":"/var/****/node_modules/async/dist/async.js","function":"nextTask","line":5324,"method":null,"native":false},{"column":9,"file":"/var/****/node_modules/async/dist/async.js","function":"next","line":5331,"method":null,"native":false},{"column":16,"file":"/var/****/node_modules/async/dist/async.js","function":null,"line":969,"method":null,"native":false},{"column":16,"file":"/var/****/node_modules/async/dist/async.js","function":null,"line":473,"method":null,"native":false},{"column":29,"file":"/var/****/node_modules/async/dist/async.js","function":"next","line":5329,"method":null,"native":false},{"column":16,"file":"/var/****/node_modules/async/dist/async.js","function":null,"line":969,"method":null,"native":false}]}
    

    I also get this error when trying to view any category 'admin functions' in the admin panel.

    2019-02-06T14:57:40.563Z [4999/27022] - error: uncaughtException: Maximum call stack size exceeded
    RangeError: Maximum call stack size exceeded
        at Function.isBuffer (buffer.js:398:36)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:44:66)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:58:59)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:37:11)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:58:59)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:58:59)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:37:11)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:58:59)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:58:59)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:37:11) {"error":{},"stack":"RangeError: Maximum call stack size exceeded\n    at Function.isBuffer (buffer.js:398:36)\n    at hasBinary (/var/****/node_modules/has-binary2/index.js:44:66)\n    at hasBinary (/var/****/node_modules/has-binary2/index.js:58:59)\n    at hasBinary (/var/****/node_modules/has-binary2/index.js:37:11)\n    at hasBinary (/var/****/node_modules/has-binary2/index.js:58:59)\n    at hasBinary (/var/****/node_modules/has-binary2/index.js:58:59)\n    at hasBinary (/var/****/node_modules/has-binary2/index.js:37:11)\n    at hasBinary (/var/****/node_modules/has-binary2/index.js:58:59)\n    at hasBinary (/var/****/node_modules/has-binary2/index.js:58:59)\n    at hasBinary (/var/****/node_modules/has-binary2/index.js:37:11)","exception":true,"date":"Wed Feb 06 2019 14:57:40 GMT+0000 (GMT)","process":{"pid":27022,"uid":1001,"gid":1001,"cwd":"/var/****","execPath":"/usr/bin/node","version":"v8.11.2","argv":["/usr/bin/node","/var/****/app.js"],"memoryUsage":{"rss":144797696,"heapTotal":113262592,"heapUsed":90477720,"external":36807213}},"os":{"loadavg":[0.447265625,0.3173828125,0.37060546875],"uptime":3295139},"trace":[{"column":36,"file":"buffer.js","function":"Function.isBuffer","line":398,"method":"isBuffer","native":false},{"column":66,"file":"/var/****/node_modules/has-binary2/index.js","function":"hasBinary","line":44,"method":null,"native":false},{"column":59,"file":"/var/****/node_modules/has-binary2/index.js","function":"hasBinary","line":58,"method":null,"native":false},{"column":11,"file":"/var/****/node_modules/has-binary2/index.js","function":"hasBinary","line":37,"method":null,"native":false},{"column":59,"file":"/var/****/node_modules/has-binary2/index.js","function":"hasBinary","line":58,"method":null,"native":false},{"column":59,"file":"/var/****/node_modules/has-binary2/index.js","function":"hasBinary","line":58,"method":null,"native":false},{"column":11,"file":"/var/****/node_modules/has-binary2/index.js","function":"hasBinary","line":37,"method":null,"native":false},{"column":59,"file":"/var/****/node_modules/has-binary2/index.js","function":"hasBinary","line":58,"method":null,"native":false},{"column":59,"file":"/var/****/node_modules/has-binary2/index.js","function":"hasBinary","line":58,"method":null,"native":false},{"column":11,"file":"/var/****/node_modules/has-binary2/index.js","function":"hasBinary","line":37,"method":null,"native":false}]}
    2019-02-06T14:57:40.563Z [4999/27022] - error: Maximum call stack size exceeded
    RangeError: Maximum call stack size exceeded
        at Function.isBuffer (buffer.js:398:36)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:44:66)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:58:59)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:37:11)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:58:59)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:58:59)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:37:11)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:58:59)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:58:59)
        at hasBinary (/var/****/node_modules/has-binary2/index.js:37:11)
    

    P.S. I've removed my folder name and replaced it with ****, in case you were wondering.


  • Staff Admin

    It sounds like you have a circular category relationship.

    It happens when category A has a child category B which then has category A as a child again.

    You will have to check your database to see if that is the case. Which database are you using?


  • Gamers

    @baris I'm using MongoDB.


Log in to reply
 

Suggested Topics

| |