question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GTFS data importing error TypeError: Cannot convert undefined or null to object

See original GitHub issue

Hi there,

I’m having trouble when importing GTFS using gtfs-import. I have an error TypeError: Cannot convert undefined or null to object\transit\TransitData\gtfs-downloads/gtfs_swiss-gtfs.zip. Below is my files:

config.json:

{
  "mongoUrl": "mongodb://localhost:27017/gtfs_swiss",
  "agencies": [
    {
      "agency_key": "gtfs_swiss",
      "url": "http://transitfeeds.com/p/sbb-cff-ffs/793/latest/download",
      "exclude": [
        "fare_attributes",
        "fare_rules",
        "feed_info",
        "frequencies",
        "shapes"
      ]
    }
  ]
}

gtfs-import output:

C:\Users\Dany\Desktop\transit\TransitData>gtfs-import

Starting GTFS import for 1 file
gtfs_swiss: Downloading GTFS from http://transitfeeds.com/p/sbb-cff-ffs/793/latest/download
gtfs_swiss: Download successful
TypeError: Cannot convert undefined or null to object\transit\TransitData\gtfs-downloads/gtfs_swiss-gtfs.zip
    at Function.assign (<anonymous>)
    at executeOperation (C:\Users\Dany\AppData\Roaming\npm\node_modules\gtfs\node_modules\mongodb\lib\utils.js:386:14)
    at Collection.remove (C:\Users\Dany\AppData\Roaming\npm\node_modules\gtfs\node_modules\mongodb\lib\collection.js:1239:10)
    at NativeCollection.(anonymous function) [as remove] (C:\Users\Dany\AppData\Roaming\npm\node_modules\gtfs\node_modules\mongoose\lib\drivers\node-mongodb-native\collection.js:139:28)
    at Promise.all.models.map.model (C:\Users\Dany\AppData\Roaming\npm\node_modules\gtfs\lib\import.js:54:35)
    at Array.map (<anonymous>)
    at removeData (C:\Users\Dany\AppData\Roaming\npm\node_modules\gtfs\lib\import.js:53:29)
    at Object.module.exports [as import] (C:\Users\Dany\AppData\Roaming\npm\node_modules\gtfs\lib\import.js:324:13)
    at <anonymous>

The mongodb connection seems to be ok as gtfs-import successfully created collections in my mongodb database. See image attached

2018-02-08 20_13_23-mongodb compass community - localhost_27017

But it seems that the error occurs when gtfs-import tries to move the data. Any help would greatly be appreciate.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
brendanneecommented, Mar 6, 2018

Checkout node-gtfs version 1.5.3 - it has an update to mongoose which has an update to the mongodb library which I think will fix your issue on windows. Please report back - thanks!

1reaction
brendanneecommented, Mar 2, 2018

I think this issue will be resolved in the next release of mongoose that will use mongodb 3.0.3 - I’ll keep and eye on this and update node-gtfs as soon as it is released. Specifically, this commit: https://github.com/mongodb/node-mongodb-native/commit/934a43a90141fbacebd4bcdd9151a4f6a8a8bc57

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot convert undefined or null to object - Stack Overflow
This error is caused when you call a function that expects an Object as its argument, but pass undefined or null instead, like...
Read more >
TypeError: Cannot convert undefined or null to object · Issue #66
Getting error when trying to import data to another space (duplicate space for testing ui extensions) Stack ERR! import TypeError: Cannot ...
Read more >
Cannot convert undefined or null to object - Help - Postman
I get the error message “Error while importing WSDL: Cannot convert undefined or null to object” importing a WSDL file (that I use...
Read more >
Getting an error "Cannot convert undefined or null to object"
Hello I am getting an error on my component. Can someone help to solve this? ... use created hook. ... The variable slider...
Read more >
FreeTextAnnotation crate by code when export to xfdf then ...
FreeTextAnnotation crate by code when export to xfdf then reimport with getFileData got errorTypeError: Cannot convert undefined or null to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found