Odoo15 - ModuleNotFoundError: No module named 'PyPDF2' - virtualenv

I'm new to Odoo.
I use pyenv to host odoo and all the dependencies. All under odoo system user, and I was able to start odoo service:
~# systemctl status odoo-15
● odoo-15.service - Odoo15
Loaded: loaded (/etc/systemd/system/odoo-15.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2022-02-18 22:33:40 UTC; 6min ago
Main PID: 61267 (python)
Tasks: 6 (limit: 2339)
Memory: 79.3M
CGroup: /system.slice/odoo-15.service
└─61267 /home/odoo/.pyenv/versions/odoo-15-env/bin/python /home/odoo/odoo-15/odoo-bin -c /home/odoo/.odoo_config
However, the service seems always stopped somehow automatically after around 1 hour due to PyPDF2 can't find:
Feb 18 16:10:28 ubuntu-s-1vcpu-2gb-sgp1-odoo systemd[1]: Started Odoo15.
Feb 18 17:19:32 ubuntu-s-1vcpu-2gb-sgp1-odoo odoo-15[58346]: Traceback (most recent call last):
Feb 18 17:19:32 ubuntu-s-1vcpu-2gb-sgp1-odoo odoo-15[58346]: File "/home/odoo/odoo-15/odoo-bin", line 5, in <module>
Feb 18 17:19:32 ubuntu-s-1vcpu-2gb-sgp1-odoo odoo-15[58346]: import odoo
Feb 18 17:19:32 ubuntu-s-1vcpu-2gb-sgp1-odoo odoo-15[58346]: File "/home/odoo/odoo-15/odoo/__init__.py", line 75, in <module>
Feb 18 17:19:32 ubuntu-s-1vcpu-2gb-sgp1-odoo odoo-15[58346]: import PyPDF2
Feb 18 17:19:32 ubuntu-s-1vcpu-2gb-sgp1-odoo odoo-15[58346]: ModuleNotFoundError: No module named 'PyPDF2'
Feb 18 17:19:32 ubuntu-s-1vcpu-2gb-sgp1-odoo systemd[1]: odoo-15.service: Main process exited, code=exited, status=1/FAILURE
Feb 18 17:19:32 ubuntu-s-1vcpu-2gb-sgp1-odoo systemd[1]: odoo-15.service: Failed with result 'exit-code'.
But I definitely have PyPDF2 in my pyenv
odoo#ubuntu-s-1vcpu-2gb-sgp1-odoo:~/odoo-15$ python
Python 3.9.2 (default, Feb 17 2022, 17:59:57)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyPDF2
>>> PyPDF2.__version__
'1.26.0'
I feel it's something to do with my virtualenv config, but I'm bit lost here.
Could you help to enlighten me on what could be wrong here? Thank you

You need to activate virtual env and install Odoo requirements so:
sudo pip install -r requirements.txt
Or directly Install this module
pip3 install Pypdf2

check this link , it fixed here on blogger
https://shilalg.blogspot.com/2019/07/importerror-no-module-named-pypdf2.html

Usually happens when you forget to activate virtual env for odoo.
If you already have a configured virtual environment . start your venv before running odoo server.
If not . Then you have to install all the dependencies, (which are in requirement.txt file in odoo directory).
Navigate to odoo folder and run pip install -r requirements.txt. Hit enter. Let it install all packages and run your server again.

Related

Mongodb will not start. libboost_filesystem.so.1.78.0: cannot open shared object file: No such file or directory

Something must be broken, or maybe there is something I am not seeing.
I do:
sudo systemctl status mongodb.service
But I get this error:
Jan 26 10:47:49 MacBookPro systemd[1]: Starting MongoDB Database Server...
Jan 26 10:47:49 MacBookPro mongod[12272]: /usr/bin/mongod: error while loading shared libraries: libboost_filesystem.so.1.78.0: cannot>
Jan 26 10:47:49 MacBookPro systemd[1]: mongodb.service: Control process exited, code=exited, status=127/n/a
Jan 26 10:47:49 MacBookPro systemd[1]: mongodb.service: Failed with result 'exit-code'.
Jan 26 10:47:49 MacBookPro systemd[1]: Failed to start MongoDB Database Server.
I have been reading: https://wiki.archlinux.org/title/MongoDB
And because there is no mongod.lock file I do:
mongod --dbpath /var/lib/mongodb/ --repair
But the error persists:
mongod: error while loading shared libraries: libboost_filesystem.so.1.78.0: cannot open shared object file: No such file or directory
What do you guys think is happening? Thanks in advance. Btw I am using BlackArch.
I have tried a full update and upgrade. My system says it is fully updated, but maybe it is not?

mongodb service fail after reinstalling it on ubuntu

i was using mongodb and it was fine.
then i wanted to convert it to replica set and i get into some problems and i uninstalled it.
after reinstalling (10 times and doing everything on internet xD) why i check status with systemctl status it say failed with exit_code ( i know my conf file dont have problem).
what can i do? i even installed the 3.3 version and even it doesnt start anymore.
i used anything that it came to my mind (purging config files & lot more...).
i really dont want to reinstall my os (really cant).
this is my sudo systemctl status mongod
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2021-02-18 20:05:20 +0330; 8s ago
Docs: https://docs.mongodb.org/manual
Process: 147513 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=1/FAILURE)
Main PID: 147513 (code=exited, status=1/FAILURE)
Feb 18 20:05:20 nima-Lenovo-ideapad-320-15AST systemd[1]: Started MongoDB Database Server.
Feb 18 20:05:20 nima-Lenovo-ideapad-320-15AST mongod[147513]: about to fork child process, waiting until server is ready for connections.
Feb 18 20:05:20 nima-Lenovo-ideapad-320-15AST mongod[147527]: forked process: 147527
Feb 18 20:05:20 nima-Lenovo-ideapad-320-15AST mongod[147513]: ERROR: child process failed, exited with 1
Feb 18 20:05:20 nima-Lenovo-ideapad-320-15AST mongod[147513]: To see additional information in this output, start without the "--fork" option.
Feb 18 20:05:20 nima-Lenovo-ideapad-320-15AST systemd[1]: mongod.service: Main process exited, code=exited, status=1/FAILURE
Feb 18 20:05:20 nima-Lenovo-ideapad-320-15AST systemd[1]: mongod.service: Failed with result 'exit-code'.
I solved the problem by changing the default mongodb port from port 27017 to port 27018 in /etc/mongod.conf.
I'm sure this will come handy to a lot of people.
And for the last part, after uninstalling mongodb I removed mongod.service files (every file) in the system and systemd directories in root and installed mongodb again.
(so I think uninstalling mongodb wasn't complete at first time. And 2 instances interfere with each other. Now everything works fine in mongodb with port 27018).

How to upgrade postgresql in NixOS?

I am attempting to update my postgresql server from 9.4 to (at least) 9.6 on my NixOS machine.
I have edited services.postgres.package in my configuration.nix to reflect this change, changing it from:
services.postgresql.package = pkgs.postgresql94
to
services.postgresql.package = pkgs.postgresql96
However, this results in an error upon running nixos-rebuild switch, namely:
$ sudo nixos-rebuild switch
building Nix...
building the system configuration...
stopping the following units: postgresql.service
NOT restarting the following changed units: display-manager.service
activating the configuration...
setting up /etc...
setting up tmpfiles
reloading the following units: dbus.service
restarting the following units: polkit.service
starting the following units: postgresql.service
Job for postgresql.service failed because the control process exited with error code.
See "systemctl status postgresql.service" and "journalctl -xe" for details.
warning: the following units failed: postgresql.service
● postgresql.service - PostgreSQL Server
Loaded: loaded (/nix/store/bh7vzvacc9y56w0kzs1mwgb1jy9bwvf6-unit-postgresql.service/postgresql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2018-08-04 17:39:33 UTC; 26ms ago
Process: 25399 ExecStartPost=/nix/store/hj8lfb9bbspn76nwm0qmx0xr4466gh0a-unit-script/bin/postgresql-post-start (code=exited, status=1/FAILURE)
Process: 25398 ExecStart=/nix/store/qhdnk3qsw00igzadqfxf7kpp3a48z368-unit-script/bin/postgresql-start (code=exited, status=1/FAILURE)
Process: 25395 ExecStartPre=/nix/store/qg6s6mph3jmrsgr67vh4bsydxrrbmvrr-unit-script/bin/postgresql-pre-start (code=exited, status=0/SUCCESS)
Main PID: 25398 (code=exited, status=1/FAILURE)
Aug 04 17:39:33 nixos systemd[1]: Starting PostgreSQL Server...
Aug 04 17:39:33 nixos systemd[1]: postgresql.service: Main process exited, code=exited, status=1/FAILURE
Aug 04 17:39:33 nixos systemd[1]: postgresql.service: Control process exited, code=exited status=1
Aug 04 17:39:33 nixos systemd[1]: Failed to start PostgreSQL Server.
Aug 04 17:39:33 nixos systemd[1]: postgresql.service: Unit entered failed state.
Aug 04 17:39:33 nixos systemd[1]: postgresql.service: Failed with result 'exit-code'.
warning: error(s) occurred while switching to the new configuration
I notice that the NixOS manual contains a PostgreSQL section, however the "Upgrading" subsection is not yet filled out. Any ideas on how I might resolve this error and upgrade my PostgreSQL?
I solved this issue by creating a dump of all server databases, whacking the old data_directory and uninstalling the old version, installing the new version, then restoring from the dump.
These steps are described in detail below.
Create a dump of all server databases.
$ pg_dumpall -U root > sql-dump
Identify the location of the current version's data_directory.
root=# SHOW data_directory;
data_directory
--------------------
/var/db/postgresql
(1 row)
Change the version of services.postgresql.package in /etc/nixos/configuration.nix.
services.postgresql.package = pkgs.postgresql100
This is apparently the expression for version 10.4, according to $ nix-env -qaP '*' --description.
Next whack the data_directory for the current version.
$ sudo rm -rf /var/db/postgresql/
And switch to the new version marked in configuration.nix
$ sudo nixos-rebuild switch
I had to create a root db.
$ sudo createdb root
(I also had to change some instances of postgres to root in my sql-dump file.)
Restore the data into the new version.
$ psql -U root -f sql-dump
Anyone know how one can contribute to the nixos manual?
I am happy to use what I've learned here to write up the updating postgres section.

Kestrel failed to start UBUNTU 16.04

I have the folowing config:
[Unit]
Description=Example .NET Web API Application running on CentOS 7
[Service]
WorkingDirectory=/var/www/FEEDER
ExecStart=/usr/bin/dotnet /var/www/FEEDER/FeedService.MVC.dll
SyslogIdentifier=dotnet-example
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Development
[Install]
WantedBy=multi-user.target
when I start the prgram I dont get any error.
the status throw this:
sudo ystemctl status kestrel-hellomvc.service
● kestrel-hellomvc.service - Example .NET Web API Application running on CentOS 7
Loaded: loaded (/etc/systemd/system/kestrel-hellomvc.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since ג' 2017-10-31 09:26:20 IST; 54min ago
Main PID: 20077 (code=exited, status=131/n/a)
אוק 31 09:26:20 avi-VirtualBox systemd[1]: Stopped Example .NET Web API Application running on CentOS 7.
אוק 31 09:26:20 avi-VirtualBox systemd[1]: Started Example .NET Web API Application running on CentOS 7.
אוק 31 09:26:20 avi-VirtualBox systemd[1]: kestrel-hellomvc.service: Main process exited, code=exited, status=131/n/a
אוק 31 09:26:20 avi-VirtualBox systemd[1]: kestrel-hellomvc.service: Unit entered failed state.
אוק 31 09:26:20 avi-VirtualBox systemd[1]: kestrel-hellomvc.service: Failed with result 'exit-code'.
Warning: kestrel-hellomvc.service changed on disk. Run 'systemctl daemon-reload' to reload units.
the owner of the folder is www-data and the permissions are 0755
What might be the problem?
Thanks
you should deploy your app myapp with:
sudo cp -a /home/user/myapp/bin/Debug/netcoreapp2.0/publish/* /var/aspnetcore/myapp
eg.
Copy all files from build folder to deployment location (*.json etc)

Getting "mongod: command not found". Analysis found that rpm is getting deleted

I am evaluating mongodb Enterprise version. I have it running in a RedHat Linux OS. Things were going good till mongod command stopped working suddenly. Our unix admins replied that rpm is getting deleted.
Here is the information i got from admins Any idea on this?
Oct 23 15:39:20 systemd[1]: [/usr/lib/systemd/system/mongod.service:27] Unknown lvalue 'TasksMax' in section 'Service'
Oct 23 15:39:20 systemd[1]: [/usr/lib/systemd/system/mongod.service:28] Unknown lvalue 'TasksAccounting' in section 'Service'
Oct 23 15:39:20 systemd[1]: Started Flexible Branding Service.
Oct 23 15:39:20 systemd[1]: Starting Flexible Branding Service...
Oct 23 15:39:20 yum[93405]: Erased: mongodb-enterprise-server-3.4.9-1.el7.x86_64
Oct 23 15:39:20 yum[93405]: Erased: 1:net-snmp-5.7.2-28.el7.x86_64
Oct 23 15:39:20 systemd[1]: Reloading.
Oct 23 15:39:20 systemd[1]: Started Flexible Branding Service.
Oct 23 15:39:20 systemd[1]: Starting Flexible Branding Service... "
Appreciate your help.
Thanks,
Harin
The systemd introduced this TasksMax setting in version 226
You need to check your version SYSTEMD
sudo systemd --version or sudo systemctl --version
If you systemd is old that the above you need to update link to update systemd
https://linoxide.com/linux-how-to/install-systemd-centos-redhat/
Try this: Set the SELINUX variable in the /etc/selinux/config file like follows:
SELINUX = disabled
Then restart MongoDB.
regards,