Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

importing csv to sqlite(firefox add-on) +TypeError: gFile.contents is null

Tags:

sqlite

csv

I'm trying to import a .csv file into sqlite database (firefox add-on).

It has approximately 26,000 rows with 4 columns. Each time it gives this error:

CSV Worker error! TypeError: gFile.contents is null File name: chrome://sqlitemanager/content/workerCsv.js Line number: 52

I already tried by splitting the csv file as well.

enter image description here

like image 721
user232803 Avatar asked Jan 18 '15 19:01

user232803


2 Answers

The new Firefox 35 version corrected the bug 716491, which lead to this problem with the sqlite-manager addon. There seem to be two places in the addon, where some response code is tested. A solution is to replace these two lines. The addon path chrome://sqlitemanager/content/workerCsv.js is refering to one of this files. As a user of the addon, you can fix that in your version of the plugin as follows:

  1. Go to your Firefox profile folder and the subfolder extensions
  2. Rename the file [email protected] into [email protected]
  3. Extract the content of this zip file into a subfolder [email protected] within the extension folder and delete the zip file
  4. Open the file ./[email protected]/chrome/content/workerCsv.js with a reasonable text editor
  5. Replace if(req.status == 0) { with if(req.status == 0 || req.status == 200) { on line 20
  6. Save it
  7. Do the same with testCsv.js on line 15
  8. Restart Firefox

This worked for me. I guess there are different ways to create the addon manually again. However, I hope this will be fixed in the official version.

like image 59
zuphilip Avatar answered Oct 10 '22 22:10

zuphilip


Downgrading to Firefox 34 fixed the issue for me.

like image 40
opit Avatar answered Oct 10 '22 21:10

opit