tylercollier / openresync

Open Real Estate Sync (openresync) is a node application that syncs (replicates) MLS data from one or more sources via the RESO Web API to MySQL or Solr, with an admin UI.
https://openresync.com
MIT License
35 stars 13 forks source link

Error: User config version (undefined) does not match software version (0.2.0) #9

Closed algsupport closed 2 years ago

algsupport commented 2 years ago

Happy new year.

Great project you have there. I tried running it but I am getting the following error:

Error: User config version (undefined) does not match software version (0.2.0)

I used the default example config without any modifications just to get it up and running. Didn't notice any errors during the build process.

The full error that I get when I try to run it wit the following command:

NODE_ENV=production TZ=UTC node server/index.js is:

/root/openresync/lib/config.js:24
      throw new Error(`User config version (${builtUserConfig.version}) does not match software version (${userConfigVersion})`)
      ^

Error: User config version (undefined) does not match software version (0.2.0)
    at buildUserConfig (/root/openresync/lib/config.js:24:13)
    at Object.<anonymous> (/root/openresync/server/index.js:31:20)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47

I am not primarily a node developer but let me know if I can help somehow. I am very interested in this project's development.

Regards

tylercollier commented 2 years ago

Thanks for your interest in the proejct. I received your separate email and will connect with you there.

Thanks for reporting! You found a bug. I just pushed a commit. To update your config, change your config/config.js line from

version: '0.2.0',

to

userConfigVersion: '0.2.0',
tylercollier commented 2 years ago

Oh, and I should say, you won't be able to use the default config, as is. It has a couple example connections to the REFERENCE SERVER for the Austin Board of Realtors (ABOR) MLS, one via Trestle and one via Bridge. It's not live data. Any MLS you want to connect (even the reference server) to will require approval ahead of time, you'll need to reach out to each MLS to get credentials.

The example config also uses an example connection to MySQL and Solr. You can choose which of these you want to use. But you'll need to put the credentials for connecting to your destinations in the config.

I realize the example config might look a little overwhelming. One suggestion would be to take out all the comments in the actual config.js file you end up using, and just reference the comments in the config.example.js file. That way it won't look so overwhelming.

algsupport commented 2 years ago

Thank you for the quick response. I will try the fix and let you know if I get more issues. I didn't expect the default config to actually work. I just wanted to have it "running" and start familiarizing myself with it. I was going to got through the steps in documentation and what I need to do/learn and my plan is to make a docker container out of it to have a frictionless test setup so that my developers then can use it to implement a GUI for the MySQL database.

Will wait for your response in the mail I sent you. Have a good day.

algsupport commented 2 years ago

This has been solved. I added my MLS details and I was able to run it. Now my question is: Is there a way to trigger the processes manually or if I want to run them now, I should set the cron to run soon?

Regards

tylercollier commented 2 years ago

Take a look at lib/sync/go2.js. I know, it's a terrible name/place for it. Better might be something in a bin folder. Anywho, it's a one-off script that I think is what you're looking for.

The most important lines are probably:

  1. 55: const sourceName = 'recolorado_res' Put in the name of the source you want to work with, from your config
  2. 77 if (!true) { Due to the !, it won't sync metadata. You might want to toggle that on. You might always want to run that if block, it just takes longer.
  3. 93-97

    // await doPurge(trestleStuff)
    
    // await doSync(trestleStuff)
    // await doReconcile(trestleStuff)
    // await doPurge(trestleStuff)

    Choose what you actually want to run (sync, reconcile, purge, or any combo) by commenting out what you don't.

From the roadmap in the README, my idea is to allow this manually from the web UI with the click of a button. Just haven't gotten to it. Also from the roadmap is moving this functionality to a library so it'd be easy to call yourself... but not too bad if you don't need it very often.

tylercollier commented 2 years ago

I've patched the bug found by the OP