Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6054751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:11:17+00:00 2026-05-23T08:11:17+00:00

I get an Assertion: 10340:Failure parsing JSON string error, running mongoimport in pipe over

  • 0

I get an Assertion: 10340:Failure parsing JSON string error, running mongoimport in pipe over Github API, like the following:

lsoave@ubuntu:~/rails/github/gitwatcher$ curl https://api.github.com/users/lgs/repos | mongoimport -h localhost -d gitwatch_dev -c repo -f repositories
connected to: localhost
 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                Dload  Upload   Total   Spent    Left  Speed
 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Mon Jun 20 00:56:01 Assertion: 10340:Failure parsing JSON string near: [
100 22303  100 22303    0     0  31104      0 --:--:-- --:--:-- --:--:--  111k
0x816d8a1 0x8118814 0x84b357a 0x84b5bb8 0x84adc65 0x84b2ee1 0x60bbd6 0x80f5bc1
mongoimport(_ZN5mongo11msgassertedEiPKc+0x221) [0x816d8a1]
mongoimport(_ZN5mongo8fromjsonEPKcPi+0x3b4) [0x8118814]
mongoimport(_ZN6Import9parseLineEPc+0x7a) [0x84b357a]
mongoimport(_ZN6Import3runEv+0x1a98) [0x84b5bb8]
mongoimport(_ZN5mongo4Tool4mainEiPPc+0x1ce5) [0x84adc65]
mongoimport(main+0x51) [0x84b2ee1]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0x60bbd6]
mongoimport(__gxx_personality_v0+0x3f1) [0x80f5bc1]
exception:Failure parsing JSON string near: [
[
...
...
Mon Jun 20 00:45:20 Assertion: 10340:Failure parsing JSON string near: "name": "t
0x816d8a1 0x8118814 0x84b357a 0x84b5bb8 0x84adc65 0x84b2ee1 0x126bd6 0x80f5bc1
mongoimport(_ZN5mongo11msgassertedEiPKc+0x221) [0x816d8a1]
mongoimport(_ZN5mongo8fromjsonEPKcPi+0x3b4) [0x8118814]
mongoimport(_ZN6Import9parseLineEPc+0x7a) [0x84b357a]
mongoimport(_ZN6Import3runEv+0x1a98) [0x84b5bb8]
mongoimport(_ZN5mongo4Tool4mainEiPPc+0x1ce5) [0x84adc65]
mongoimport(main+0x51) [0x84b2ee1]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0x126bd6]
mongoimport(__gxx_personality_v0+0x3f1) [0x80f5bc1]
exception:Failure parsing JSON string near: "name": "t
"name": "tentacles"
...
...

see the full trace here: http://pastie.org/2093486. Anyway, the json format I get back from the Github API seems ok ( curl https://api.github.com/users/lgs/repos ):

[
 {
    "open_issues": 0,
    "watchers": 3,
    "homepage": "http://scrubyt.org",
    "language": null,
    "forks": 1,
    "pushed_at": "2009-02-25T22:49:08Z",
    "created_at": "2009-02-25T22:22:40Z",
    "fork": true,
    "url": "https://api.github.com/repos/lgs/scrubyt",
    "private": false,
    "size": 188,
    "description": "A simple to learn and use, yet powerful web scraping toolkit!",
    "owner": {
     "avatar_url": "https://secure.gravatar.com/avatar/9c7d80ebc20ab8994e51b9f7518909ae?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2
Fgravatar-140.png",
     "login": "lgs",
     "url": "https://api.github.com/users/lgs",
     "id": 1573
    },
    "name": "scrubyt",
    "html_url": "https://github.com/lgs/scrubyt"
 },
...
...
]

here it is a snippet: http://www.pastie.org/2093524.

If I try specifying csv format it works:

lsoave@ubuntu:~/rails/github/gitwatcher$ curl https://api.github.com/users/lgs/repos | mongoimport -h localhost -d gitwatch_dev -c repo -f repositories --type csv
connected to: localhost
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 22303  100 22303    0     0  23914      0 --:--:-- --:--:-- --:--:--  106k
imported 640 objects
lsoave@ubuntu:~/rails/github/gitwatcher$ 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:11:18+00:00Added an answer on May 23, 2026 at 8:11 am

    Alright here is what could be going on. First off, I removed all the newlines in the JSON to reduce the number of errors from n (where n = number of lines) to 1. Then it turns out, I had to wrap the JSON Array in another variable and it worked thereafter. I think mongoimport is designed to work with mongoexport, so most likely you cannot use it to import any arbitrary JSON. However, if you want to, what I did woud be something you’d have to do in code before calling the import utility.

    I used only 1 record while I was testing. Here is the record with no newlines.

    [{"url":"https://api.github.com/repos/lgs/scrubyt", "pushed_at": "2009-02-25T22:49:08Z","homepage": "http://scrubyt.org",  "forks": 1,"language": null,"fork": true,"html_url": "https://github.com/lgs/scrubyt","created_at": "2009-02-25T22:22:40Z", "open_issues": 0,"private": false,"size": 188,"watchers": 3,"owner": {"url": "https://api.github.com/users/lgs","login": "lgs","id": 1573,"avatar_url": "https://secure.gravatar.com/avatar/9c7d80ebc20ab8994e51b9f7518909ae?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"name": "scrubyt","description": "A simple to learn and use, yet powerful web scraping toolkit!"}]
    

    Then I wrapped it with somedata (you can use any name here):

    {somedata:[{"url":"https://api.github.com/repos/lgs/scrubyt", "pushed_at": "2009-02-25T22:49:08Z","homepage": "http://scrubyt.org",  "forks": 1,"language": null,"fork": true,"html_url": "https://github.com/lgs/scrubyt","created_at": "2009-02-25T22:22:40Z", "open_issues": 0,"private": false,"size": 188,"watchers": 3,"owner": {"url": "https://api.github.com/users/lgs","login": "lgs","id": 1573,"avatar_url": "https://secure.gravatar.com/avatar/9c7d80ebc20ab8994e51b9f7518909ae?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"name": "scrubyt","description": "A simple to learn and use, yet powerful web scraping toolkit!"}]}
    

    And I was able to see the record in Mongo.

    > db.repo.findOne()
    {
        "_id" : ObjectId("4dff91d29c73f72483e82ef2"),
        "somedata" : [
            {
                "url" : "https://api.github.com/repos/lgs/scrubyt",
                "pushed_at" : "2009-02-25T22:49:08Z",
                "homepage" : "http://scrubyt.org",
                "forks" : 1,
                "language" : null,
                "fork" : true,
                "html_url" : "https://github.com/lgs/scrubyt",
                "created_at" : "2009-02-25T22:22:40Z",
                "open_issues" : 0,
                "private" : false,
                "size" : 188,
                "watchers" : 3,
                "owner" : {
                    "url" : "https://api.github.com/users/lgs",
                    "login" : "lgs",
                    "id" : 1573,
                    "avatar_url" : "https://secure.gravatar.com/avatar/9c7d80ebc20ab8994e51b9f7518909ae?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"
                },
                "name" : "scrubyt",
                "description" : "A simple to learn and use, yet powerful web scraping toolkit!"
            }
        ]
    }
    

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the following error when running my Visual Studio 2008 ASP.NET project (start
When i try to delete the cell i get crash ... Assertion failure in
running my program with gdb I get this: fem.o: malloc.c:3096: sYSMALLOc: Assertion `(old_top ==
My code is as below. I get the error as Assertion failed: (s->stack->next !=
From a Table, I get list of String's and would like to check that
We get the following error; The request was aborted: Could not create SSL/TLS secure
I get an Access is Denied error message when I use the strong name
I get the following error when building my Windows Forms solution: LC.exe exited with
I get this error: Can't locate Foo.pm in @INC Is there an easier way
I get the following error when trying to run the latest Cygwin version of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.