redislabs-training / node-js-crash-course

The Sample Application for the Node.js Redis Crash Course.
https://developer.redis.com/develop/node/node-crash-course/
MIT License
35 stars 17 forks source link

"npm run load all" step files with "Unexpected error creating indexes :(" #1

Closed hectoroso closed 3 years ago

hectoroso commented 3 years ago

Hi, I'm running using: MacOS: Big Sur 11.5.1 Node: v12.18.4 (also tried with v10 and v14) Docker Desktop: 3.5.2.18

I cloned the repo (commit 30360f2), ran npm install and got the docker container running. Trying to load the data fails. Any ideas or pointers as to where I can find more info?

$ docker ps
CONTAINER ID   IMAGE                COMMAND                  CREATED              STATUS              PORTS                                       NAMES
6a61598b7047   redislabs/redismod   "redis-server --load…"   About a minute ago   Up About a minute   0.0.0.0:6379->6379/tcp, :::6379->6379/tcp   rediscrashcourse

$ npm run load all

> js-crash-course@0.0.1 load /Users/hector/Dev/redis/redislabs/node-js-crash-course
> node src/utils/dataloader.js -- "all"

Loading user data...
User data loaded with 0 errors.
Loading location data...
Location data loaded with 0 errors.
Loading location details...
Location detail data loaded with 215 errors.
Loading checkin stream entries...
Loaded 5000 checkin stream entries.
Creating consumer group...
Consumer group created.
Dropping any existing indexes, creating new indexes...
Unexpected error creating indexes :(
[
  [
    ReplyError: ERR unknown command `FT.DROPINDEX`, with args beginning with: `ncc:usersidx`, 
        at parseError (/Users/hector/Dev/redis/redislabs/node-js-crash-course/node_modules/redis-parser/lib/parser.js:179:12)
        at parseType (/Users/hector/Dev/redis/redislabs/node-js-crash-course/node_modules/redis-parser/lib/parser.js:302:14) {
      command: [Object]
    }
  ],
  [
    ReplyError: ERR unknown command `FT.DROPINDEX`, with args beginning with: `ncc:locationsidx`, 
        at parseError (/Users/hector/Dev/redis/redislabs/node-js-crash-course/node_modules/redis-parser/lib/parser.js:179:12)
        at parseType (/Users/hector/Dev/redis/redislabs/node-js-crash-course/node_modules/redis-parser/lib/parser.js:302:14) {
      command: [Object]
    }
  ],
  [
    ReplyError: ERR unknown command `FT.CREATE`, with args beginning with: `ncc:usersidx`, `ON`, `HASH`, `PREFIX`, `1`, `ncc:users`, `SCHEMA`, `email`, `TAG`, `numCheckins`, `NUMERIC`, `SORTABLE`, `lastSe`, 
        at parseError (/Users/hector/Dev/redis/redislabs/node-js-crash-course/node_modules/redis-parser/lib/parser.js:179:12)
        at parseType (/Users/hector/Dev/redis/redislabs/node-js-crash-course/node_modules/redis-parser/lib/parser.js:302:14) {
      command: [Object]
    }
  ],
  [
    ReplyError: ERR unknown command `FT.CREATE`, with args beginning with: `ncc:locationsidx`, `ON`, `HASH`, `PREFIX`, `1`, `ncc:locations`, `SCHEMA`, `category`, `TAG`, `SORTABLE`, `location`, `GEO`, `SO`, 
        at parseError (/Users/hector/Dev/redis/redislabs/node-js-crash-course/node_modules/redis-parser/lib/parser.js:179:12)
        at parseType (/Users/hector/Dev/redis/redislabs/node-js-crash-course/node_modules/redis-parser/lib/parser.js:302:14) {
      command: [Object]
    }
  ]
]
Deleting any previous bloom filter, creating new bloom filter...
Unexpected error creating bloom filter :(
[
  [ null, 0 ],
  [
    ReplyError: ERR unknown command `BF.RESERVE`, with args beginning with: `ncc:checkinfilter`, `0.0001`, `1000000`, 
        at parseError (/Users/hector/Dev/redis/redislabs/node-js-crash-course/node_modules/redis-parser/lib/parser.js:179:12)
        at parseType (/Users/hector/Dev/redis/redislabs/node-js-crash-course/node_modules/redis-parser/lib/parser.js:302:14) {
      command: [Object]
    }
  ]
]
simonprickett commented 3 years ago

It looks like you are running an instance of Redis that doesn't have the required RediSearch and RedisBloom modules installed. This codebase also uses RedisJSON - take a look at the supplied Docker Compose file for an example container that includes these. Are you using a different Docker image for Redis than the one supplied in the repo?