hi all,
so i got one step further and my docker setup is serving my trac instance
now but it doesnt really solve the underlaying problem :(
so what i did is
- figure out the ip of the container
- changed my uri string in traci.ini so it uses the ip and not the docker
container name
at this point my data started to get loaded but as i said this doesnt solve
the problem, i want to be able to use a hostname for obvious reasons.
So how do i make trac aware that it needs to resolve my container name
correctly? I mean for my simply testscript its not a problem but trac cant
do it,
i hope we get something to work here.
here is my simply script that works just as expected ...
import psycopg2
conn = psycopg2.connect(
"postgres://dbuser:dbpassword@trac-postgresql:5432/trac_db"
)
cur = conn.cursor()
cur.execute("SELECT * FROM ticket;")
rows = cur.fetchall()
for row in rows:
print(row)
cheers
MArkus
Am Mi., 3. Mai 2023 um 19:55 Uhr schrieb Markus Rosjat <
[email protected]>:
> hey scott,
>
> i have a docker compose file but my tracd command doesnt seems to work,
> if i run int with -d flag the container restarts all the time.
> Do i run the tracd command without it i get the line i posted so i am
> stuck at the point where both container work, i can access the db from trac
> container over simply python but running tracd doesnt seem to like the
> connection
>
> cheers
>
> Markus
>
> Am Mi., 3. Mai 2023 um 19:27 Uhr schrieb Scott Dunt <[email protected]>:
>
>> I did it with mysql, but used a docker-compose file to create a network
>> and make sure both containers shared the same network:
>> version: "3"
>> services:
>>
>> TracDB:
>> image: mysql:5.7
>> restart: always
>> environment:
>> MYSQL_ROOT_PASSWORD: pass
>> MYSQL_DATABASE: trac
>> MYSQL_USER: tracuser
>> MYSQL_PASSWORD: pass
>> ports:
>> - "3306:3306"
>> command: --character-set-server=utf8 --collation-server=utf8_bin
>> networks:
>> - TracNet
>>
>> Trac:
>> image: <your docker repos>/trac:latest
>> restart: always
>> volumes:
>> # Mount the data migrated here after'trac-admin /var/trac/ hotcopy
>> /home/ubuntu/TracBackup':
>> - /home/ec2-user/Trac/TracBackup/:/var/trac/<sitename>/
>> #Had to migrate to MySQL, so 1st launch of trac container had to run this
>> command line
>> # command : sh -c "sleep 5 && trac-admin /var/trac/<sitename>/ convert_db
>> "mysql://tracuser:password@TracDB:3306/trac"
>> ports:
>> - "8088:80"
>> depends_on:
>> - TracDB
>> networks:
>> - TracNet
>>
>> networks:
>> TracNet:
>>
>> On Wednesday, May 3, 2023 at 7:44:29 AM UTC-5 Markus Rosjat wrote:
>>
>>> hi all,
>>>
>>> i try to play around a little and hit a bump in the road with using 2
>>> containers formy setup. I got one container for trac and one container for
>>> postgresql. So far so good, if i try to connect with python from trac
>>> container to the postgresql one i can query data as expected but if i try
>>> to run tracd it tells me it can connect to the db ... here is my pseudo
>>> connection string in my trac.ini
>>>
>>> database = postgres://dbuser:dbpassword@dockercontainer:5432/tracdb
>>>
>>> as i said if i pass that to psycopg2.connect as proper args i can get a
>>> cursor and fetch data. If i try to do it with trac i get
>>>
>>> Trac Error
>>>
>>> TracError: Unable to check for upgrade of trac.db.api.DatabaseManager:
>>> TimeoutError: Unable to get database connection within 10 seconds.
>>>
>>> So any pointers here would be nice.
>>>
>>> cheers
>>>
>>> MArkus
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Trac Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/trac-users/d047a9c0-cdb5-48be-a18c-3ea650cc3f47n%40googlegroups.com
>> <https://groups.google.com/d/msgid/trac-users/d047a9c0-cdb5-48be-a18c-3ea650cc3f47n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/trac-users/CAJ4osOkvMBMECtqPzHnD%3DogyG8ta-OnvJn4dwKgivR-sh8O0Vg%40mail.gmail.com.