Eugeny / tabby-web

Tabby Web - an SSH/Telnet/Serial client in your browser.
https://tabby.sh
MIT License
881 stars 128 forks source link

"Table 'tabby.app_user' doesn't exist" #119

Open alwayslikethis777 opened 9 months ago

alwayslikethis777 commented 9 months ago

Use the default Docker Compose.yml file without any modifications

image

ency98 commented 9 months ago

I ran into the same issue.

When running the docker-compose file I noticed that the tabby-web container was not able to connect to the DB server.

I don't think the DB server was created or even running when the tabby web server went through its setup.

The fix I came up with was to create a docker compose for the DB server and remove that section from the docker-compose file for the tabby-web server.

I the started up the DB server and then the web server.

my setup looks something like this

docker

Start order

  1. tabby-db docker-compose.yml
  2. tabby-web docker-compose.yml
  3. tabby-connection-gateway docker-compose.yml

Here are the sanitized versions of the docker-compose.yml files.

tabby-db docker-compose.yml

services:
    db:
        image: mariadb:10.7.1
        restart: always
        environment:
            MARIADB_DATABASE: tabby
            MARIADB_USER: user
            MARIADB_PASSWORD: 123
            MYSQL_ROOT_PASSWORD: 123

tabby-web docker-compose.yml

services:
    tabby:
        build: .
        restart: always
        depends_on:
        - db
        ports:
        - 9090:80
        environment:
        - DATABASE_URL=mysql://root:123@IP/tabby
        - PORT=80
        - DEBUG=False
        - DOCKERIZE_ARGS="-wait tcp://db:3306 -timeout 60s"
        - SOCIAL_AUTH_GITHUB_KEY="XXX"
        - SOCIAL_AUTH_GITHUB_SECRET="YYY"

tabby-connection-gateway docker-compose.yml

services:
    eugeny:
        command: --token-auth --host 0.0.0.0 
        environment:
            - TABBY_AUTH_TOKEN="SuperSecretPassword"
        ports:
            - 9000:9000
        image: 'ghcr.io/eugeny/tabby-connection-gateway:master'

Having done all that to get the containers up and going I still cant make it work.

I think my issue is connecting tabby-web to the tabby-connection-gateway

when setting up the Connection Gateway I have tried

ws://IP:9000 < invalid - An insecure WebSocket connection may not be initiated from a page loaded over HTTPS wss://IP:9000 < timeout

I don't see anything in the tabby-connection-gateway or tabby-web logs using " docker logs --follow "

ency98 commented 9 months ago

Well I give up.

I blew away the directories and started over. I discovered if you run the tabby-web docker-compose.yml the stop it, then run it again the DB issue gets sorted out.

But now the oauth isn't working at all. The call back url, secrets, and client ID have not changed it just sends me to a github 404 page once I authenticate.

Dmtrkozl commented 9 months ago

Hello, change services order: services: db: image: mariadb:10.7.1 restart: always environment: MARIADB_DATABASE: tabby MARIADB_USER: user MARIADB_PASSWORD: 123 MYSQL_ROOT_PASSWORD: 123 tabby: build: . restart: always depends_on:

Satone7 commented 9 months ago

I just encountered and resolved this issue. By observing the first line of output from the tabby container, one can notice this error:

tabby-1  | 2024/02/16 06:02:54 Error starting command: `"-wait` - exec: "\"-wait": executable file not found in $PATH

It is evident that the issue was caused by the " symbol. Therefore, by modifying the docker-compose.yml file's source code from

DOCKERIZE_ARGS="-wait tcp://db:3306 -timeout 60s"

to

DOCKERIZE_ARGS=-wait tcp://db:3306 -timeout 60s

the issue can be resolved, and one can successfully access the webpage.

However, upon further consideration, it becomes apparent that this error will occur in the webpage as long as the tabby container does not successfully connect to the db. Therefore, the reason you encountered this error might be different from mine. You can try the above solution or carefully analyze the log of the tabby container to find the real cause of the error. Wishing you good luck.

Dmtrkozl commented 9 months ago

@Satone7 Please, tell me. Does telnet work in your installation?

r2munz commented 5 months ago

I just encountered and resolved this issue. By observing the first line of output from the tabby container, one can notice this error:

tabby-1  | 2024/02/16 06:02:54 Error starting command: `"-wait` - exec: "\"-wait": executable file not found in $PATH

It is evident that the issue was caused by the " symbol. Therefore, by modifying the docker-compose.yml file's source code from

DOCKERIZE_ARGS="-wait tcp://db:3306 -timeout 60s"

to

DOCKERIZE_ARGS=-wait tcp://db:3306 -timeout 60s

the issue can be resolved, and one can successfully access the webpage.

However, upon further consideration, it becomes apparent that this error will occur in the webpage as long as the tabby container does not successfully connect to the db. Therefore, the reason you encountered this error might be different from mine. You can try the above solution or carefully analyze the log of the tabby container to find the real cause of the error. Wishing you good luck.

This should be succested as PR