Skip to content

Gotchas & Common Failure Modes

Brian Freeman edited this page May 11, 2021 · 10 revisions

What is this

This page lists behavioral quirks of running one's own dev server, their causes, and common fixes.

Table of Contents

What the heck

Server Issues

Whenever I try to load the workbench, I get a CORS error saying http://localhost:8081/v1/config is blocked.

Your server probably isn't running. The server logs can be misleading. If you scroll up a bit, you will probably see some sort of error that has been pushed off the top of the screen by the rest of the logs. Fix that, kill your server, and restart it.

I'm getting a org.springframework.beans.factory.NoSuchBeanDefinitionException on server startup. That bean doesn't exist in my branch so my server shouldn't be looking for it.

One of the following things should work, in increasing level of disruptiveness:

  • delete your api/build dir (clears cached compiled java that hasn't been cleaned up yet)
  • ./gradlew clean (clears the gradle cache)
  • docker-sync stop; docker-sync clean; docker-sync start (clears the docker-sync cache)
  • ./project.rb docker-clean (nukes everything local and starts over; you'll need to rerun db migrations and recreate institutions after this)

I'm getting an error when logging in because it can't find my institution.

This shouldn't happen anymore, after we completed RW-4799. Try rebasing your branch to the latest version.

I'm getting duplicate class errors when running ./project.rb dev-up

Please run the following:

  • rm -rf api/build
  • docker-sync stop
  • docker-sync clean
  • docker-sync start

Test Issues

The JS files in failing Angular tests are concatenated and minified. How do I figure out where to put breakpoints?

Try setting --source-map=true in package.json.

Former remediation instructions:

You probably did a docker-clean recently and forgot to repopulate the database. Do the following:

aschwart@failboat:~/Documents/dev/workbench/api$ ./project.rb connect-to-db
mysql> use workbench;
# Or Verily, or Vanderbilt. but the 0 should stay the same.
mysql> insert into institution (short_name, display_name, dua_type_enum) values ("Broad", "Broad Institute of MIT and Harvard", 0);
# This likely only happens after a docker-clean so the institution_id of the institution you just created is probably 1, 
# but if you've done something weird then double check.
# The email domain you should add should be 
mysql> insert into institution_email_domain (institution_id, email_domain) values (1, "broadinstitute.org");

Make sure that the email domain matches the email domain of your real contact email. Then try logging out and logging in again.

Implementing a new API endpoint but receiving CORS error

  • Error message: Access to fetch at 'http://localhost:8081/v1/workspaces/...' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
  • Try: Check if your API yaml definition has consumes: - application/json and remove if so.

IntelliJ Issues

List of things to try

Eventually will add what problems these things fix, but some IntelliJ Things You Can Try include, in order of disruptiveness:

  • ./gradlew compileGeneratedJava
  • Gradle > Reload all Gradle projects
  • File > Invalidate caches and restart
  • Delete and recreate project