Why is the Clover report showing as a directory listing of the clover report directory?
Asked by Mike Kim:

clover.gif  
[](https://community.atlassian.com/t5/Bamboo-questions/Why-is-the-Clover-report-showing-as-a-directory-listing-of-the/qaq-p/423624?attachment-id=8785){#link_1168c1ad9277bb}  
[](/tnckb94959/attachments/tnckb94959/bamboo-questions/13361/1/clover.gif){#display_1168c1ad9277bb_0}


Answers:
author: Marek Parfianowicz
body: Did you use standard Bamboo installation or deployed Bamboo WAR into your own Tomcat? Did you change anything in Tomcat configuration?

I'm asking, because when an URL refers to a directory instead of a file, e.g., `http://`*my.bamboo*`/path/to/my/artifact/`, you can configure Tomcat to:

* show the directory listing or
* display a welcome file or
* issue an error "404 Page Not Found".

I suspect that you have the directory listing enabled. If yes, please disable it.

See <https://tomcat.apache.org/tomcat-6.0-doc/default-servlet.html> for more details.


author: cbenard1
body: This can be fixed via the following change:

Administration -\> Security -\> Security settings and switch "Resolve artifacts content type by extension" on

comments: author: Mike Kim
body: Yes, this is the solution. Thanks!


author: Krystian Brazulewicz
body: For every file that is served by Bamboo under `/artifact/` (via `AbstractArtifactDownloadStrategy#serveFile`) we determine proper Content-Type using `WEB-INF/mimetypes.xml`. For files with html extension it is `text/html`.

If request would end-up in serving a directory listing, Bamboo first checks if the directory contains index.html or index.htm (AbstractArtifactDownloadStrategy#getWelcomePage). If any of those is found then Bamboo sends redirect to this resource. Otherwise Bamboo serves HTMLized directory listing.

In order to see more information in the logs for this part of Bamboo please go to Administration/Log settings and enable `ALL` logs for package `com.atlassian.bamboo.plugin.servlet`.

As @Marek Parfianowicz mentioned this is how default Bamboo setup works. If you are sure that your Bamboo installation was not customized/modified after initial setup then please contact our [Support](https://support.atlassian.com/servicedesk/customer/bsp) to resolve the problem.

comments: author: Mike Kim
body: I enabled logging as you suggested, but all I see in catalina.out is this:2015-06-10 20:35:38,018 DEBUG \[http-bio-8085-exec-11\] \[AbstractArtifactDownloadStrategy\] Serving up /home/j2auto/bamboo/bamboo-home/artifacts/MY_PROJECT/JOB1/build-00088/Clover-Report-(System)/index.html as /artifact/MY_PROJECT/JOB1/build-88/Clover-Report-(System)/index.htmlBut 'index.html' shows as the html source, with content-type 'text/plain'. mimetypes.xml does have 'html' configured as 'text/html'. That has not been modified.Pretty strange, huh?


author: Marek Parfianowicz
body: The most probably you're using the Amazon S3 Artifact handler to store your build artifacts, am I correct? The Amazon S3 storage by default serves files one-by-one and not as the entire web static site.

In order to fix this, please open Configure Plan \> Miscellaneous tab, next select the "Use custom artifact handler settings" check-box, next select "Server-Local Artifact Handler" for shared and non-shared artifacts.

Bug report: <https://jira.atlassian.com/browse/CLOV-1560>


author: Mike Kim
body: I don't think the Tomcat configuration theory would explain why clicking on index.html shows the html source instead of the web page:

clover2.gif  
[](https://community.atlassian.com/t5/Bamboo-questions/Why-is-the-Clover-report-showing-as-a-directory-listing-of-the/qaq-p/423624?attachment-id=10990){#link_1168c1d97716dc}  
[](/tnckb94959/attachments/tnckb94959/bamboo-questions/13364/1/clover2.gif){#display_1168c1d97716dc_0}

comments: author: Marek Parfianowicz
body: Could you please tell what version of Bamboo do you use?


author: Mike Kim
body: 5.8.1 build 5866


author: Marek Parfianowicz
body: Did you use a standard Bamboo installer? Or did you deploy Bamboo WAR into own Tomcat? If the latter one, then what custom settings do you have in your Tomcat?


author: Mike Kim
body: It's a standard Bamboo install. You can tell because going to http://\<BAMBOO_HOST\>/artifact/ shows the following stack trace:com.atlassian.bamboo.plugin.servlet.ArtifactDownloadStrategy.getFileToServe(ArtifactDownloadStrategy.java:81)In other words, it invokes a Bamboo servlet which is designed to pass through artifacts. In fact, it does do this. What it does not do is pass through html pages as a web server does. Rather it serves html pages that are artifacts with content-type 'text/plain'.So the general question is, how do you configure Bamboo to serve html pages under the 'artifacts' directory as text/html and not text/plain? Is it even possible to configure Bamboo to serve 'artifacts' as web assets?


author: Marek Parfianowicz
body: Hi Mike. Could you please create a support ticket on <http://support.atlassian.com> and attach a Bamboo support ZIP in it? See: \* <https://confluence.atlassian.com/display/BAMBOO/Raising+a+request+with+Atlassian+Support>


Tags: clover