[SERVER-6498] mongoimport throwing "read error, or input line too long (max length: 16777216)" Created: 17/Jul/12  Updated: 11/Jul/16  Resolved: 02/Aug/12

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: 2.1.2
Fix Version/s: 2.2.0-rc1

Type: Bug Priority: Major - P3
Reporter: Ben Becker Assignee: Ben Becker
Resolution: Done Votes: 1
Labels: mongoimport
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Operating System: ALL
Participants:

 Description   

The following fails with v2.1.3-pre- (git hash 5a63e3766e73a153c47af59acb5cc8941cadbbc9):

 
ben@linux-mobile:~/projects/data$ ../mongo/mongoimport -d training -c twitter twitter.json 
connected to: 127.0.0.1
Tue Jul 17 15:10:27 		20918566/92443914	22%
Tue Jul 17 15:10:27 			12100	4033/second
Tue Jul 17 15:10:30 		49601953/92443914	53%
Tue Jul 17 15:10:30 			28700	4783/second
Tue Jul 17 15:10:33 		79372765/92443914	85%
Tue Jul 17 15:10:33 			46000	5111/second
Tue Jul 17 15:10:34 exception:read error, or input line too long (max length: 16777216)
Tue Jul 17 15:10:34 
Tue Jul 17 15:10:34 imported 53641 objects
Tue Jul 17 15:10:34 ERROR: encountered 1 error
ben@linux-mobile:~/projects/data$ 
 



 Comments   
Comment by edgar 88 [ 15/Oct/12 ]

New ticket: https://jira.mongodb.org/browse/SERVER-7355

Comment by Ian Whalen (Inactive) [ 15/Oct/12 ]

edgar88 could you please open a new ticket with all of the relevant info and indicate in the description that you think it might be related back to this ticket?

Comment by edgar 88 [ 15/Oct/12 ]

I just did a mongoexport of my collection, deleted the original collection and tried to mongoimport, receiving the same error message. I am running 2.2.0.

Mon Oct 15 14:38:53 exception:read error, or input line too long (max length: 16777216)

Note that I receive this error message directly after starting mongoimport, and I used the option -jsonarray with mongoexport.

Comment by auto [ 02/Aug/12 ]

Author:

{u'date': u'2012-08-02T14:32:30-07:00', u'email': u'ben.becker@10gen.com', u'name': u'Ben Becker'}

Message: SERVER-6498 fix mongoimport error when last line is empty
Branch: master
https://github.com/mongodb/mongo/commit/9784f744b0eb46eea4421c7f21d52ab2f9fceab3

Comment by Ben Becker [ 25/Jul/12 ]

Not sure why this doesn't happen in v2.0, but the issue is due to checking the input stream's failbit without regards for the eof bit. If the last line of a file is blank (e.g. has no newline), failbit & eof will be set (as there is no delimiter in the last line).

Generated at Thu Feb 08 03:11:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.