# Common errors + fixes

## Microsoft Visual C++ 14.0 required <a href="#visual_studio" id="visual_studio"></a>

<div align="left" data-full-width="false"><figure><img src="https://1229326975-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJi1Dnz98r18DXDpXAYS4%2Fuploads%2FVKHYqc9ztAcJ8e0SqXYz%2F%7B29D7B057-6399-4636-9E21-F1FF32971307%7D.png?alt=media&#x26;token=d2754934-6cc8-4a29-8e21-399d90b74aff" alt=""><figcaption><p>Console log</p></figcaption></figure></div>

Go to <https://visualstudio.microsoft.com/downloads/?q=build+tools> and download Visual Studio 2022. \
Install it and open the app. \
When the program opens, in the main menu you need to select the item as they are displayed on the screenshot below. \ <mark style="background-color:yellow;">**The most important part is Visual C++ build tools at the top left.**</mark> Check all the required boxes and click Install.

<figure><img src="https://1229326975-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJi1Dnz98r18DXDpXAYS4%2Fuploads%2Fi2mFFGUR9lkbGSuKo8EK%2Fimage.png?alt=media&#x26;token=cc51bbb5-e04f-4a37-8242-febe2981b038" alt=""><figcaption></figcaption></figure>

<mark style="background-color:green;">**Wait for the installation process and then restart your computer. Done.**</mark>

## Aiodns needs a SelectorEventLoop

<figure><img src="https://1229326975-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJi1Dnz98r18DXDpXAYS4%2Fuploads%2FoMqqSMiWBzSCuQ8fSk6U%2Fimage.png?alt=media&#x26;token=19f15ca0-1217-4eae-937d-2c44b73e6cc6" alt=""><figcaption></figcaption></figure>

***

The Aiodns problem has been fixed, follow the instructions below.

1. Download the new version from GitHub
2. Open the console in the bot's repository and enter the following:&#x20;

```powershell
python -m venv venv
```

```
venv\Scripts\activate 
```

```
pip install -r requirements.txt
```

**Restart the PC (IMPORTANT!)**

```
venv\Scripts\activate
```

```
python main.py
```

## SSL Certificate Verify Failed

ERROR: Cannot connect to host some.host:443 ssl:True \[SSLCertVerificationError: (5, '\[SSL: CERTIFICATE\_VERIFY\_FAILED] certificate verify failed: unable to get local issuer certificate (\_ssl.c:1028)')]

***

#### SOLUTION FOR WINDOWS

Open powershell and paste these commands:

```powershell
certutil -generateSSTFromWU roots.sst
```

```
certutil -addstore -f root roots.sst
```

#### SOLUTION FOR LINUX

Open terminal and paste these commands:

```bash
sudo apt update
```

```bash
sudo apt install -y openssl ca-certificates
```

```bash
wget -O roots.pem https://curl.se/ca/cacert.pem
```

```bash
sudo cp roots.pem /usr/local/share/ca-certificates/roots.crt
```

```bash
sudo update-ca-certificates
```

## Too many open files

\[Errno 24] Too many open files: ...\
\
Open powershell and paste these commands:

```
ulimit -n 1000000
```

Open file with this command:

```
nano /etc/sysctl.conf
```

Copy and paste there this code

```
fs.inotify.max_user_instances=25650
fs.file-max = 9223372036854775807
net.core.rmem_max=2500000
net.core.rmem_max=2500000
net.core.rmem_max=67108864
fs.inotify.max_user_watches = 524288
kernel.pid_max=65536
net.ipv4.tcp_fastopen=3
vm.max_map_count = 1000000
net.core.rmem_default = 134217728
net.core.rmem_max = 134217728
net.core.wmem_default = 134217728
net.core.wmem_max = 134217728
net.ipv4.conf.all.accept_redirects=0
net.ipv4.conf.all.secure_redirects=0
net.ipv4.conf.all.send_redirects=0
net.ipv4.tcp_fin_timeout=7
net.ipv4.icmp_ignore_bogus_error_responses=1
```

Open file with this command:

```
nano /etc/systemd/system.conf
```

Copy and paste there this code

```
DefaultLimitNOFILE=1000000
```
