Michael Norton's picture

Tried the oDoo appliance in both the VM and ISO versions in VirtualBox.  Couldn't get either to accept the initial "create oDoo database" wizard.  Attached is a snapshot of the error.

Forum: 
Tags: 
Jeremy Davis's picture

So you can log into the default "master admin" account ok? But once logged in you can't create a new DB? Is that right?

TBH I'm not that familiar with Odoo nor did I do much work on this particular appliance. But assuming I understand right, maybe the DB user permissions are not being quite right? You should be able to manually tweak them in Adminer (log in via https on port 12322 using the "postgres" user and the password you configured on firstboot).

Also for future reference all the images are built from the ISOs. Some of the other build types have more substantial changes, but the OVA and VMDK are essentially just a vHDD of the ISO installed. So if the OVA imports ok, but then doesn't work, there is a good chance that the ISO won't either (and vice versa). Unless of course your download is corrupt. You can check that by comparing a hash of your download against the relevant sig file.

Michael Norton's picture

Hi Jeremy,

I don't think it's a corrupt download as I tried it from two different computers and two downloads.

I'm able to run the installer (ISO) or start the machine (VM) and set the initial passwords, then bring the machine up to the shell.  Accessing the oDoo website for first login works, which requires creating the database for first use.  That's where every attempt to create the database fails.  I tried every combination of my preset password and the default "admin" password, to no avail.

It's almost like the initial passwords are being set for root and postgres ok, but the additional password for oDoo admin is not?

Thanks,

Michael

Jeremy Davis's picture

I'll download it and see what I can see...
Jeremy Davis's picture

This dropped off my radar. I'll look into it asap for you.
Jeremy Davis's picture

Although I did find discover a different issue (Odoo service not starting reliably inside a container). But that shouldn't be a problem inside virtualbox (non container builds use SystemD initsystem and that was well tested).

But once I got that working then it all worked as it should...

I will now test for an ISO install just to be sure...

Jeremy Davis's picture

I installed from ISO this time and I can reproduce the issue exactly as you state it...

I'll have a fiddle and see if I can work out what is going on.

[update] Ok I'm not sure why but I just reran the initial Odoo initscript and reset my Odoo master password and then restarted Odoo. After that it worked as expected...

/usr/lib/inithooks/bin/odoo.py
service openerp-server restart
L. Arnold's picture

Today, after pulling up a new server with snapshot via hub.turnkeylinux.org  the system loaded and I could log into Odoo and SSH and WEBMIN.  
However, I was not able via the Odoo Database Manager to backup or instagate new Databases.

I the ran turnkey-init resetting passwords to those I had on record.  Still no response with Odoo Database Manager.
I then ran, as outlined above

/usr/lib/inithooks/bin/odoo.py

and got the error "Turnkeylinux-Example" does not exist. 

Normally one would delete that database and build a new database as I did, but the Odoo Database Password which gets set in odoo.conf should be able to reset.

either
(admin_passwd = (encrypted somehow)

or
db_password = (encrypted somehow but different)

/etc/odoo/odoo.conf

I did also restart odoo.service in Webmin, which was a recent possible solution.

This is a rather large problem...  Is there a way we can get this to work.  Need to be able to control Databases via the normal way.

(URL)/web/database/manager

Thoughts on how to fix?  

Jeremy Davis's picture

You raise a good point Landis. There may be scenarios where you might need to reset the "Master" password, after you've removed the example DB.

I've had a look at removing the hard requirement of the default example DB existing. You can find that here: https://github.com/JedMeister/odoo/blob/tweak-inithook/overlay/usr/lib/inithooks/bin/odoo.py.

If you'd like to test it out on your instance, download like this:

URL=https://raw.githubusercontent.com/JedMeister/odoo/tweak-inithook/overlay
ODOO=usr/lib/inithooks/bin/odoo.py
wget -O /$ODOO $URL/$ODOO

Hopefully that gets you going?! Please let me know either way.

L. Arnold's picture

It is not clear to me what the difference between the Database Password and the Master Password.  I understand in this situation, the Database password is actually the "admin" user password, while the Master Password is for Database Managment within Odoo /database/manager interface.

I ran the steps you put there in Shell (Nice One there!)

did get a "fatal" statement that is seemingly not fatal.
 

psql: error: FATAL: database "TurnkeylinuxExample" does not exist

Default DB (TurnkeylinuxExample) not found - skipping setting passsword for that

Worked (in that I reset the PW to the one I likely lost track of and caused this)!

I think if this were to go one further, you might have a step in Odoo.PY which asked "which database" would you like to reset the admin password for..  maybe even give a list..  (list of Odoo Databases only)

Thank you for this Jeremy!

Landis

Jeremy Davis's picture

Glad to hear that my tweaks were useful! :)

The "Master" password is stored in the config file - the individual user accounts for specific Odoo DBs are stored in their respective DBs. E.g. The email and password of the 'admin' account for the example TurnKey DB is stored within the example TurnKey DB.

For simplicity, in the firstboot script we use the same password for both the "Master" password and the password for the example TurnKey Odoo DB "admin" user.

did get a "fatal" statement that is seemingly not fatal.

Yes, that's expected. The script does exactly what it did before, except now, when it hits the error that was killing it, it just ignores the error and keeps going. It would be better to suppress that "fatal" error message (that isn't fatal), but that would require tweaks to our shared postgresql module (which should probably be done, but there are higher priorities right now...).

I think if this were to go one further, you might have a step in Odoo.PY which asked "which database" would you like to reset the admin password for.. maybe even give a list.. (list of Odoo Databases only)

I did consider that when I made my tweaks yesterday, but it's a bit more complicated than just resetting the 'admin' password for a specific DB. There doesn't appear to a specific "admin" user - so we would need to work out which user to reset the password too. It's easy for the example DB as we create it, including the user account.

If you know the DB and the user email, then it's relatively trivial to change the password. But to write a script to work all that out (even if it just asks for DB, email and password) is a whole lot more work...

L. Arnold's picture

Thanks again Jeremy.

Maybe the script could ask the "shell runner" (root user)
"which database" and "which user"...

That would mean only "one at a time" but is not much work to change a few.

I think the passwords in "odoo.conf" are (is the word salted) to not be visible?  Seems so.
 

Anyway, this is a huge help.  Thank you.
Been bugging me for a long time.  If you run it through turnkey.init there has been no feedback so when the odoo database password was not changing, I thought I was going crazy.

Security wise we should find a way to limit the number of attempts there.  I will research.

Add new comment