morph1904 / Tyger2

A Reverse Proxy Application
GNU General Public License v2.0
50 stars 11 forks source link

Issue after installing - cant open web page at port 9091 #28

Closed derilium closed 3 years ago

derilium commented 3 years ago

I have followed the install procedure, ran the script and ran through the install (on the website) it then states to click the link including port 9091

When i click the link page cannot be displayed, i have also restarted the server to make sure that wasn't causing any problems

This is on ubuntu 18.04 server

Thanks

rob

morph1904 commented 3 years ago

Hi there. Have you opened the port on the firewall

Sudo ufw allow 9091

What are the service statuses of uwsgi and caddy?

derilium commented 3 years ago

I actually installed it 3 times and was met with the same error, the firewall wasn't on and when i looked into it more deeply caddy was never installed any of the times, by looking through syslog it stated that within /usr/lib/bin caddy file didnt exist.

By the sound of it the project could work really well for what i need, i just couldn't get it to work, this was on a vanilla Ubuntu 18.04 server, static ip address etc

I've since wiped the VM but would be happy to try again.

I also looked into the caddy installation specifically (from multiple websites) and the link they give to install it just doesnt work and has been superseded.

Let me know if any of that does or doesnt make sense.

thanks

rob

On Fri, 31 Jul 2020 at 09:21, morph1904 notifications@github.com wrote:

Hi there. Have you opened the port on the firewall

Sudo ufw allow 9091

What are the service statuses of uwsgi and caddy?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/morph1904/Tyger2/issues/28#issuecomment-666999661, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFA43DRUZXTGRNBPWLNKEEDR6J5IHANCNFSM4PNYPN5A .

derilium commented 3 years ago

I actually installed it 3 times and was met with the same error, the firewall wasn't on and when i looked into it more deeply caddy was never installed any of the times, by looking through syslog it stated that within /usr/lib/bin caddy file didnt exist.

By the sound of it the project could work really well for what i need, i just couldn't get it to work, this was on a vanilla Ubuntu 18.04 server, static ip address etc

I've since wiped the VM but would be happy to try again.

I also looked into the caddy installation specifically (from multiple websites) and the link they give to install it just doesnt work and has been superseded.

Let me know if any of that does or doesnt make sense.

thanks

rob

morph1904 commented 3 years ago

Thanks for the info BTW I have hidden your duplicate comment.

I am currently working on the latest version which utilises caddy v2. This should solve the problem.

In the meantime, it may be worth seeing if the docker version will work for you, it is easy to get running even if you house it on that ubuntu box. When I have the time later, I will look at modifying the install script to work with caddy 2 or at least fix caddy v1.

derilium commented 3 years ago

That's great, I was going to give the docker a try this weekend and will keep you posted.

Thanks

Rob

On Fri, 31 Jul 2020, 16:42 morph1904, notifications@github.com wrote:

Thanks for the info BTW I have hidden your duplicate comment.

I am currently working on the latest version which utilises caddy v2. This should solve the problem.

In the meantime, it may be worth seeing if the docker version will work for you, it is easy to get running even if you house it on that ubuntu box. When I have the time later, I will look at modifying the install script to work with caddy 2 or at least fix caddy v1.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/morph1904/Tyger2/issues/28#issuecomment-667188516, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFA43DSFKCN5BR2K334TFLLR6LQ53ANCNFSM4PNYPN5A .

JacobCoffee commented 3 years ago

I'm having the same issue - firewall is open.

I'll try the docker as well.

Can't wait for Caddy v2!

khellendros74 commented 3 years ago

same here nothing is LISTENING on port 9091

uwsgi 797 root 7u IPv4 14375 0t0 TCP 127.0.0.1:45509 (LISTEN) uwsgi 797 root 8u IPv4 14378 0t0 TCP :9090 (LISTEN) uwsgi 903 root 7u IPv4 14375 0t0 TCP 127.0.0.1:45509 (LISTEN) uwsgi 904 root 7u IPv4 14375 0t0 TCP 127.0.0.1:45509 (LISTEN) uwsgi 905 root 7u IPv4 14375 0t0 TCP 127.0.0.1:45509 (LISTEN) uwsgi 906 root 7u IPv4 14375 0t0 TCP 127.0.0.1:45509 (LISTEN) uwsgi 907 root 7u IPv4 14375 0t0 TCP 127.0.0.1:45509 (LISTEN) uwsgi 908 root 8u IPv4 14378 0t0 TCP :9090 (LISTEN)

morph1904 commented 3 years ago

It looks like this issue is caused by caddy not being installed by the script anymore. The docker version builds it from source and so does not have this issue.

I am not sure it is worth fixing for ubuntu as the majority of users are using docker, which is working fine, and I am close the RC of the latest version. I would be open to a pull request if someone would like a fix in the meantime.

morph1904 commented 3 years ago

Hi All,

I am looking for some testers for the latest docker version if you are interested. Details on the readme.

ksurl commented 3 years ago

I'm getting the same issue on docker. here's my compose file (version 2 for portainer):

version: "2"
services: 
  tyger2:
    image: morph1904/tyger2:beta
    container_name: tyger2
    volumes:
      - tyger2-data:/apps/Tyger2/data
      - tyger2-certs:/root/.caddy
    ports:
      - 443:443
      - 80:80
      - 9090:9090
      - 9091:9091
    restart: unless-stopped

after creating user at 9090/install, can't reach the 9091 admin page. the IP I used is the IP of my docker host, not the internal docker network IP of the container.

morph1904 commented 3 years ago

@ksurl please can you post the container logs and any more information you might have? When you say you are unable to reach the admin page, what error are you getting?

ksurl commented 3 years ago

Log:

(click to expand) ``` Starting ServicesActivating privacy features... 2020/09/30 23:58:21 [INFO] [REDACTED] acme: Obtaining bundled SAN certificate, 2020/09/30 23:58:21 [INFO] [REDACTED] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123127815, 2020/09/30 23:58:21 [INFO] [REDACTED] acme: use tls-alpn-01 solver, 2020/09/30 23:58:21 [INFO] [REDACTED] acme: Trying to solve TLS-ALPN-01, *** has_emperor mode detected (fd: 5) ***, [uWSGI] getting INI configuration from /apps/Tyger2/install/uwsgi.ini, Wed Sep 30 23:58:22 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini has been spawned, Wed Sep 30 23:58:22 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini is ready to accept requests, 2020/09/30 23:58:26 [INFO] Unable to deactivated authorizations: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123127815, 2020/09/30 23:58:27 [INFO] [REDACTED] acme: Obtaining bundled SAN certificate, 2020/09/30 23:58:28 [INFO] [REDACTED] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123127902, 2020/09/30 23:58:28 [INFO] [REDACTED] acme: use tls-alpn-01 solver, 2020/09/30 23:58:28 [INFO] [REDACTED] acme: Trying to solve TLS-ALPN-01, 2020/09/30 23:58:31 [INFO] Unable to deactivated authorizations: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123127902, 2020/09/30 23:58:32 [INFO] [REDACTED] acme: Obtaining bundled SAN certificate, 2020/09/30 23:58:32 [INFO] [REDACTED] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123127949, 2020/09/30 23:58:32 [INFO] [REDACTED] acme: use tls-alpn-01 solver, 2020/09/30 23:58:32 [INFO] [REDACTED] acme: Trying to solve TLS-ALPN-01, 2020/09/30 23:58:37 [INFO] Unable to deactivated authorizations: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123127949, 2020/09/30 23:58:38 [INFO] [REDACTED] acme: Obtaining bundled SAN certificate, 2020/09/30 23:58:38 [INFO] [REDACTED] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128017, 2020/09/30 23:58:38 [INFO] [REDACTED] acme: Could not find solver for: tls-alpn-01, 2020/09/30 23:58:38 [INFO] [REDACTED] acme: use http-01 solver, 2020/09/30 23:58:38 [INFO] [REDACTED] acme: Trying to solve HTTP-01, 2020/09/30 23:58:45 [INFO] Unable to deactivated authorizations: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128017, 2020/09/30 23:58:46 [INFO] [REDACTED] acme: Obtaining bundled SAN certificate, 2020/09/30 23:58:47 [INFO] [REDACTED] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128095, 2020/09/30 23:58:47 [INFO] [REDACTED] acme: Could not find solver for: tls-alpn-01, 2020/09/30 23:58:47 [INFO] [REDACTED] acme: use http-01 solver, 2020/09/30 23:58:47 [INFO] [REDACTED] acme: Trying to solve HTTP-01, 2020/09/30 23:58:50 [INFO] Unable to deactivated authorizations: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128095, 2020/09/30 23:58:51 [INFO] [REDACTED] acme: Obtaining bundled SAN certificate, 2020/09/30 23:58:51 [INFO] [REDACTED] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128134, 2020/09/30 23:58:51 [INFO] [REDACTED] acme: Could not find solver for: tls-alpn-01, 2020/09/30 23:58:51 [INFO] [REDACTED] acme: use http-01 solver, 2020/09/30 23:58:51 [INFO] [REDACTED] acme: Trying to solve HTTP-01, 2020/09/30 23:58:56 [INFO] Unable to deactivated authorizations: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128134, 2020/09/30 23:58:57 failed to obtain certificate: acme: Error -> One or more domains had a problem:, [REDACTED] acme: error: 403 :: urn:ietf:params:acme:error:unauthorized :: Invalid response from https://REDACTED/.well-known/acme-challenge/5IPL3t8frwLl9bJDNAOpZbpoBAQUxRuC9N0ir7Apd2g [212.159.74.45]: 401, url: , Operations to perform:, Apply all migrations: addresses, admin, apps, auth, contenttypes, dns, endpoints, install, sessions, Running migrations:, No migrations to apply., Your models have changes that are not yet reflected in a migration, and so won't be applied., Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them., Looks installed, doing nothing, uwsgi log exists, doing nothing, uwsgi log exists, doing nothing, *** Starting uWSGI 2.0.19.1 (64bit) on [Wed Sep 30 23:58:59 2020] ***, compiled with version: 9.3.0 on 22 September 2020 12:49:07, os: Linux-4.15.0-118-generic #119-Ubuntu SMP Tue Sep 8 12:30:01 UTC 2020, nodename: f7c9a793070b, machine: x86_64, clock source: unix, detected number of CPU cores: 3, current working directory: /, detected binary path: /usr/local/bin/uwsgi, !!! no internal routing support, rebuild with pcre support !!!, uWSGI running as root, you can use --uid/--gid/--chroot options, *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** , *** WARNING: you are running uWSGI without its master process manager ***, your memory page size is 4096 bytes, detected max file descriptor number: 1048576, *** starting uWSGI Emperor ***, Starting ServicesActivating privacy features... 2020/09/30 23:58:59 [INFO] [REDACTED] acme: Obtaining bundled SAN certificate, 2020/09/30 23:58:59 [INFO] [REDACTED] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128188, 2020/09/30 23:58:59 [INFO] [REDACTED] acme: Could not find solver for: tls-alpn-01, 2020/09/30 23:58:59 [INFO] [REDACTED] acme: use http-01 solver, 2020/09/30 23:58:59 [INFO] [REDACTED] acme: Trying to solve HTTP-01, *** has_emperor mode detected (fd: 5) ***, [uWSGI] getting INI configuration from /apps/Tyger2/install/uwsgi.ini, Wed Sep 30 23:59:00 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini has been spawned, Wed Sep 30 23:59:00 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini is ready to accept requests, 2020/09/30 23:59:05 [INFO] Unable to deactivated authorizations: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128188, 2020/09/30 23:59:06 [INFO] [REDACTED] acme: Obtaining bundled SAN certificate, 2020/09/30 23:59:06 [INFO] [REDACTED] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128256, 2020/09/30 23:59:06 [INFO] [REDACTED] acme: Could not find solver for: tls-alpn-01, 2020/09/30 23:59:06 [INFO] [REDACTED] acme: use http-01 solver, 2020/09/30 23:59:06 [INFO] [REDACTED] acme: Trying to solve HTTP-01, 2020/09/30 23:59:13 [INFO] Unable to deactivated authorizations: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128256, 2020/09/30 23:59:14 [INFO] [REDACTED] acme: Obtaining bundled SAN certificate, 2020/09/30 23:59:14 [INFO] [REDACTED] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128319, 2020/09/30 23:59:14 [INFO] [REDACTED] acme: Could not find solver for: tls-alpn-01, 2020/09/30 23:59:14 [INFO] [REDACTED] acme: use http-01 solver, 2020/09/30 23:59:14 [INFO] [REDACTED] acme: Trying to solve HTTP-01, 2020/09/30 23:59:21 [INFO] Unable to deactivated authorizations: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128319, 2020/09/30 23:59:22 [INFO] [REDACTED] acme: Obtaining bundled SAN certificate, 2020/09/30 23:59:22 [INFO] [REDACTED] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128408, 2020/09/30 23:59:22 [INFO] [REDACTED] acme: use tls-alpn-01 solver, 2020/09/30 23:59:22 [INFO] [REDACTED] acme: Trying to solve TLS-ALPN-01, 2020/09/30 23:59:26 [INFO] Unable to deactivated authorizations: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128408, 2020/09/30 23:59:27 [INFO] [REDACTED] acme: Obtaining bundled SAN certificate, 2020/09/30 23:59:27 [INFO] [REDACTED] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128456, 2020/09/30 23:59:27 [INFO] [REDACTED] acme: use tls-alpn-01 solver, 2020/09/30 23:59:27 [INFO] [REDACTED] acme: Trying to solve TLS-ALPN-01, 2020/09/30 23:59:34 [INFO] Unable to deactivated authorizations: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128456, 2020/09/30 23:59:35 [INFO] [REDACTED] acme: Obtaining bundled SAN certificate, 2020/09/30 23:59:36 [INFO] [REDACTED] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/123128533, 2020/09/30 23:59:36 [INFO] [REDACTED] acme: use tls-alpn-01 solver, 2020/09/30 23:59:36 [INFO] [REDACTED] acme: Trying to solve TLS-ALPN-01,```
morph1904 commented 3 years ago

@ksurl I see the issue. A testing version of the Caddyfile.conf was included in the repo and this was causing issues as the domain does not terminate at your IP. I have updated this and I am waiting for the build to complete.

Please can you remove your Container, and clear your data folder/volume, it may also be worth clearing your cached images of any reference to Tyger 2 and recreate your container pulling the latest image. This is essentially a clean install, and you should get the clean caddyfile.

ksurl commented 3 years ago

Thanks. I'll check docker hub for the latest build timestamp before doing a new pull and redeploy from scratch

morph1904 commented 3 years ago

The build has now completed

ksurl commented 3 years ago

this IP should be the private IP right? not public? if my subnet is 192.168.1.0/24 and my host is 192.168.1.10 it should be what is used in the 192.168.1.10:9090/install setup?

morph1904 commented 3 years ago

Yes, Both the frontend and backend services run in the same container. 9090 is the backend, 9091 is the frontend.

ksurl commented 3 years ago

still can't access it.

Log:

(click to expand) ``` Assuming new install, Looks installed, doing nothing, uwsgi log exists, doing nothing, uwsgi log exists, doing nothing, *** Starting uWSGI 2.0.19.1 (64bit) on [Thu Oct 1 14:10:58 2020] ***, compiled with version: 9.3.0 on 01 October 2020 13:57:47, os: Linux-4.15.0-118-generic #119-Ubuntu SMP Tue Sep 8 12:30:01 UTC 2020, nodename: 814c81b76cc2, machine: x86_64, clock source: unix, detected number of CPU cores: 3, current working directory: /, detected binary path: /usr/local/bin/uwsgi, !!! no internal routing support, rebuild with pcre support !!!, uWSGI running as root, you can use --uid/--gid/--chroot options, *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** , *** WARNING: you are running uWSGI without its master process manager ***, your memory page size is 4096 bytes, detected max file descriptor number: 1048576, *** starting uWSGI Emperor ***, *** has_emperor mode detected (fd: 5) ***, [uWSGI] getting INI configuration from /apps/Tyger2/install/uwsgi.ini, Thu Oct 1 14:10:59 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini has been spawned, Thu Oct 1 14:10:59 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini is ready to accept requests, Thu Oct 1 14:11:54 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini is now loyal, Thu Oct 1 14:11:57 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini is now loyal, Thu Oct 1 14:11:58 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini is now loyal, ```
morph1904 commented 3 years ago

OK.

I have just pulled a new version of Tyger2 onto my dev docker host. I use portainer, here is my setup: image

Here is the volume configuration: image

My log looks the same as yours (except it does not show creating the log files, are you sure you deleted your volumes? Have you tried a path bind like mine?):

(click to expand) ``` Assuming new install Looks installed, doing nothing Creating uwsgi.log Creating uwsgi-access.log *** Starting uWSGI 2.0.19.1 (64bit) on [Thu Oct 1 15:20:19 2020] *** compiled with version: 9.3.0 on 01 October 2020 13:57:47 os: Linux-5.8.0-20-generic #21-Ubuntu SMP Wed Sep 23 00:39:43 UTC 2020 nodename: 3caa4cef708b machine: x86_64 clock source: unix detected number of CPU cores: 4 current working directory: / detected binary path: /usr/local/bin/uwsgi !!! no internal routing support, rebuild with pcre support !!! uWSGI running as root, you can use --uid/--gid/--chroot options *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** *** WARNING: you are running uWSGI without its master process manager *** your memory page size is 4096 bytes detected max file descriptor number: 1048576 *** starting uWSGI Emperor *** Starting ServicesActivating privacy features... done. Serving HTTP on port 9091 http://:9091/api  http://:9091 *** has_emperor mode detected (fd: 5) *** [uWSGI] getting INI configuration from /apps/Tyger2/install/uwsgi.ini Thu Oct 1 15:20:20 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini has been spawned Thu Oct 1 15:20:20 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini is ready to accept requests ```

This is my install screen (note how I have filled it out and the URL): image

This was successful: image

Clicking the link on the success page then brings me to the login: image

Once logged in I see the main app: image

My logs are unchanged at this point (correctly so).

Also, these are the permissions set on my paths: image

Is there any more information that you can provide that would help me assist you? What issue are you getting accessing the http://:9091 address? What error are you receiving?

ksurl commented 3 years ago

same permissions, owned by root, readable by group/other. browser error is site can't be reached, server refused to connect. using nc to check port opening, it is not listening on 9091, only 9090. let me try creating the container manually in portainer instead of using a stack. though it shouldn't make a difference.

ksurl commented 3 years ago

I redeployed after deleting volumes and it is working. very odd.

morph1904 commented 3 years ago

I think it was still using the data from your volume with the duff caddyfile. Once the file is created Tyger tries to re-use it. If it is missing it generates a new one.

Caddy actually serves the frontend in this version of TygerCaddy (a design flaw on my part that is rectified in the new version) so if the caddyfile is rubbish, the frontend becomes unavailble as Caddy is not working correctly and so can not serve the frontend.

derilium commented 3 years ago

Did you get this working on a default install on ubuntu 18, i ran through the process, configured through the web portal but then cant access it by port 9091 - unable to connect

On Thu, 1 Oct 2020 at 16:50, morph1904 notifications@github.com wrote:

I think it was still using the data from your volume with the duff caddyfile. Once the file is created Tyger tries to re-use it. If it is missing it generates a new one.

Caddy actually serves the frontend in this version of TygerCaddy (a design flaw on my part that is rectified in the new version) so if the caddyfile is rubbish, the frontend becomes unavailble as Caddy is not working correctly and so can not serve the frontend.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/morph1904/Tyger2/issues/28#issuecomment-702228647, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFA43DVTEQPFXS3YTSZG7RDSISQOFANCNFSM4PNYPN5A .

morph1904 commented 3 years ago

Hi @derilium,

The Ubuntu installer script is not installing Caddy correctly on this version of TygerCaddy and as I am very close to releasing a completely new version based on the updated Caddy 2 platform, there is little point in fixing this issue as the majority of users are using docker.

The installer script is broken as the team at Caddy have recently moved to a completely rebuilt version of Caddy

I would recommend either installing docker on your ubuntu server, and following the docker install steps (this should be very straightforward and the screenshots above should help). Or, you could assist with the testing of the latest version of TygerCaddy (also docker based) which does away with Python, uWSGI, and Caddy V1 altogether and is so far reportedly very stable with the current testers.

morph1904 commented 3 years ago

Closing Issue.

Pull request is welcome, however not looking to fix this currently. The latest version will be docker first and has been very successful during testing.