Frequently Asked Questions (FAQ)

HOW CAN I UPDATE THE CODACY CONTROL PANEL?

To update the control panel, simply run on your server terminal:

bash -c "$(curl -fsSL https://getenterprise.codacy.com/get)" -s update

 

CAN I RUN CODACY BEHIND A PROXY?

Yes, Codacy can run behind a proxy. The installer will configure the application to be able to run behind a proxy and, after installed and the engines downloaded, you will be able to remove internet access from the machine running Codacy, as all analysis will be performed offline. 

 
 

WHAT ARE THE NETWORK REQUIREMENTS FOR CODACY IN TERMS OF INBOUND AND OUTBOUND TRAFFIC PORTS?

These are the ports used by Codacy:

Inbound ports:

  • http: 80
  • https: 443
  • admin panel: 9000
  • admin panel on https: 9443
  • api port: 16006 (for coverage)
  • analysis metrics port: 16005 (for average analysis times and analysis queues)

Outbound:

  • Whatever port used on the source code hosting (we use ssh for private projects and http or git protocol for public projects)
  • 80 and 443 to getenterprise.codacy.com
  • 443 to index.docker.io
 

LOGS SHOW ISSUES ON DB CONNECTION: "CANNOT CONNECT TO DB [RESULTS]"

We found that the most common problem is that the new DB is not created; this new database - called "results" - was not created:

Error in custom provider, Configuration error: Configuration error: Cannot connect to database [results]
while locating play.api.db.DBApiProvider
while locating play.api.db.DBApiWhile

To fix this:
1 - Restart server
2 - Update the control panel:

bash -c "$(curl -fsSL https://getenterprise.codacy.com/get)" -s update

3 - Reload the application. It should show in the logs that it is running init scripts, and trying to create new DBs.

As a workaround, we can do the exact same thing the scripts are performing:

1 - Get a psql connection to the server:

docker run -it --rm postgres:9.4.5 sh -c 'exec psql -h "172.17.0.1" -p "5432" -U postgres'

2 - We should have several DBs created for Codacy:

Codacy DBs

In the PSQL shell, run:

CREATE DATABASE codacy_results WITH OWNER=codacy; 

 

MACHINE WAS RESTARTED AND THE DB IP CHANGED. WHAT NOW?

Please be aware that a Postgres installation using docker is not advised or supported. We strongly advise using a separate Postgres outside the Codacy machine, in order to be able to upgrade/downgrade Docker and Codacy without losing data in the DB. The server should be considered stateless at all times.

If you're using Postgres on Docker, the DB IP may change upon server restart. Although running Postgres in docker is not supported for a production environment, you can have the system find the new database IP automatically. You can do that by updating the IP of the DB in the config, setting it to:

{{ conf.doplicated.var.internalhostip }}


Configuration key

In case you are not using DNS you should set Host and Host Docker Ip to:

{{ conf.doplicated.var.hostip }}

{{ conf.doplicated.var.internalhostip }}

 

Upon saving and reloading the application, the changes will have been applied.

 

MACHINE WAS RESTARTED AND CONFIGURATION CHECKS FAILS. WHAT NOW?

Check the database IP settings and make sure they are all still valid; If the database is running on a docker, its IP may have changed.

If the problem is the "Application Secret" or "Cache Secret", the values presented on the "Configuration Check" page should be applied on the Control Panel configuration tab.

Upon saving and reloading the application, the changes will have been applied.

 

I GET A PAGE NOT FOUND AFTER UPLOADING THE APPLICATION LICENSE.

Currently, Codacy requires 2 different licenses; One is a .dlk file, used in the installer, and another .key file, used in Codacy. If the dlk file is imported, it will fail to parse and throw an exception.

If you navigate to your URL http://YOUR_SERVER/license, it should allow you to introduce the correct one.

 

ANALYSIS ARE TAKING TOO LONG. WHAT COULD BE WRONG?

Docker version

Please make sure docker is running a supported version; So far, Codacy supports from 1.7.0 to 1.9.1. Version 1.10 is currently not supported and will not perform any analysis.

The initial analysis on a project may take a bit longer; for a big project it may take up to 1h, depending on the hardware used on the server. Even so, we find that over 90% of projects are analysed under the 5min mark. If you find your project taking longer than what would be expected for its size, there may be some issues with the running docker engine.

If you find your analysis to take longer than expected, please email us the logs to support@codacy.com.

 

CODACY DOESN'T SEEM TO BE ANALYSING AND THE CONTAINER COUNT IS GETTING BIGGER

Please check for updates on Codacy Control Panel for updated engines. If a new release is available, update it and restart your server.

 

When the installer first runs on a server, it generates a random key and uses it to cipher all data stored in the DB, making sure that if partial table contents are shared, all information will be rendered useless. If you install a new server, you will need to use the same key as before. The configuration panel will then notify you of missed configurations and provide you with a usable key to be used in the configuration panel.

 

CAN WE SETUP CODACY IN A HIGH AVAILABILITY OR DISASTER RECOVERY TOPOLOGY?

For this, only the database needs to be high availability. The server has no state and can be replaced at any time (if the machine dies, a new installation can be made and put up shortly).

If the requirement is to have the app machine in high availability, you can have two or more installations hidden behind a load balancer.

 

HOW TO UPDATE THE LICENSE?

Go to control panel home -> Settings -> License -> Check for updates. 

Go to control panel home -> Configure -> click Save at the bottom of the page (no need to change any details)

Go to control panel home -> Reload

 

NO QUESTION HERE APPLIES TO MY CURRENT PROBLEM. WHAT CAN I DO?

Download the logs by navigating to Support on the Codacy Control Panel. Please email us the file and a detailed explanation of what is currently happening (support@codacy.com).

 
Have more questions? Submit a request

0 Comments

Article is closed for comments.