Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
4 Răspunsuri
6104 Vizualizări

I have had a perfectly functional installation of Odoo 13 CE running on an Ubuntu 18.04 LTS virtual machine. After the last update from the github repository I started to get a blank screen after login. I can login, but after the redirect I get a white page.

To facilitate anyone who can help, I've tried to post a traceback from the log file here, but for some reason my post is rejected with 403 - forbidden, so I will try to explain what is evident from the log file and the browser console.


Apparently the script "web dot assets uderscore common dot js" cannot be loaded - 404 in the log file and "Loading failed for the script tag" in the browser console. I also get a "TypeError: odoo.define is not a function" in "web dot assets undersore backend dot js", line 3 and in html "web", line 52. Sorry for the wierd naming convention, but I'm tring to avoid links in this post.

I wiped out the cache of the browser, but the issue persisted.


I will highly appreciate any help on this.


Imagine profil
Abandonează
Cel mai bun răspuns

Open inspect in your browser and see in console. if any error then solve it. like missing some abc.js file or etc..

Imagine profil
Abandonează
Autor Cel mai bun răspuns

First I want to sincerely thank you for the support!

I followed all the steps, unfortunately without success. Same errors in odoo log, same errors in browser console. 

The only thing was that for some reason 'system' command didn't accept the '--stop-after-init' parameter and therefore I ran it directly from 'odoo-bin'. No biggie, I think.

So, after I made backup to my DB, I stopped odoo instance with 'systemctl', ran a 'git pull --ff-only', and then updated with 'odoo-bin'. Everything went successfully, no errors. In the update log there was a warning from psycopg2, that it is recommended to install psycopg2-binary, due to a package rename, but this doesn't seem to cause eny errors handling the db connection during update. Furthermore, when the update initiated the report said "INFO ? odoo: database: default@default:default", though my database has different name. Nevertheless updates went to the correct database after that and update was successful, but I got the same white page after login, due to exact same errors as before the update.

Do you have any other suggestions? Much appreciated once again!

Imagine profil
Abandonează

Did you update base module?

Try to clear the browser cache or using incognito or trying another browser and let me know the results.

Autor

No luck again :(

Yes, I updated 'base' module, as well as 'all' modules. No errors. Everything went smoothly.

I also checked the stackoverflow resource you referred to, deleted all .js & .css files from 'ir_attachment' table directly from the SQL console, then regenerated 'all' modules - no errors. Confirmed that all js and css fles are back on place in the db, but I got the same 404 for 'web.assets_common.js' and a white page after login.

Autor

One funny thing I just noticed - for some reason 'web.assets_common.js' has wrong Content-Type header attached. Instead of 'application/javascript', as it should be, it is 'text/html'! This might be the issue. I don't know how to manipulate the header though, to confirm it. Any ideas?

Try to enable debug with assets by adding ?debug=assets after web in URL and check the log file and console in browser inspector.

You can try this: Enable developer mode with assets then Open Developer Tools (tiny bug icon at the top right of your screen) and select Regenerate Assets Bundles.

Autor

Well, with '?debug=assets' everything works flawlessly. Then I regenerated the asset bundles as you recommended, also flawlessly. No complains, no errors. And yet again - in normal mode I got 404 with the same wrong header for web.assets_common.js. The error is replicated on Chrome, Firefox and Opera.

Then I tried to examine the source code and it seems that the only commit relevant to my issue is this one: https://github.com/odoo/odoo/commit/eca515785b0c87ed0b3498b02d36e0f63548fa02#diff-ab3dadc37163820f8e863edb1dd216f8b0e7ccf19cf4e2052577a7bae7ddd7e8
I am not qualified enough to assess the implications of moving that local variable few lines above, but apparently it matters.

Still looking for solution to invoke the correct header for web.assets_common.js. At least I know my DB is intact and I can work somehow. Thank you very, very much for holding my hand in this roller coaster journey :) If you have something more in your sleeve, pls share it :)

Cel mai bun răspuns

As you mentioned, you get the last update from the github repository for Odoo 13, So you need to update the Databases to apply all the new changes and you can do using command:

sudo service YourServiceName restart -u all -d YourDatabaseName

Here you are the process to update Odoo from github:

If you installed Odoo from source by using the git repository. The main
benefit of this setting is being able to update the source code of Odoo using git to get the latest bug fixes.

To update your Odoo from source follow the below steps:

1.     Make a backup of all the databases you care about in case something goes bad. (You can backup all DB from odoo)

 

2.     Stop any instance currently running with the Odoo source you are about to update. use the below command:

                 $ Sudo service [service-name] stop

3.     Then make a note of the current version of the source you are running. (This is very important if something going wrong with update so you can back to the version which you are running) The best way is to create a lightweight tag using the following command:

             #cd to the odoo folder

             $ git checkout 13.0

             $ git tag 13.0-before-update-$(date --iso)

 

4.     To update the source code of Odoo, use the following command:

      $ git pull –-ff-only

This will fetch the latest version of the source code committed to the current branch.

 

5. If the last step run successfully then, To update an instance running on this code, run the below:
$ sudo service YourServiceName --stop-after-init -u base -d YourDBName

Updating the source code is done by making sure we are on the correct branch using git checkout, and then fetching the new revisions using git pull. The --ff-only option will cause a failure if you have local commits not present in the remote repository. If this happens and you want to keep your changes, you can use git pull (without --ff-only) to merge the remote changes with yours; otherwise, use git reset --hard origin/13.0 to force the update, discarding your local modifications.

The update command uses the following options:

·        -c: specify the configuration file

·        --stop-after-init: stop the instance when the update is over

·        -u base or --update base: requests the update of the base module.

When updating a module, Odoo does the following:

·        It updates the database structure for the models defined in the module for which the structure changes. For updates on the stable branch of Odoo, there should be no such changes, but this can happen for your own addons or third party addons.

·        It updates the database records stored in data files of the module, most notably the views. It then recursively updates the installed modules which have declared a dependency on the module.

Since the base module is an implicit dependency of all Odoo modules, updating it will trigger an update of all the installed modules in your instance. To update all installed modules, the alias all can be used instead of base.

 

If the update fails, don't panic, you have backups:

1.     Read the error message carefully. Save it to a file, as it will be useful to make a bug report later.

2.     If you cannot figure out what the problem is, restore the service; restore the Odoo source code to the previous version, which is known to work using the tag you set before updating the source version:
          $ git reset --hard 13.0-before-update-$(date --iso)

3.     Drop the broken databases and restore them from the backups you made.


Imagine profil
Abandonează
Autor

Pls, see my answer :) Any suggestions?