.. Reminder for header structure:
  Parts (H1)          : #################### with overline
  Chapters (H2)       : ******************** with overline
  Sections (H3)       : ====================
  Subsections (H4)    : --------------------
  Subsubsections (H5) : ^^^^^^^^^^^^^^^^^^^^
  Paragraphs (H6)     : """""""""""""""""""""

.. meta::
  :description: Frequent problems and questions
  :keywords: lost password, lost private key, stolen private key, BIOS bug, waptdeploy, WAPT, documentation, the WAPT Deployment utility

.. _error_licence_wapt:

####################
FAQ - Licence Issues
####################


Removing a WAPT licence
=======================

* In the WAPT Console, click on the :guilabel:`?` tab:

.. image:: wapt-resources/wapt_console-more-info-tab_menu-list.png
  :align: center
  :alt: More information tab in the WAPT Console

* Then choose :guilabel:`Licences`:

.. figure:: wapt-resources/wapt_console_licence-no-licence_container-window.png
  :align: center
  :scale: 75%
  :alt: Window showing that no WAPT licences in subscribed in the WAPT Console

  Window showing that no WAPT licences in subscribed in the WAPT Console

* Finally, select the row and click :guilabel:`Remove License`:

.. figure:: wapt-resources/wapt_console_licence-remove-confirm_dialog-box.png
  :align: center
  :alt: Confirmation window to remove a licence from the WAPT Console

  Confirmation window to remove a licence from the WAPT Console

* When confirmed, the selected licences are removed:

.. figure:: wapt-resources/wapt_console_licence-no-licence_container-window.png
  :align: center
  :scale: 75%
  :alt: Window listing no subscribed WAPT licences in the WAPT Console

  Window listing no subscribed WAPT licences in the WAPT Console


License location
================

:file:`licence.json` are stocked on the WAPT Server in the following location:

.. tabs::

  .. code-tab:: ini Debian and derivatives

    /var/www/licences.json

  .. code-tab:: ini RedHat and derivatives

    /var/www/html/licences.json

  .. code-tab:: ini Windows

    C:\wapt\waptserver\repository\licences.json


License error
=============

Expired licence
---------------

If a licence has expired, then its status displays :guilabel:`Expired`.

.. figure:: wapt-resources/wapt_console_licence-expired_container-window.png
  :align: center
  :scale: 75%
  :alt: Window showing an expired licence in the WAPT Console

  Window showing an expired licence in the WAPT Console

Old licence location
--------------------

When installaing the WAPT Console, if licence is located in an old location, this error appear will show:

.. figure:: wapt-resources/wapt_console_licence-error-old-location_dialog-box.png
  :align: center
  :alt: WAPT licence error message when upgrading WAPT to 2.1

  WAPT licence error message when upgrading WAPT to 2.1

Error activating a WAPT licence
-------------------------------

This error is due to a problem with the post-configuration script and a special configuration of NGINX. 

.. figure:: wapt-resources/wapt_console_licence-error-added_dialog-box.png
  :align: center
  :alt: Dialog box informing an error occured while activating a WAPT licence

  Dialog box informing an error occured while activating a WAPT licence

**3 points** are to be checked:

1. Check whether :file:`/etc/nginx/sites-enabled/wapt.conf` is a symbolic link of :file:`/etc/nginx/sites-available/wapt.conf`, using this command:

  .. code-block:: bash

    ls -l /etc/nginx/sites-enabled/wapt.conf

  * If the symbolic link exists, the output should be:

  .. code-block:: bash

    lrwxrwxrwx 1 root root 36 Jun 9 09:35 /etc/nginx/sites-enabled/wapt.conf --> /etc/nginx/sites-available/wapt.conf

  * If the symbolic link does not exist, then remove :file:`/etc/nginx/sites-enabled/wapt.conf` and create a new symbolic link:

  .. code-block:: bash

    rm /etc/nginx/sites-enabled/wapt.conf

    ln -s /etc/nginx/sites-available/wapt.conf /etc/nginx/sites-enabled/wapt.conf

2. Check whether the file :file:`licences.json` is present in :guilabel:`location` section of :file:`/etc/nginx/sites-enabled/wapt.conf`:

  .. code-block:: bash

    location ~ ^/(wapt/waptsetup-tis.exe|wapt/waptagent.exe|wapt/waptdeploy.exe|sync.json|rules.json|licences.json)$ {
            add_header Cache-Control "store, no-cache, must-revalidate, post-check=0, pre-check=0";
            add_header Pragma "no-cache";
            root "/var/www";
        }

  * If the :file:`licences.json` file exist, then restart :program:`Nginx`:

  .. code-block:: bash

    systemctl restart nginx

  * Then, add the :file:`licences.json` file in :guilabel:`location` section of :file:`/etc/nginx/sites-enabled/wapt.conf` and restart NGINX.

  .. code-block:: bash

    systemctl restart nginx

3. If you get an error, empty :file:`/var/www/licences.json`:

  .. code-block:: bash

    > /var/www/licences.json 

  * Then, retry :ref:`activating the WAPT licence <licence_activation>`.
