Tryton for Dummies

Thank you for trying. I got the docker container to run and was able to launch the web page. The login dialogue appeared but I am missing the database/Source and therefore I am unable to login to anything.

Hi @ama,

so I guess, you follow our Tryton / Tryton Docker · GitLab guide or the complete docker guide.

when you initialized the database the default database name is tryton (coming from the -d option). So just use tryton as database, if you didn’t change it. The user is always admin and the password (and email address) were prompted while initialize the database. HIH

Happy new year udono,

I lost track whether I initialzed the dB or not from having tried many things many ways. the one thing I am sure of is when I launched the web page of the running docker container I was prompted for the user name and the field above it for the DB was empty. I did lookup the guide on docker and it was a here we go again with commands of which either returned an error or told me to go fish. There were 3 images. I pulled them all and was able to only use one of them. I figured the docker image will have it all loaded but that was not the case. I am probably going to look at other open ERPs of which aren’t so involved to deploy for a novice like me. I have a mixed physical and Virtual windows environment and need more versatile system that can run on anything. Thank you for taking the time to help out.

Hi ama, happy new year!

Can you please paste the command and the errors you got in a message?

This sentence I don’t understand.

3 posts were split to a new topic: Upgrading a neso 3.8 deployment

@ama, Thanks for still being around here, even you have a hard time to get Tryton running!

I assume that you are running Windows and trying to install Tryton. It can be a bit hard, but there are several posts here on the forum which hopefully will help you.

I have some posts, I linked to the solutions but it will be good to read the whole discussion to get the idea:

And maybe other discussions will help as well, see https://discuss.tryton.org/search?q=install%20on%20windows

If you want to run Docker, see https://discuss.tryton.org/t/how-to-run-tryton-using-docker

Hopefully this will guide you in the right direction!

Thanks Edbo! I don’t like to loose to a piece of software. I know I will eventually make it work. I do not like command prompt and that is my biggest problem. I will go through your suggestions and hope to make it work. I will resort to Ubuntu other wise. Stay tuned :sweat_smile:

2 Likes

@udono It’s an idiom that means “it wasn’t going to help and to go and sort it out for myself”.

hang tight guys, I am loading Ubuntu on my labrat and will give it another chance despite command prompt. :sweat_smile:

Success so far:
1- installed ubuntu 22.04
2- Installed Python 3, PostgreSQL and PIP
3- Ran the server install command and it actually worked this time
4- The confusion with the installation page begins here: Do you go to the next page (configuration file for Tryton) or Install the Modules?

I recommend to follow https://discuss.tryton.org/t/install-tryton-in-a-python-virtual-environment-on-ubuntu. It’s a step-by-step guide and shows the way I’m installing Tryton and is way more detailed and specific.

Generally, let’s first get everything working before installing the modules. Because installing the modules is not complicated once you have the base system running.

Great! Thank you. I will follow it and let you know.

Jan 05 14:17:56 Tryton-Sandbox systemd[1]: Starting PostgreSQL RDBMS…
Jan 05 14:17:56 Tryton-Sandbox systemd[1]: Finished PostgreSQL RDBMS.
I am stuck at this point
image
How long should I expect it to go for? is it actually building a db or am i missing something?

@ama , you need to give more context. just copy and paste the text from the commandline here, it is much better than taking a screenshot, also it can be indexed.

If you want help you need to provide what command you rand, and what the results are with a bit more context.

This picture looks like the text is shown within some pager (“more”, “less”). Pressing q might help.

Thank you all for your support and willingness to help out. I succeeded in Installing the server on Ubuntu 22.04. Administration and actual testing are on next. I will post my step by step instructions that made it happen for me soon. Once again, Thank you!

This is good news!

For the aspect of maintainability, it would be better when you correct or append the existing documentation.

Hello,
After all I decided to give up on the first attempt and went for the Docker Image. That was much smoother and installed like a charm. My issue now is *how to connect the instance running to an external DB? I can’t have the database be running as an instance because if the PC goes down, it is all gone. Thank you in advance for your reply.

You need to set the following environment variables on the docker container:

  • DB_USER
  • DB_PASSWORD
  • DB_HOSTNAME
  • DB_PORT

If you use a volume for the postgres data you won’t lose anything.

Hi Pokoli,
Thank you for your suggestion. I got a little help from a friend and was able to make a few changes to the set up and made it happen. I however am stumped because of the inability to access the DB.

Here is some screen shots:
Running instances
:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fe76dc97b5cb tryton/tryton “/entrypoint.sh guni…” 3 days ago Up 3 days 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp tryton
63d86a4b665b postgres “docker-entrypoint.s…” 3 days ago Up 3 days 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp tryton-postgres

image
using localhost:8000 doesn’t get me far because there is no DB selection in the dropdown menu. I have 2 DBs running as you may be able see here:


What am I missing or haven’t done?

below is a run down of how i got all this to work so far:
Links used:

https://hub.docker.com/r/tryton/tryton

1- Clean Ubuntu Install

2- Update install using : sudo apt-get update

3- install docker using: sudo apt install docker.io then answer Y when prompted

4- Create the docker group.
sudo groupadd docker

  • Add your user to the docker group.
    sudo usermod -aG docker $USER

* Log out and log back in so that your group membership is re-evaluated.

> If you're running Linux in a virtual machine, it may be necessary to restart the virtual machine for changes to take effect.

You can also run the following command to activate the changes to groups:
newgrp docker

* Verify that you can run `docker` commands without `sudo`.
docker run hello-world

This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.

5- Download Tryton: docker pull tryton/tryton

6- Start a PostgreSQL instance:

docker run --name tryton-postgres -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_DB=tryton -d postgres

7- Setup the Database:

docker run --link tryton-postgres:postgres -e DB_PASSWORD=mysecretpassword -it tryton/tryton trytond-admin -d tryton --all

8- Enter admin email for tryton: email of choice
9- Enter 
a password for the tryton admin: ```
10- Start a Tryton Instance:
docker run --name tryton -p 8000:8000 --link tryton-postgres:postgres -e DB_PASSWORD=mysecretpassword -d tryton/tryton

11- Access Tryton using the URL: 
http://localhost:8000
12- To Check on Running Containers, run:
docker ps


The following is PGadmin4 installation steps:

1- Install curl:

sudo snap install curl # version 8.1.2

2- Setup the repository

A- Install the public key for the repository (if not done previously):

curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg

B -Create the repository configuration file:

sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/packages-pgadmin- org.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'

3- Install pgAdmin

# Install for both desktop and web modes:

sudo apt install pgadmin4

# Install for desktop mode only:

sudo apt install pgadmin4-desktop

# Install for web mode only:

sudo apt install pgadmin4-web

# Configure the webserver, if you installed pgadmin4-web:

sudo /usr/pgadmin4/bin/setup-web.sh

Enter the email address and password to use for the initial pgAdmin user account:
pgAdmin 4 - Application Initialisation

======================================

Creating storage and log directories...

We can now configure the Apache Web server for you. This involves enabling the wsgi module and configuring the pgAdmin 4 application to mount at /pgadmin4. Do you wish to continue (y/n)? y

The Apache web server is running and must be restarted for the pgAdmin 4 installation to complete. Continue (y/n)? y

Apache successfully restarted. You can now start using pgAdmin 4 in web mode at **http://127.0.0.1/pgadmin4**

-------------------------------------------------------------------------------


The command below is how we managed to connect Tryton to an external database.

To start the docker container and mount the data, logs, and configuration:

**docker run --name tryton-postgres -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_DB=tryton -d -v /home/ama/postgres-conf:/etc/postgresql -v /home/ama/postgres-data/data:/var/lib/postgresql/data -v postgres-logs:/var/log/postgresql -p 5432:5432 postgres*

ALTER ROLE

Important: we did couple of things to get the docker volume mount to work:

1- we changed the postgres user and group IDs to 999, to align the postgres user and group on the host to the one in the container.

2- We created /home/ama/postgres-data/data on localhost, chnaged its ownership to postgres:postgres, and mounted /home/ama/postgres-data/data.

3- We changed the ownership of /home/ama/postgres-data, /home/ama/postgres-conf, and /home/ama/postgres-logs to postgres:postgres.


I hope you can guide me to the next step. Thank you!