illinois / queue

A microservice queue for holding open office hours
University of Illinois/NCSA Open Source License
82 stars 36 forks source link

Running from a fresh clone fails #323

Closed nwalters512 closed 1 year ago

nwalters512 commented 4 years ago

Description

When running from a freshly-cloned copy of master, it crashes on startup:

➜  queue git:(master) npm run dev

> queue@2.0.0 dev /Users/nathan/git/queue
> ts-node --type-check --compiler-options '{"module":"commonjs"}' src/server.ts

/Users/nathan/git/queue/node_modules/sequelize/lib/sequelize.js:182
      throw new Error('Dialect needs to be explicitly supplied as of v4.0.0');
            ^
Error: Dialect needs to be explicitly supplied as of v4.0.0
    at new Sequelize (/Users/nathan/git/queue/node_modules/sequelize/lib/sequelize.js:182:13)
    at Object.<anonymous> (/Users/nathan/git/queue/src/models/index.js:62:15)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Module.m._compile (/Users/nathan/git/queue/node_modules/ts-node/src/index.ts:439:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/nathan/git/queue/node_modules/ts-node/src/index.ts:442:12)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/Users/nathan/git/queue/src/auth/util.js:4:20)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Module.m._compile (/Users/nathan/git/queue/node_modules/ts-node/src/index.ts:439:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/nathan/git/queue/node_modules/ts-node/src/index.ts:442:12)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/Users/nathan/git/queue/src/auth/dev.ts:2:1)

My guess is that this is related to the removal of src/config in https://github.com/illinois/queue/pull/288. If additional steps are necessary to configure the repo after cloning, those should be documented.

Steps to reproduce

  1. Clone the repository.
  2. Run npm ci.
  3. Run npm run dev.
  4. Observe the above error.
kedarabhyankar commented 4 years ago

Is there any known fix for this issue at this point in time? I've tried everything from downgrading node with nvm and running with node 8, to manually installing all dependencies (yes, this did take an extensive amount of time, 10/10 would not recommend), with no luck yet. Any fix for this yet?

astrosticks commented 4 years ago

Same problem here.

kedarabhyankar commented 4 years ago

I hate to say it but I feel like this project is abandoned. It hasn’t had any updates all summer, and you would think that in the midst of a global pandemic where all schools are practically moving to online instructions, there would have been some commit history or some update. But I think this one is unfortunately dead. It was great while it was being maintained though.

james9909 commented 4 years ago

This issue is happening because of a change with the database configuration. We currently use environment variables for all configuration, which is documented in the README. I now realize the README doesn't make this change completely obvious, so I restructured it here: https://github.com/illinois/queue/tree/update-env-documentation. Please let me know if this change makes things clearer!

echuber2 commented 3 years ago

Is #324 related?

nwalters512 commented 3 years ago

I'm taking a look at getting things functioning again this weekend. It's generally poor practice to require devs to set up specific config after cloning a project, i.e. add a .env file with specific values. npm ci && npm run dev should be all you have to do.

With that in mind, I'm going to refactor the config to look for .env.{NODE_ENV} files so that we can safely commit a .env.development file with standard sqlite config.