phenopolis / phenopolis_genomics_browser

Python API and React frontend for the Phenopolis Genomics Browser
https://dev-live.phenopolis.org
MIT License
31 stars 2 forks source link

Variant web page issues #341

Closed alanwilter closed 3 years ago

alanwilter commented 3 years ago

I've detected these issues while working on #340, thinking that I've had introduced a bug somehow. However, it's currently in our dev-live branch and, as far as I can see, it has been there for months (I've tested several older commits back to Feb).

I couldn't reproduce these issues in prod-live or dev-live.

So what are the issues? I've seen two particular cases:

Screenshot 2021-04-29 at 23 04 13
frontend_1  | ◈ Proxying to http://host.docker.internal:5000/is_logged_in
frontend_1  | [HPM] Proxy created: /  -> http://host.docker.internal:5000
frontend_1  | ◈ Proxying to http://host.docker.internal:5000/variant/14-76156575-A-G
frontend_1  | [HPM] Proxy created: /  -> http://host.docker.internal:5000
frontend_1  | ◈ Proxying to http://host.docker.internal:5000/variant/14-76156575-A-G
frontend_1  | [HPM] Proxy created: /  -> http://host.docker.internal:5000
db_1        | 2021-04-29 21:03:30.654 UTC [265] LOG:  unexpected EOF on client connection with an open transaction
db_1        | 2021-04-29 21:03:30.659 UTC [264] LOG:  unexpected EOF on client connection with an open transaction
db_1        | 2021-04-29 21:03:30.665 UTC [262] LOG:  unexpected EOF on client connection with an open transaction
db_1        | 2021-04-29 21:03:30.666 UTC [258] LOG:  unexpected EOF on client connection with an open transaction
frontend_1  | [HPM] Error occurred while trying to proxy request /variant/14-76156575-A-G from localhost:8888 to http://host.docker.internal:5000 (ECONNRESET) (https://nodejs.org/api/errors.html#errors_common_system_errors)
frontend_1  | [HPM] Error occurred while trying to proxy request /variant/14-76156575-A-G from localhost:8888 to http://host.docker.internal:5000 (ECONNRESET) (https://nodejs.org/api/errors.html#errors_common_system_errors)
db_1        | 2021-04-29 21:03:30.686 UTC [263] LOG:  unexpected EOF on client connection with an open transaction
app_1       | [2021-04-29 21:03:30 +0000] [51] [INFO] Booting worker with pid: 51

In other situations (like in Debug mode with VSCode) I've seen these error messages:

double free or corruption (fasttop)
Python(9588,0x700008879000) malloc: *** error for object 0x8000000000000000: pointer being freed was not allocated
Python(9588,0x700008879000) malloc: *** set a breakpoint in malloc_error_break to debug
frontend_1  | Could not open index.js in the editor.
frontend_1  | The editor process exited with an error: spawn vi ENOENT.
frontend_1  |
frontend_1  | To set up the editor integration, add something like REACT_EDITOR=atom to the .env.local file in your project folder and restart the development server. Learn more: https://goo.gl/MMTaZt
frontend_1  | [HPM] Proxy created: /  -> http://app:5000
frontend_1  | (node:8) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [Server]. Use emitter.setMaxListeners() to increase limit
frontend_1  | (Use `node --trace-warnings ...` to show where the warning was created)

I can't guarantee the steps above will be 100% reproducible but it definitely happens all the time on my local setup or when running the docker services on overdrive remotely and accessing via port 8888 ssh tunnelled to my local mac.

A side note, running pytest works fine, as well as using curl like:

$ curl -c cookies.txt --header "Content-Type: application/json" \
  --request POST \
  --data '{"user": "Admin","password": "admin123"}' \
  http://localhost:8888/api/login

{"success":"Authenticated","username":"Admin"}

$ curl -b cookies.txt --header "Content-Type: application/json" \
  --request GET \
  http://localhost:8888/api/variant/14-76246104-C-A

[{"consequence":{"colNames":[{"default":"true","description":"HGV...
alanwilter commented 3 years ago

I'm trying Firefox Debugger, asking to pause on Exceptions. Simply starting the page and the debugger already shows me issues. See figure:

Screenshot 2021-04-30 at 08 49 11
alanwilter commented 3 years ago

Debug screenshot when trying to access a variant:

Screenshot 2021-04-30 at 09 02 32

Another error message while accessing a variant from the Gene page:

frontend_1  | [HPM] Proxy created: /  -> http://app:5000
app_1       | [E::get_intv] Failed to parse TBX_VCF, was wrong -p [type] used?
app_1       | The offending line was: ":.:. ./.:.:.:.:. ./.:.:.:.:. ./.:.:.:.:. ./.:.:.:.:. ./.:.:.:.:. ./.:.:.:.:. ./.:.:.:.:. ./.:.:.:.:.

This is related to the routine to retrieve VCF data from AWS S3.

Another screenshoot, while trying to Expand More button:

Screenshot 2021-04-30 at 09 10 47
alanwilter commented 3 years ago

Working on my dev branch mig_variant #340 and it seems to have showed some stability improvement though I still have some issues

YuanTian1991 commented 3 years ago

Hi @alanwilter The error happens because one attributes is NULL, which is the fourth raw list in meta panel:

image

I have fixed it, will merge now.

alanwilter commented 3 years ago

Thanks @YuanTian1991, I noticed that sending empty strings to frontend seems to have improved. Definitely Null or None types were not playing nicely with frontend. But my finds were only on my mig_variant branch.

alanwilter commented 3 years ago

The real root of this issue was cyvcf2 on my Mac.