Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'm not able to use MySQL instead of PostgreSQL #19

Open
TheLux83 opened this issue Oct 19, 2017 · 5 comments
Open

I'm not able to use MySQL instead of PostgreSQL #19

TheLux83 opened this issue Oct 19, 2017 · 5 comments

Comments

@TheLux83
Copy link

Hey there,

since I have a MySQL instance running, I wanted to switch my TTRSS Container to this database.
I've configured a Database, a Username and Password and inserted the ENV DB_TYPE=mysql to my Docker-Compose File.
Unfortunately it won't let me use a MySQL Database and ist constantly trying to find a Postgre Database.

Here is the output from starting the container:


ttrss    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
ttrss    | [s6-init] ensuring user provided files have correct perms...exited 0.
ttrss    | [fix-attrs.d] applying ownership & permissions fixes...
ttrss    | [fix-attrs.d] done.
ttrss    | [cont-init.d] executing container initialization scripts...
ttrss    | [cont-init.d] 50-php: executing...
ttrss    | rm: can't remove '/usr/sbin/php-fpm': No such file or directory
ttrss    | [cont-init.d] 50-php: exited 0.
ttrss    | [cont-init.d] 98-wait-for-db: executing...
ttrss    | Checking database responds within 1s on :5432...
ttrss    | Error: you need to provide a host and port to test.
ttrss    | Usage:
ttrss    |    host:port [-t timeout] [-- command args]
ttrss    |   -q | --quiet                        Do not output any status messages
ttrss    |   -t TIMEOUT | --timeout=timeout      Timeout in seconds, zero for no timeout
ttrss    |   -- COMMAND ARGS                     Execute command with args after the test finishes
ttrss    | [cont-init.d] 98-wait-for-db: exited 2.
ttrss    | [cont-init.d] 99-ttrss: executing...
ttrss    | Setup: !!! WARNING - No encryption (TLS) used - WARNING    !!!
ttrss    | Setup: !!! This is not recommended for a production server !!!
ttrss    | Setup:                You have been warned.
ttrss    | Setup: Setting up Tiny Tiny RSS (latest revision) ...
ttrss    | Cloning into '/var/www/ttrss'...
ttrss    | Cloning into '/var/www/ttrss/plugins/mobilize'...
ttrss    | Cloning into '/var/www/ttrss/plugins/feediron'...
ttrss    | Cloning into '/var/www/ttrss/themes/feedly-git'...
ttrss    | Setup: URL is: <URL PAth>
ttrss    | Setup: Additional plugins:
ttrss    | Setup: Database
ttrss    | Configuring database for: /var/www/ttrss/config.php
ttrss    | Error: The env DB_PORT does not exist. Make sure to run with "--link mypostgresinstance:DB"
ttrss    | Error: The env DB_PORT does not exist. Make sure to run with "--link mypostgresinstance:DB"
ttrss    | Setup: Applying updates ...
ttrss    | Updating: Tiny Tiny RSS
ttrss    | fatal: unable to access 'https://git.tt-rss.org/git/tt-rss.git/': The requested URL returned error: 503
ttrss    | Updating: Mobilize plugin
[...]
ttrss    | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused
ttrss    |      Is the server running on host "localhost" (127.0.0.1) and accepting
ttrss    |      TCP/IP connections on port 5432?
ttrss    | could not connect to server: Address not available
ttrss    |      Is the server running on host "localhost" (::1) and accepting
ttrss    |      TCP/IP connections on port 5432? in /var/www/ttrss/classes/db/pgsql.php on line 21
ttrss    | PHP Warning:  pg_last_error(): No PostgreSQL link opened yet in /var/www/ttrss/classes/db/pgsql.php on line 24
ttrss    | PHP Warning:  pg_last_error(): supplied resource is not a valid PostgreSQL link resource in /var/www/ttrss/classes/db/pgsql.php on line 24
ttrss    | Unable to connect to database (as fox to localhost, database fox):[09:01:57/348] Spawn interval: 120 sec
ttrss    | Unable to connect to database (as fox to localhost, database fox):PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Con
nection refused
ttrss    |      Is the server running on host "localhost" (127.0.0.1) and accepting
ttrss    |      TCP/IP connections on port 5432?
ttrss    | could not connect to server: Address not available
ttrss    |      Is the server running on host "localhost" (::1) and accepting
ttrss    |      TCP/IP connections on port 5432? in /var/www/ttrss/classes/db/pgsql.php on line 21
ttrss    | PHP Warning:  pg_last_error(): No PostgreSQL link opened yet in /var/www/ttrss/classes/db/pgsql.php on line 24
ttrss    | PHP Warning:  pg_last_error(): supplied resource is not a valid PostgreSQL link resource in /var/www/ttrss/classes/db/pgsql.php on line 24
ttrss    | [09:01:58/351] Spawn interval: 120 sec
ttrss    | Unable to connect to database (as fox to localhost, database fox):PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Con
nection refused
ttrss    |      Is the server running on host "localhost" (127.0.0.1) and accepting
ttrss    |      TCP/IP connections on port 5432?
ttrss    | could not connect to server: Address not available
ttrss    |      Is the server running on host "localhost" (::1) and accepting
ttrss    |      TCP/IP connections on port 5432? in /var/www/ttrss/classes/db/pgsql.php on line 21
ttrss    | PHP Warning:  pg_last_error(): No PostgreSQL link opened yet in /var/www/ttrss/classes/db/pgsql.php on line 24
ttrss    | PHP Warning:  pg_last_error(): supplied resource is not a valid PostgreSQL link resource in /var/www/ttrss/classes/db/pgsql.php on line 24
Gracefully stopping... (press Ctrl+C again to force)

My Docker-Compose File looks like this:

version: '2'

services:
  ttrss:
    image: x86dev/docker-ttrss
    container_name: ttrss
    ports:
      - "<OutsidePort>:8080"
    environment:
      VIRTUAL_HOST: <VirtualHostName>
      VIRTUAL_PORT: 8080
      SELF_URL_PATH: <self Url Path>
      TTRSS_SELF_URL: <self Url Path>
      TTRSS_PROTO: http
      TTRSS_URL: <Url Path>
      DB_TYPE: mysql
      DB_NAME: ttrss
      DB_USER: ttrss
      DB_PASS: <super secret password>
    external_links:
      - mysql:db

Is there something wrong with my setup?

@bobberb
Copy link

bobberb commented Oct 20, 2017

This is the same as #7 as noted, there is a default to username fox password fox that I am yet unable to change.

@jpbaril
Copy link

jpbaril commented Jan 10, 2018

I'm also trying to use this docker-ttrss with the help of a docker-compose file.
@TheLux83 did have success with your file ? I will stay with postgres but would use your file as a base as I'm still learning Docker.
Thanks.

@TheLux83
Copy link
Author

Hey @jpbaril
unfortunately no. I'm still using the Postgres Database only for TTRSS. I've given up on this case, since it works without any problems :) I'm sorry that I cannot help you.

@jpbaril
Copy link

jpbaril commented Jan 21, 2018

I found the source of the problem that prevented me using a docker-compose file: #25
The solution would be easy to implement, but for now I use a workaround as explained in the issue.

@appleftg
Copy link

appleftg commented Dec 2, 2018

See root/srv/ttrss-configure-db.php for exactly what's going on.

docker run --rm --name ttrss
--network dnmp_default \ #mysql network
-v /home/ft/docker/ttrss:/var/www
-e TTRSS_SELF_URL=http://domain.com:8088/
-e SELF_URL_PATH=http://domain.com:8088/
-e TTRSS_PORT=8080
-e DB_PORT_3306_TCP_ADDR=mysql
-e DB_PORT_3306_TCP_PORT=3306
-e DB_TYPE=mysql
-e DB_HOST=mysql
-e DB_PORT=3306
-e DB_NAME=ttrss
-e DB_USER=root
-e DB_PASS=password
-p 8088:8080
x86dev/docker-ttrss

its working for me this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants