NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.21k stars 14.21k forks source link

Build failure: odoo #227549

Open luochen1990 opened 1 year ago

luochen1990 commented 1 year ago

Describe the bug

odoo Failed to build, seems like it's because one of hypothesis's unit test failed.

Steps To Reproduce

Steps to reproduce the behavior:

  1. NIXPKGS_ALLOW_INSECURE=1 nix-shell -p odoo

Expected behavior

Success into the shell with odoo

Screenshots

error: builder for '/nix/store/829rabm98zlmrsdcagrsz7bbbr8ja9g1-python3.10-hypothesis-6.68.2.drv' failed with exit code 1;
last 10 log lines:
> 38.19s call     hypothesis-python/tests/cover/test_sampled_from.py::test_efficient_lists_of_tuples_first_element_sampled_from
> 37.54s call     hypothesis-python/tests/cover/test_simple_collections.py::test_sets_of_fixed_length[7]
> 35.89s call     hypothesis-python/tests/cover/test_stateful.py::test_can_run_with_no_db
> 31.97s call     hypothesis-python/tests/cover/test_simple_collections.py::test_sets_of_fixed_length[6]
> 31.24s call     hypothesis-python/tests/cover/test_simple_collections.py::test_dictionaries_of_fixed_length[8]
> 30.31s call     hypothesis-python/tests/cover/test_validation.py::test_does_not_error_if_min_size_is_bigger_than_default_size
> =========================== short test summary info ============================
> FAILED tests/cover/test_stateful.py::test_initialize_rule_populate_bundle - AssertionError: assert 'Falsifying e...10/abc.py:123' == 'Falsifying e...te...
> ======= 1 failed, 2831 passed, 2 skipped, 1 xfailed in 561.15s (0:09:21) =======
> /nix/store/5s1yg5l36wzgy1dj0vv1ibarc4g7vrdr-stdenv-linux/setup: line 1594: pop_var_context: head of shell_variables not a function context
For full logs, run 'nix log /nix/store/829rabm98zlmrsdcagrsz7bbbr8ja9g1-python3.10-hypothesis-6.68.2.drv'.
error: 1 dependencies of derivation '/nix/store/r3fj190ljilrzkh3v1f9xchmgn47vrb8-python3.10-anyio-3.6.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/zv7mb036kn6ddp0v5jj1c9760b5wk4kw-python3.10-argon2-cffi-21.3.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/2b5m8i8x98svblk5p49basrzvq4chv59-python3.10-h2-4.1.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/835y9lnlil1zwcrn6x7bq1qwn1gdl0pa-python3.10-subunit-1.4.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/bhj03jrxfsm7z2dfjwyf4q8dz1pc7nsq-python3.10-xmlsec-1.3.13.drv' failed to build
error: 1 dependencies of derivation '/nix/store/0jij6g6xfvzcng1mmxrvxrzv4h58zk52-python3.10-passlib-1.7.4.drv' failed to build
error: 1 dependencies of derivation '/nix/store/pql5b3x251vz6amn3wa601dfb3yw5mb7-odoo-15.0.20230317.drv' failed to build
error: 1 dependencies of derivation '/nix/store/j6dy1ib0ypj7ir4fnmvpv8ki56fliwdp-unit-script-odoo-start.drv' failed to build
error: 1 dependencies of derivation '/nix/store/kk34dqczbcx9l5rq4n7li43ynslvwm38-unit-odoo.service.drv' failed to build

Additional context

I tried to skip the test step as following, and it worked this time:

services.odoo.package = pkgs.odoo.overrideAttrs (old: { doCheck = false; });

Notify maintainers

@mkg20001

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
- system: `"x86_64-linux"`
- host os: `Linux 6.2.9-zen1, NixOS, 23.05 (Stoat), 23.05.20230412.fe2ecaf`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.13.3`
- nixpkgs: `/nix/store/smqnlsl2d5b0ig64dp61hf0hjn5f91bg-source`
luochen1990 commented 1 year ago

The daemon can suddenly exit when build successed.

4月 22 15:07:01 home-server odoo-start[624399]: File: "/nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python3-3.10.10/lib/python3.10/http/server.py", line 433, in handle
4月 22 15:07:01 home-server odoo-start[624399]:   self.handle_one_request()
4月 22 15:07:01 home-server odoo-start[624399]: File: "/nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python3-3.10.10/lib/python3.10/http/server.py", line 401, in handle_one_request
4月 22 15:07:01 home-server odoo-start[624399]:   self.raw_requestline = self.rfile.readline(65537)
4月 22 15:07:01 home-server odoo-start[624399]: File: "/nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python3-3.10.10/lib/python3.10/socket.py", line 705, in readinto
4月 22 15:07:01 home-server odoo-start[624399]:   return self._sock.recv_into(b)
4月 22 15:07:01 home-server odoo-start[624399]: 2023-04-22 07:07:01,432 624399 INFO ? odoo.service.server: Initiating server reload
4月 22 15:07:01 home-server odoo-start[624399]: 2023-04-22 07:07:01,619 624399 INFO ? odoo.sql_db: ConnectionPool(used=0/count=0/max=64): Closed 2 connections
4月 22 15:07:01 home-server odoo-start[624399]:   File "/nix/store/vcjhkg3cyas3zi3xzf0myw3f5jy9nz39-odoo-15.0.20230317/bin/odoo", line 2
4月 22 15:07:01 home-server odoo-start[624399]:     PATH=${PATH:+':'$PATH':'}
4月 22 15:07:01 home-server odoo-start[624399]:          ^
4月 22 15:07:01 home-server odoo-start[624399]: SyntaxError: invalid syntax
4月 22 15:07:01 home-server systemd[1]: odoo.service: Main process exited, code=exited, status=1/FAILURE
4月 22 15:07:01 home-server systemd[1]: odoo.service: Failed with result 'exit-code'.
4月 22 15:07:01 home-server systemd[1]: odoo.service: Consumed 1.128s CPU time, received 7.3K IP traffic, sent 131.6K IPtraffic.
luochen1990 commented 1 year ago

@mkg20001 Hello, thanks for taking odoo into NixOS, that is very helpful. But I don't know how it is expected to be used. After I enter http://127.0.0.1:8069/web/database/selector, there is a form and two button Create database, or restore a database, but I cannot tell odoo to use the odoo database (which is created by the services.odoo module), and if I choose to create a new database, then I'm told Database creation error: permission denied to create database. So it seems I can neither use a existing database nor create a new one. need some help, thx.

My NixOS Configuration:

  services.odoo.enable = true;
  services.odoo.package = pkgs.odoo.overrideAttrs (old: { doCheck = false; });
  services.odoo.settings = {
    options = {
      admin_passwd = "123";
      db_user = "odoo";
    };
  };
  #DOC: https://www.odoo.com/documentation/15.0/administration/install/deploy.html

  nixpkgs.config.permittedInsecurePackages = [
    "qtwebkit-5.212.0-alpha4"
  ];
luochen1990 commented 1 year ago

Find warning in journalctl -u odoo.service:

odoo-start[638223]: 2023-04-22 08:00:49,789 638223 WARNING ? py.warnings: /nix/store/vcjhkg3cyas3zi3xzf0myw3f5jy9nz39-odoo-15.0.20230317/lib/python3.10/site-packages/odoo/addons/base/models/ir_mail_server.py:22: DeprecationWarning: 'urllib3.contrib.pyopenssl' module is deprecated and will be removed in a future release of urllib3 2.x. Read more in this issue: https://github.com/urllib3/urllib3/issues/2680
mkg20001 commented 1 year ago

@luochen1990 I remember doing things a bit manually when setting it up. Maybe I screwed something up in the module, but I can't recall how I set up odoo, since that was years ago.

One thing you can try is in postgres ALTER USER odoo WITH SUPERUSER; DROP DATABASE odoo; and then just create the odoo database via webinterface, later remove superusers.

I'm not sure how others have set up their odoo, maybe someone else can comment here.


Test failure seems to be a broken test (usually it was just some silenced warning that was added in a newer python version). So something is really broken this time. The package might build, but it might not work as it should.

If you want to update it, you can try cloning nixpkgs and running the update script:

nix-shell maintainers/scripts/update.nix --argstr package odoo

https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/finance/odoo/default.nix (this is the package file)

And then nix-shell -p odoo to test

But you might need to update the python modules aswell, that might be too complicated if you've never done packaging.

Codeleiche commented 5 months ago

Heyho, I got an update to 17 (202406xx) working but would like to know how to use the default.nix in my configuration.nix before pushing any half backed changes, any guide on that? or will it "just work" when it works with nix-shell? Sorry for the question, I'm a total noob, just installed nixos tree days ago.

Codeleiche commented 5 months ago

319968 would resolve all issues I found with odoo 17 (without changing the rest)