Body: <p>I have some BED files that I have compressed with <code>bgzip</code> and indexed with <code>tabix</code>. </p>
  
  <p>I am using version <code>1.9-392-gcfa32f7-dirty</code> on the server side.</p>
  
  <pre><code>$ /usr/local/bin/bgzip --version
  bgzip (htslib) 1.9-392-gcfa32f7-dirty
  Copyright (C) 2019 Genome Research Ltd.
  </code></pre>
  
  <p>The files are served from a subdirectory made available via <code>nginx</code> on port 80 (http) and 443 (https).</p>
  
  <p>The problem is that, for some <code>bgzip</code>-compressed files, I get a correct response to a <code>tabix</code> query if I run it locally, e.g.:</p>
  
  <pre><code>$ tabix "http://explore.altius.org/tabix/vB/hg19.15.all.KL.gz" chr1:50669400-50669800
  chr1    50669200    50669400    id:253347,qcat:[ [0,1], [0,2], [0,3], [0,4], [0,5], [0,6], [0,7], [0,8], [0,9], [0,10], [0,11], [0,12], [0,13], [0,14], [0.1764,15] ]
  chr1    50669400    50669600    id:253348,qcat:[ [0,1], [0,2], [0,3], [0,4], [0,5], [0,6], [0,7], [0,8], [0,9], [0,10], [0,11], [0,12], [0,13], [0,14], [0.1764,15] ]
  chr1    50669600    50669800    id:253349,qcat:[ [0,1], [0,2], [0,3], [0,4], [0,5], [0,6], [0,7], [0,8], [0,9], [0,10], [0,11], [0,12], [0,13], [0,14], [0.1764,15] ]
  </code></pre>
  
  <p>However, when I run this command from another host (such as my laptop), I get no result:</p>
  
  <pre><code>$ tabix "http://explore.altius.org/tabix/vB/hg19.15.all.KL.gz" chr1:50669400-50669800
  $
  </code></pre>
  
  <p>Running <code>echo $?</code> gives a result of <code>0</code> (no error). There is nothing in <code>nginx</code> error logs to suggest an issue with http access. </p>
  
  <p>Other <code>bgzip</code>-compressed files work, which further suggests a problem with either the compressed file or its <code>tbi</code> index file, and not with the nginx configuration. </p>
  
  <p>From my laptop, for instance, the following file can be accessed:</p>
  
  <pre><code>$ tabix "http://explore.altius.org/tabix/vB/hg19.15.all.KLs.gz" chr1:50669400-50669800
  chr1    50669200    50669400    id:253347,qcat:[ [0,1], [0,2], [0,3], [0,4], [0,5], [0,6], [0,7], [0,8], [0,9], [0,10], [0,11], [0,12], [0,13], [0,14], [0.23635,15] ]
  chr1    50669400    50669600    id:253348,qcat:[ [0,1], [0,2], [0,3], [0,4], [0,5], [0,6], [0,7], [0,8], [0,9], [0,10], [0,11], [0,12], [0,13], [0,14], [0.23635,15] ]
  chr1    50669600    50669800    id:253349,qcat:[ [0,1], [0,2], [0,3], [0,4], [0,5], [0,6], [0,7], [0,8], [0,9], [0,10], [0,11], [0,12], [0,13], [0,14], [0.23635,15] ]
  </code></pre>
  
  <p>I've investigated the two test files and they are both sorted lexicographically by chromosome name and numerically by start and stop coordinates. I do not see any odd line endings. These two test files are both virtually identical, except for the data in the fourth column.</p>
  
  <p>Is there anything I can do to further troubleshoot this and figure out why I cannot get a result from other hosts other than the server itself, and only for certain files? (Is there a debug version of htslib applications that would include verbose logging, say?)</p>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>In response to Jonathan Moore's comment, I <code>wget</code> the bgzip-ed <code>gz</code> archive and its associated <code>tbi</code> index, and then try to query the file locally (not via http, but directly via the filesystem). </p>
  
  <p>I get the following error message:</p>
  
  <pre><code>$ tabix hg19.15.all.KL.gz chr1:50669400-50669800
  [W::hts_idx_load2] The index file is older than the data file: hg19.15.all.KL.gz.tbi
  </code></pre>
  
  <p>The <code>tbi</code> index file was made immediately after creating the <code>gz</code> file, so I don't understand this error.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-04T13:04:28.043Z
Comments.Text: Can you wget these particular files from the laptop?  If so, can you then use tabix locally on the laptop to decode the file you just got?
Comments.UserDisplayName: Jay Moore
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-04T20:05:14.243Z
Comments.Text: When I do so, I get a strange error. I have updated my question with more details.
Comments.UserDisplayName: Alex Reynolds
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-04T21:18:36.733Z
Comments.Text: That looks to be a fairly common warning message that people get in a few different strange circumstances.  The only thing that comes to mind is whether there is a weird version difference between the tabix format installed on the laptop and that on the server that is coming into play.  Can you get the tabix's to tell you their version numbers?
Comments.UserDisplayName: Jay Moore
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-04T21:20:23.230Z
Comments.Text: My other thought is, if you generate a tabix index on the laptop, is it different from the one that you wget from the server?
Comments.UserDisplayName: Jay Moore
Tags: <htslib><tabix><bgzip>
Title: How to troubleshoot access to tabix file via http or https?
ThreadText: # How to troubleshoot access to tabix file via http or https?
  
  (Asked by: username_0 on 2019-10-03)
  
  I have some BED files that I have compressed with `bgzip` and indexed with `tabix`.
  
  I am using version `1.9-392-gcfa32f7-dirty` on the server side.
  
  ```
  $ /usr/local/bin/bgzip --version
  bgzip (htslib) 1.9-392-gcfa32f7-dirty
  Copyright (C) 2019 Genome Research Ltd.
  
  ```
  
  The files are served from a subdirectory made available via `nginx` on port 80 (http) and 443 (https).
  
  The problem is that, for some `bgzip`-compressed files, I get a correct response to a `tabix` query if I run it locally, e.g.:
  
  ```
  $ tabix "http://explore.altius.org/tabix/vB/hg19.15.all.KL.gz" chr1:50669400-50669800
  chr1    50669200    50669400    id:253347,qcat:[ [0,1], [0,2], [0,3], [0,4], [0,5], [0,6], [0,7], [0,8], [0,9], [0,10], [0,11], [0,12], [0,13], [0,14], [0.1764,15] ]
  chr1    50669400    50669600    id:253348,qcat:[ [0,1], [0,2], [0,3], [0,4], [0,5], [0,6], [0,7], [0,8], [0,9], [0,10], [0,11], [0,12], [0,13], [0,14], [0.1764,15] ]
  chr1    50669600    50669800    id:253349,qcat:[ [0,1], [0,2], [0,3], [0,4], [0,5], [0,6], [0,7], [0,8], [0,9], [0,10], [0,11], [0,12], [0,13], [0,14], [0.1764,15] ]
  
  ```
  
  However, when I run this command from another host (such as my laptop), I get no result:
  
  ```
  $ tabix "http://explore.altius.org/tabix/vB/hg19.15.all.KL.gz" chr1:50669400-50669800
  $
  
  ```
  
  Running `echo $?` gives a result of `0` (no error). There is nothing in `nginx` error logs to suggest an issue with http access.
  
  Other `bgzip`-compressed files work, which further suggests a problem with either the compressed file or its `tbi` index file, and not with the nginx configuration.
  
  From my laptop, for instance, the following file can be accessed:
  
  ```
  $ tabix "http://explore.altius.org/tabix/vB/hg19.15.all.KLs.gz" chr1:50669400-50669800
  chr1    50669200    50669400    id:253347,qcat:[ [0,1], [0,2], [0,3], [0,4], [0,5], [0,6], [0,7], [0,8], [0,9], [0,10], [0,11], [0,12], [0,13], [0,14], [0.23635,15] ]
  chr1    50669400    50669600    id:253348,qcat:[ [0,1], [0,2], [0,3], [0,4], [0,5], [0,6], [0,7], [0,8], [0,9], [0,10], [0,11], [0,12], [0,13], [0,14], [0.23635,15] ]
  chr1    50669600    50669800    id:253349,qcat:[ [0,1], [0,2], [0,3], [0,4], [0,5], [0,6], [0,7], [0,8], [0,9], [0,10], [0,11], [0,12], [0,13], [0,14], [0.23635,15] ]
  
  ```
  
  I've investigated the two test files and they are both sorted lexicographically by chromosome name and numerically by start and stop coordinates. I do not see any odd line endings. These two test files are both virtually identical, except for the data in the fourth column.
  
  Is there anything I can do to further troubleshoot this and figure out why I cannot get a result from other hosts other than the server itself, and only for certain files? (Is there a debug version of htslib applications that would include verbose logging, say?)
  
  ---
  
  **Update**
  
  In response to Jonathan username_1's comment, I `wget` the bgzip-ed `gz` archive and its associated `tbi` index, and then try to query the file locally (not via http, but directly via the filesystem).
  
  I get the following error message:
  
  ```
  $ tabix hg19.15.all.KL.gz chr1:50669400-50669800
  [W::hts_idx_load2] The index file is older than the data file: hg19.15.all.KL.gz.tbi
  
  ```
  
  The `tbi` index file was made immediately after creating the `gz` file, so I don't understand this error.
  
  **Tags:** htslib, tabix, bgzip
  
  > **Comments:**
  > **username_1**: Can you wget these particular files from the laptop?  If so, can you then use tabix locally on the laptop to decode the file you just got?  
  > **username_0**: When I do so, I get a strange error. I have updated my question with more details.  
  > **username_1**: That looks to be a fairly common warning message that people get in a few different strange circumstances.  The only thing that comes to mind is whether there is a weird version difference between the tabix format installed on the laptop and that on the server that is coming into play.  Can you get the tabix's to tell you their version numbers?  
  > **username_1**: My other thought is, if you generate a tabix index on the laptop, is it different from the one that you wget from the server?  
  
  ---
  
  ## 0 answers
  
  