Yenthe666 / InstallScript

Odoo install script
MIT License
1.23k stars 1.55k forks source link

Style Error after installing Odoo V11 #80

Closed AyaYousef closed 6 years ago

AyaYousef commented 6 years ago

Hello there, Impacted version: 11 Steps to reproduce:

After installing Odoo V11 EE or CE, I got this style error in backend view

2018-01-13 08:49:16,945 11397 INFO demo odoo.addons.base.ir.ir_http: Generating routing map

2018-01-13 08:49:38,895 11397 WARNING demo odoo.addons.base.ir.ir_qweb.assetsbundle: (b'', b'')This error occured while compiling the bundle 'web.assets_backend' containing:

    - /web/static/lib/bootstrap/less/variables.less

    - /web/static/lib/bootstrap/less/mixins/vendor-prefixes.less

    - /web/static/lib/bootstrap/less/mixins/buttons.less

    - /web/static/lib/bootstrap/less/mixins/clearfix.less

    - /web/static/lib/bootstrap/less/mixins/size.less

    - /web/static/src/less/variables.less

    - /web_enterprise/static/src/less/variables.less

    - /web/static/src/less/utils.less

    - /web_editor/static/src/less/web_editor.variables.less

    - /web/static/src/less/import_bootstrap.less

    - /web_enterprise/static/src/less/bootstrap_overridden.less

    - /web_enterprise/static/src/less/webclient.less

    - /web_enterprise/static/src/less/webclient_layout.less

    - /web/static/src/less/webclient.less

    - /web/static/src/less/domain_selector.less

    - /web/static/src/less/model_field_selector.less

    - /web/static/src/less/progress_bar.less

    - /web/static/src/less/dropdown.less

    - /web_enterprise/static/src/less/dropdown.less

    - /web/static/src/less/tooltip.less

    - /web/static/src/less/debug_manager.less

    - /web/static/src/less/control_panel.less

    - /web/static/src/less/fields.less

    - /web_enterprise/static/src/less/fields.less

    - /web/static/src/less/views.less

    - /web_enterprise/static/src/less/views.less

    - /web/static/src/less/pivot_view.less

    - /web/static/src/less/graph_view.less

    - /web/static/src/less/form_view.less

    - /web_enterprise/static/src/less/form_view.less

    - /web/static/src/less/list_view.less

    - /web_enterprise/static/src/less/list_view.less

    - /web/static/src/less/kanban_dashboard.less

    - /web/static/src/less/kanban_column_progressbar.less

    - /web/static/src/less/kanban_view.less

    - /web/static/src/less/kanban_view_mobile.less

    - /web/static/src/less/web_calendar.less

    - /web/static/src/less/search_view.less

    - /web_enterprise/static/src/less/search_view.less

    - /web/static/src/less/data_export.less

    - /web/static/src/less/base_settings.less

    - /web/static/src/less/report_backend.less

    - /web_mobile/static/src/less/mobile.less

    - /base_import/static/src/less/base_import.less    

    - /web_diagram/static/src/less/diagram_view.less

    - /web_editor/static/src/less/web_editor.common.less

    - /web_editor/static/src/less/web_editor.backend.less

    - /web_enterprise/static/src/less/app_switcher.less

    - /web_enterprise/static/src/less/app_switcher_layout.less

    - /web_enterprise/static/src/less/menu_mobile.less

    - /web_enterprise/static/src/less/menu_search.less

    - /web_enterprise/static/src/less/control_panel_layout.less

    - /web_enterprise/static/src/less/datepicker.less

    - /web_enterprise/static/src/less/kanban_view.less

    - /web_enterprise/static/src/less/touch_device.less

    - /web_enterprise/static/src/less/keyboard.less

    - /web_gantt/static/src/css/gantt.less

    - /web_grid/static/src/less/grid_view.less

    - /mail/static/src/less/announcement.less

    - /mail/static/src/less/client_action.less

    - /mail/static/src/less/chat_window.less

    - /mail/static/src/less/extended_chat_window.less

    - /mail/static/src/less/composer.less

    - /mail/static/src/less/chatter.less

    - /mail/static/src/less/followers.less

    - /mail/static/src/less/thread.less

    - /mail/static/src/less/systray.less

    - /mail/static/src/less/mail_activity.less

    - /web_clearbit/static/src/less/web_clearbit.less

    - /account/static/src/less/account_reconciliation.less

    - /account/static/src/less/account_journal_dashboard.less

    - /account/static/src/less/account_dashboard.less

    - /account_reports/static/src/less/account_financial_report.less

    - /payment/static/src/less/payment_acquirer.less

    - /sales_team/static/src/less/sales_team_dashboard.less

    - /sale_subscription/static/src/css/sale_subscription_backend.less

    - /maintenance/static/src/less/maintenance_team_dashboard.less

    - /web_settings_dashboard/static/src/less/dashboard.less

2018-01-13 08:49:40,370 11397 INFO demo odoo.models.unlink: User #1 deleted ir.attachment records with IDs: [510]

and in the website app

2018-01-13 11:58:31,001 16268 WARNING demo odoo.addons.base.ir.ir_qweb.assetsbundle: (b'', b'')This error occured while compiling the bundle 'web.assets_frontend' containing:

    - /web/static/lib/bootstrap/less/variables.less

    - /web/static/lib/bootstrap/less/mixins/vendor-prefixes.less

    - /web/static/lib/bootstrap/less/mixins/buttons.less

    - /web/static/lib/bootstrap/less/mixins/clearfix.less

    - /web/static/lib/bootstrap/less/mixins/size.less

    - /web/static/src/less/variables.less

    - /web_enterprise/static/src/less/variables.less

    - /web/static/src/less/utils.less

    - /web_editor/static/src/less/web_editor.variables.less

    - /web/static/src/less/import_bootstrap.less

    - /web_editor/static/src/less/web_editor.common.less

    - /portal/static/src/less/website.ui.less

    - /portal/static/src/less/website.wrapwrap.less

    - /portal/static/src/less/bootstrap.extend.less

    - /portal/static/src/less/portal_frontend.less

    - /payment/static/src/less/payment_form.less

    - /sale/static/src/less/sale_portal.less

    - /sale_subscription/static/src/less/portal_subscription.less

    - /website/static/src/less/website.ui.components.less

    - /website/static/src/less/website.snippets.less

    - /website/static/src/less/website.zoomodoo.less

    - /website_enterprise/static/src/less/website_enterprise.less

    - /website_mail/static/src/css/website_mail.less

2018-01-13 11:58:31,795 16268 INFO demo odoo.modules.registry: At least one model cache has been invalidated, signaling through the database.
Yenthe666 commented 6 years ago

Hi AyaYousef,

Does the Odoo work if you add ?debug=assets in the URL?

Regards, Yenthe

AyaYousef commented 6 years ago

Yes

Yenthe666 commented 6 years ago

Then it is related to Odoo itself and/or the compilation of the assets. Sadly there are multiple reports about this with no clear solution. For example: https://github.com/odoo/odoo/issues/19627 https://github.com/odoo/odoo/issues/12560 https://github.com/odoo/odoo/issues/14938 https://github.com/odoo/odoo/issues/10377

There are a lot of assets issues known in Odoo honestly. Your best best is to run a query to drop all your assets and to recompile them again.

AyaYousef commented 6 years ago

Can you please help me on this, I mean to give me a reference for that query that I can run to recompile them again :)

chris001 commented 6 years ago

@AyaYousef The python code to add a menu item to regenerate these web assets is in the first issue @Yenthe666 mentioned here: https://github.com/odoo/odoo/commit/28491aac45dc912696c1fcc57a50e3ec98906336 From issue https://github.com/odoo/odoo/issues/19627 With a few git commands, you could probably automatically add this menu command to your odoo. Of course, that would be useless, when your odoo is failing to display the menus due to problems with the web assets. You can read the issue for many workarounds others have used.

AyaYousef commented 6 years ago

I tried to delete the attachments mentioned there, restarted odoo service and activated the developer mode with assets. The style errors disappeared for sometime, and once I installed a new app (assets management) the problem occurred again!

chris001 commented 6 years ago

@AyaYousef Did you install Odoo Community and Enterprise with odoo_install.sh from here in this repo master branch, or with my new version? Assuming you used this repo master version. Try my new version, I've fixed many bugs. You can run it over your existing install, it doesn't require an empty server. Comment back if it fixes this assets error issue for you:

rm odoo_install.sh
wget https://github.com/chris001/InstallScript/raw/patch-2/odoo_install.sh
chmod +x odoo_install.sh
./odoo_install.sh
AyaYousef commented 6 years ago

@chris001 I installed Enterprise from here in this repo branch 11 Here's the command I used sudo wget https://raw.githubusercontent.com/Yenthe666/InstallScript/11.0/odoo_install.sh so shall I use the same command you mentioned?

chris001 commented 6 years ago

@AyaYousef Try my new version, I've fixed many bugs. See above for commands to download and run install.

AyaYousef commented 6 years ago

@chris001 can you send me the link of branch 11.0

chris001 commented 6 years ago

@AyaYousef This is the commands to run, and it will get you branch 11.0 :

rm odoo_install.sh
wget https://github.com/chris001/InstallScript/raw/patch-2/odoo_install.sh
chmod +x odoo_install.sh
./odoo_install.sh

Post back with your results.

AyaYousef commented 6 years ago

@chris001 I rebuilt the server and used your script for a fresh start It seemed to be styling compiling error on any newly created database is no longer happening. However, I encountered lessc error after restoring an old db was built on the old script. image image

Do I need to upgrade all the apps installed in the restored db?

Also, I've encountered another error in the new script Wkhtmltopdf I can't print any report in pdf format. image

chris001 commented 6 years ago

@AyaYousef 1.

I encountered lessc error after restoring an old db was built on the old script. Do I need to upgrade all the apps installed in the restored db?

What's the output of this command: which lessc

  1. I've encountered another error in the new script Wkhtmltopdf I can't print any report in pdf format. "Your installation of Wkhtmltopdf seems to be broken. The report will be shown in html."

Can you share the exact steps to get this error.

AyaYousef commented 6 years ago

Now the old compiling styling error messages are coming across all the database including the old restored and the newly created ones.

salmemik commented 6 years ago

Hi,

I reported this Wkhtmltopdf issue to different thread but I can share reproduce steps also here. It happens with all printouts so this is just one example.

1) Create Sales Order 2) Select "Print"

=> Sales Order won't get printed and pop-up error message is displayed. See the attached screenshots.

Mikko

so004_-_odoo quotation___order_-_odoo
salmemik commented 6 years ago

I managed to correct Wkhtmltopdf related issues. I run following command and after that printing and email sending started to work without problems: apt-get -f install fontconfig libxrender1

Regards, Mikko

AyaYousef commented 6 years ago

@chris001 this is the output of which lessc /usr/local/bin/lessc

Regarding the steps to trigger the pdf report are exactly the same as @salmemik said, also I used his suggested solution and now I can print pdf reports with no issues.

Now only the styling errors remain!

chris001 commented 6 years ago

@AyaYousef @salmemik I've updated the install script #74 to install the dependencies required by wkhtmltopdf which are fontconfig libxrender1 xvfb Reference: https://stackoverflow.com/questions/37765698/unable-to-install-wkhtmltopdf-with-patched-qt-in-ubuntu-16-04

@AyaYousef

AyaYousef commented 6 years ago

@chris001

For style (static web assets) what happens when you copy and paste ?debug=assets at the end of your odoo URL in the browser address bar, and reload the page?

Sometimes it works just fine, other times the styles are not rendered and the page loads too messy as if it can't read the css/less styles.

You installed enterprise or community?

I'm using Odoo V11 Enterprise Edition.

Output of commands: cat /var/log/odoo/odoo-server | grep WARN

Ok since it's a big list of warning messages, I'll skip the duplicated messages, the following is the recap

2018-02-18 10:43:09,808 5942 WARNING ? odoo.addons.l10n_mx_edi.models.certificate: OpenSSL library not found. If you plan to use l10n_mx_edi, please install the library from https://pypi.python.org/pypi/pyOpenSSL
2018-02-18 10:43:09,914 5942 WARNING ? odoo.addons.voip.models.res_partner: The `phonenumbers` Python module is not installed, contact look up will not be done for incoming calls. Try: pip install phonenumbers.
2018-02-18 10:44:34,510 5944 WARNING ? odoo.addons.base.ir.ir_cron: Skipping database dci-demo because of modules to install/upgrade/remove.
2018-02-18 10:47:00,452 5941 WARNING dci-demo odoo.modules.loading: Transient module states were reset
2018-02-18 12:12:02,839 7820 WARNING dci-demo odoo.addons.base.ir.ir_qweb.assetsbundle: (b'\n<--- Last few GCs --->\n\n    9067 ms: Mark-sweep 27.1 (248785.9) -> 27.1 (272416.9) MB, 229.9 / 0 ms [allocation failure] [GC in old space requested].\n    9311 ms: Mark-sweep 27.1 (272417.9) -> 27.1 (296058.9) MB, 243.2 / 0 ms [allocation failure] [GC in old space requested].\n    9511 ms: Mark-sweep 27.1 (296059.9) -> 27.1 (319335.9) MB, 199.0 / 0 ms [last resort gc].\n    9728 ms: Mark-sweep 27.1 (319335.9) -> 27.0 (342244.9) MB, 217.2 / 0 ms [last resort gc].\n\n\n<--- JS stacktrace --->\n\n==== JS stack trace =========================================\n\nSecurity context: 0x19d3750b4629 <JS Object>\n    1: /* anonymous */(aka /* anonymous */) [/usr/lib/nodejs/less/lib/less/tree/expression.js:20] [pc=0x6ca2baf4b14] (this=0x19d3750041b9 <undefined>,e=0x76551e161b1 <JS Object>)\n    2: arguments adaptor frame: 3->1\n    3: InnerArrayMap(aka InnerArrayMap) [native array.js:~1001] [pc=0x6ca2b3307e8] (this=0x19d3750041b9 <undefined>,bk=0xac00211c059 <JS Function (SharedFunctionInfo 0x1fb48caf3611)...\n\n', b'FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory\n')This error occured while compiling the bundle 'web.assets_backend' containing:
2018-02-19 08:43:04,825 27781 WARNING dci-demo odoo.addons.base.ir.ir_qweb.assetsbundle: (b'', b'')This error occured while compiling the bundle 'web.assets_backend' containing:

Output of commands: cat /var/log/odoo/odoo-server | grep ERROR

2018-02-19 09:02:02,092 28160 ERROR dci-demo odoo.addons.base.ir.ir_qweb.assetsbundle: Could not execute command '/usr/bin/lessc'
2018-02-19 09:06:58,216 28159 ERROR dci-demo odoo.addons.base.ir.ir_qweb.assetsbundle: Could not execute command '/usr/bin/lessc'
2018-02-19 09:07:47,339 28159 ERROR dci-demo odoo.addons.base.ir.ir_qweb.assetsbundle: Could not execute command '/usr/bin/lessc'
2018-02-20 06:53:02,339 1476 ERROR dci-demo odoo.http: Exception during JSON request handling.
2018-02-20 06:53:17,933 1476 ERROR dci-demo odoo.http: Exception during JSON request handling.
2018-02-20 06:53:30,569 1477 ERROR dci-demo odoo.http: Exception during JSON request handling.
2018-02-20 06:53:42,658 1478 ERROR dci-demo odoo.http: Exception during JSON request handling.
chris001 commented 6 years ago

@AyaYousef

AyaYousef commented 6 years ago

@chris001

You're running 11 enterprise? Previous post said 11 community?

yes I'm using both versions, but here I'm reporting on an Enterprise version

Is module l10n_mx_edi from enterprise?

Yes, both are Enterprise

lessc isn't being found on your system path. Will look into this more.

Any chance to find a fix for my problem?

chris001 commented 6 years ago

Any chance to find a fix for my problem?

Run this command, and report back your results here: sudo ln -s /usr/local/bin/lessc /usr/bin/lessc

AyaYousef commented 6 years ago

@chris001

Run this command, and report back your results here: sudo ln -s /usr/local/bin/lessc /usr/bin/lessc

ln: failed to create symbolic link '/usr/bin/lessc': File exists

chris001 commented 6 years ago

What's the output of: ls -la /usr/bin/lessc and: echo $PATH

AyaYousef commented 6 years ago

ls -la /usr/bin/lessc

lrwxrwxrwx 1 root root 28 Oct 24 2015 /usr/bin/lessc -> ../lib/nodejs/less/bin/lessc

echo $PATH

/home/user_name/bin:/home/user_name/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

chris001 commented 6 years ago

What's the output of: ls -la /usr/lib/nodejs/less/bin/lessc

AyaYousef commented 6 years ago

What's the output of: ls -la /usr/lib/nodejs/less/bin/lessc

-rwxr-xr-x 1 root root 12683 Oct 24 2015 /usr/lib/nodejs/less/bin/lessc

chris001 commented 6 years ago

What's the output of: curl -I http://127.0.0.1:8069/web/static/tests/boot_tests.js

Also, did you delete any user or demo data (attachments) from your odoo? INFO demo odoo.models.unlink: User #1 deleted ir.attachment records with IDs: [510]

AyaYousef commented 6 years ago

What's the output of: curl -I http://127.0.0.1:8069/web/static/tests/boot_tests.js

HTTP/1.0 200 OK
Date: Wed, 07 Mar 2018 05:59:57 GMT
Etag: "wzsdm-1518950199-471-634717522"
Cache-Control: max-age=604800, public
Expires: Wed, 14 Mar 2018 05:59:57 GMT
Content-Type: application/javascript
Content-Length: 471
Server: Werkzeug/0.14.1 Python/3.5.2

Also, did you delete any user or demo data (attachments) from your odoo?

I'm not quite sure about it, what if I deleted a user, what is harm on that?

chris001 commented 6 years ago

Should be fine to delete a user, that log item was just an INFO message.

Can you start odoo from command line, do the action that causes the web interface bug, and copy/paste the error (exception) output that it prints to the terminal.

sudo systemctl stop odoo-server
cd /home/odoo/odoo-server
./start.sh
AyaYousef commented 6 years ago

I appreciate your support @chris001 but it seems the problem lays in lack of resources, I've upgraded my ram, and seems like everything working smoothly. Thanks again.

Yenthe666 commented 6 years ago

Aha. Happy you've figured it out.

chris001 commented 6 years ago

@AyaYousef For the benefit of the group,

  1. How much RAM did you start with (node css error, wkhtmltopdf rendering error)?
  2. How much RAM did you upgrade to (css working fine, wkhtmltopdf rendering fine)?
AyaYousef commented 6 years ago

I started my server with the following specs:

MEMORY | VCPUS | SSD DISK 
1 GB | 1 vCPU | 25 GB

Upgraded to the following plan:

MEMORY | VCPUS | SSD DISK 
2 GB | 1 vCPU | 50 GB

After upgrading the server, I didn't experience styling nor wkhtmltopdf rendering issues.

chris001 commented 6 years ago

@AyaYousef Thanks for sharing your odoo server specs.

Yenthe666 commented 6 years ago

Yeah, agreed.

AyaYousef commented 6 years ago

I totally agree with you Chris, this is not the first time I experience this issue.. and it took a lot of time to figure it out! I hope they can do something regarding this.

chris001 commented 6 years ago

@AyaYousef @Yenthe666 I posted this as an issue to the official odoo github repo: https://github.com/odoo/odoo/issues/23909 If you go to the issue, then click "Subscribe" on the right hand side of the issue, github will give notifications to you, when there is activity, updates, comments, on the issue.
I'm confident odoo developers will fix this bug, because the software will become much more user friendly, because users will learn much more quickly when their odoo 11 is crashing due to lack of memory, and so the users can fix the problem by adding memory (or removing memory intensive yet unnecessary services running on their odoo server) very quickly and very easily.

Yenthe666 commented 6 years ago

Hi @chris001,

You might not know but I voluntarely work on Odoo issues, changes and improvements so I know quite some of the guys well. I'll ping the right ones, let me know if you get no response in a week or so.

normanu commented 6 years ago

Very strange I have these errors aswell. When running it from a Sandy Bridge CPU host system I have no issues. Running the same from a KVM VM on a host with a Xeon E5335, I have the above error. Same docker version etc. it seems related to CPU support, maybe missing SSE4 instructions?

MeringGao commented 6 years ago

ubuntu 16.04 cd /usr/bin sudo ln nodejs node

yezyilomo commented 6 years ago

For Ubuntu use sudo apt-get install --reinstall node-less this is a package with 'lessc' command, Odoo is using this for CSS!.