Skip to content

Chemical component cache poisoning #703

Closed

Description

@josemduarte

In cases where there's problems downloading the chemical component files from PDB, corrupted or empty files are still saved producing difficult to understand errors down the line (see #702). Two things to fix:

  • do not store files if the download is empty or any kind of server error (404 or others)
  • better error handling when the file doesn't have valid content, trying a redownload

Activity

  1. sbliven commented on Sep 4, 2017

    @sbliven
    Member

    A simple check would be to re-download files if they are too small.

    The smallest PDB file I could get BioJava to read is 79 bytes, which compresses to 47B with gzip.

    ATOM      1  K     K K   1           1       1       1     1     1           K
    

    The smallest CIF file I made is 384B, compressed 176B

    data_
    _atom_site.group_PDB ATOM
    _atom_site.id 1
    _atom_site.type_symbol K
    _atom_site.label_atom_id K
    _atom_site.label_alt_id .
    _atom_site.label_comp_id K
    _atom_site.label_asym_id K
    _atom_site.pdbx_PDB_ins_code ?
    _atom_site.Cartn_x 1
    _atom_site.Cartn_y 1
    _atom_site.Cartn_z 1
    _atom_site.occupancy 1
    _atom_site.B_iso_or_equiv 1
    _atom_site.auth_seq_id 1
    _atom_site.pdbx_PDB_model_num 1
    

    An empty file compresses to 20B (just the header). Maybe set the threshold to about 40B to be safe?

  2. self-assigned this
    on Sep 5, 2017
  3. josemduarte commented on Sep 5, 2017

    @josemduarte
    ContributorAuthor

    It seems that there's been a redirect in place at RCSB that did:

    http://rcsb.org/pdb/files/ligand/HEM.cif  ----> https://files.org/ligands/HEM.cif
    

    So it looks like biojava wasn't handling URL redirects correctly for this case. That'd be another fix we need to correct the caching problems.

  4. sbliven commented on Sep 5, 2017

    @sbliven
    Member

    @josemduarte Sounds like an opportunity to move FileDownloadUtils to nio.

  5. josemduarte commented on Sep 5, 2017

    @josemduarte
    ContributorAuthor

    It seems that after all the redirect thing is not a bug but a feature. See https://stackoverflow.com/a/1884427/3914327

    We will change the redirects at RCSB not to cross protocols for maximum compatibility.

  6. josemduarte commented on Sep 7, 2017

    @josemduarte
    ContributorAuthor

    Since Wednesday the redirect from rcsb.org is from http to http. That should fix problems with any version before 4.2.8.

  7. added a commit that references this issue on Sep 8, 2017
  8. added this to the milestone on Mar 11, 2018
  9. added a commit that references this issue on Jun 18, 2018
    5a4a68c
  10. added a commit that references this issue on Jun 16, 2021
  11. added a commit that references this issue on Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugBugs and bugfixes

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions