Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ansible MemoryError when using shell module in playbook #49610
Ansible MemoryError when using shell module in playbook
Ansible MemoryError when using shell module in playbook to import mongodb json collection. I do have 16 GB of ram and in htop whenever I run the playbook on the target machine i see the ram going up to 4 GB but there are more than 10GB free.
I changed the python interpeter as well as combined and mixed modules but still does not work. An exception occurred during task execution. To see the full traceback, use -vvv. The error was: MemoryError
Issue happened as this file json got 1.2 GB a week ago was 500MB and it worked not it doesn't. When I run it manually it imports it but trough python it can't, in the -vvv option I see that the documents were imported but ansible exits with this error...
ansible version 2.7.4 python tried 2.7 and 3.6 the target machine is Ubuntu 18.04
OS / ENVIRONMENT
CentOS 7 master -> Ubuntu 18.04 target
@nvaklinov: Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.
Here are the items we could not find in your description:
Please set the description of this issue with this template:
Thank you for helping me!
Here below I posted the part that fails in my playbook.
Again, thank you very much for your priceless time!
- hosts: MongoDB tasks: - name: copy file from local to MongoDB synchronize: src: /home/temp/events.json dest: /home/ubuntu/mongo/ mode: push - name: import the events into the DB shell: mongoimport --db parties --collection events --file /home/ubuntu/mongo/events.json && rm -rf /home/ubuntu/mongo/events.json register: bash_result become: yes become_method: sudo
Actually this is the error message: An exception occurred during task execution. To see the full traceback, use -vvv. The error was: MemoryError
If I put -vvv the output become ambiguous due to the fact that Mongo produces simply the output of the data insertion however the error is the above.