morph1904 / Tyger2

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

Can not install on Portainer (Looks installed, doing nothing) #21

Closed bugs181 closed 4 years ago

bugs181 commented 4 years ago

Having an issue reaching the /install page. Logs say that it already looks installed. I've recreated this issue several times, even after removing the data directory. I can still reach the login page but never the install page.

In my compose file I had to change to version 2 because Portainer complained that version 3 was not supported yet.

Compose file ``` version: "2" services: Tyger2Beta: image: morph1904/tyger2:beta container_name: caddy volumes: - /home/docker/caddy/data:/apps/Tyger2/data - /home/docker/caddy/data/certs:/root/.caddy ports: - 443:443 - 80:80 - 9090:9090 - 9091:9091 restart: unless-stopped ```
Log ``` Assuming new install, Creating uwsgi.log, touch: /apps/Tyger2/data/logs/uwsgi.log: No such file or directory, Creating uwsgi-access.log, touch: /apps/Tyger2/data/logs/uwsgi-access.log: No such file or directory, *** Starting uWSGI 2.0.18 (64bit) on [Thu May 21 04:49:03 2020] ***, compiled with version: 9.2.0 on 08 April 2020 20:32:14, os: Linux-5.4.0-0.bpo.4-amd64 #1 SMP Debian 5.4.19-1~bpo10+1 (2020-03-09), nodename: 5a51bbabe1fb, machine: x86_64, clock source: unix, detected number of CPU cores: 20, 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., 2020/05/21 04:49:03 open /apps/Tyger2/data/logs/frontend.log: no such file or directory, Assuming new install, Looks installed, doing nothing, Creating uwsgi.log, touch: /apps/Tyger2/data/logs/uwsgi.log: No such file or directory, Creating uwsgi-access.log, touch: /apps/Tyger2/data/logs/uwsgi-access.log: No such file or directory, *** Starting uWSGI 2.0.18 (64bit) on [Thu May 21 04:49:05 2020] ***, compiled with version: 9.2.0 on 08 April 2020 20:32:14, os: Linux-5.4.0-0.bpo.4-amd64 #1 SMP Debian 5.4.19-1~bpo10+1 (2020-03-09), nodename: 5a51bbabe1fb, machine: x86_64, clock source: unix, detected number of CPU cores: 20, 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 May 21 04:49:06 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini has been spawned, Thu May 21 04:49:06 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini is ready to accept requests, ```
morph1904 commented 4 years ago

Hi there.

When you try to reach the install page at http://:9090/install what issue are you getting? The looks installed message is the start script that places the initial caddyfile etc in your data directory.

bugs181 commented 4 years ago

Apologies for not getting back sooner. The install page just does not load. 301 error.

$ curl http://10.0.1.101:9090/install -v
*   Trying 10.0.1.101...
* TCP_NODELAY set
* Connected to 10.0.1.101 (10.0.1.101) port 9090 (#0)
> GET /install HTTP/1.1
> Host: 10.0.1.101:9090
> User-Agent: curl/7.54.0
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Content-Type: text/html; charset=utf-8
< Location: /install/
< Content-Length: 0
< Vary: Origin
< X-Content-Type-Options: nosniff
< 
* Connection #0 to host 10.0.1.101 left intact

I'm able to recreate the issue on a cloned VM and brand new docker install. Everything else works as intended.

bugs181 commented 4 years ago

Bump. Is there any more information I can provide? If so, please give instructions.

morph1904 commented 4 years ago

Hi Bugs, sorry for the delay in getting back to you. Life is a but weird at the moment wit COVID.

I will attempt to replicate with a fresh ubuntu install with docker and portainer in about an hour and reply here.

In the meantime are you able to post the contents of the caddyfile from the data directory?

morph1904 commented 4 years ago

Hi Bugs,

So I have a clean ubuntu 20.04 install with a clean docker install. I set up a data directory, installed portainer, and then copied your dockerfile in your first post. I modified the paths to match my machine and created the stack.

Here is my dockerfile:

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

The stack was created without issue.

Portainer Log ``` Assuming new install touch: /apps/Tyger2/data/logs/uwsgi.log: No such file or directory Creating uwsgi.log Creating uwsgi-access.log touch: /apps/Tyger2/data/logs/uwsgi-access.log: No such file or directory *** Starting uWSGI 2.0.18 (64bit) on [Tue Jun 2 07:54:29 2020] *** compiled with version: 9.2.0 on 08 April 2020 20:32:14 os: Linux-5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 nodename: 6d6918da578c 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. 2020/06/02 07:54:29 open /apps/Tyger2/data/logs/frontend.log: no such file or directory touch: /apps/Tyger2/data/logs/uwsgi.log: No such file or directory touch: /apps/Tyger2/data/logs/uwsgi-access.log: No such file or directory Assuming new install Looks installed, doing nothing Creating uwsgi.log Creating uwsgi-access.log *** Starting uWSGI 2.0.18 (64bit) on [Tue Jun 2 07:54:30 2020] *** compiled with version: 9.2.0 on 08 April 2020 20:32:14 os: Linux-5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 nodename: 6d6918da578c 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. 2020/06/02 07:54:30 open /apps/Tyger2/data/logs/frontend.log: no such file or directory Assuming new install Looks installed, doing nothing Creating uwsgi.log Creating uwsgi-access.log *** Starting uWSGI 2.0.18 (64bit) on [Tue Jun 2 07:54:31 2020] *** compiled with version: 9.2.0 on 08 April 2020 20:32:14 os: Linux-5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 nodename: 6d6918da578c 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 Tue Jun 2 07:54:32 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini has been spawned Tue Jun 2 07:54:32 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini is ready to accept requests Tue Jun 2 07:55:26 2020 - [emperor] vassal /apps/Tyger2/install/uwsgi.ini is now loyal ```

I am able to access the installer page in my browser with:

http://10.10.200.73:9090/install/

The IP in the URL above is the LAN IP of my temp testing docker VM.

I also get a 301 redirect when using Curl to get the install however instructing curl to follow the redirect with the -L flag returns the install page successfully.

curl -v http://10.10.200.73:9090/install ``` Trying 10.10.200.73:9090... * TCP_NODELAY set * Connected to 10.10.200.73 (10.10.200.73) port 9090 (#0) > GET /install HTTP/1.1 > Host: 10.10.200.73:9090 > User-Agent: curl/7.68.0 > Accept: */* > * Mark bundle as not supporting multiuse < HTTP/1.1 301 Moved Permanently < Content-Type: text/html; charset=utf-8 < Location: /install/ < Content-Length: 0 < Vary: Origin < X-Content-Type-Options: nosniff < * Connection #0 to host 10.10.200.73 left intact ```
curl -L http://10.10.200.73:9090/install (sample) ``` Tyger2 Installer