uWSGI Segmentation Fault - python

After upgrading from Debian Stretch to Bullseye (e.g. Python 3.5 → 3.9) we've got the following uWSGI segfault:
uWSGI process 314459 got Segmentation Fault !!!
*** backtrace of 314459 ***
/usr/bin/uwsgi(uwsgi_backtrace+0x2f) [0x558ed0a9b96f]
/usr/bin/uwsgi(uwsgi_segfault+0x23) [0x558ed0a9bd73]
/lib/x86_64-linux-gnu/libc.so.6(+0x3bd60) [0x7fd71a9e0d60]
/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0(PyErr_Occurred+0xe) [0x7fd7184d247e]
/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0(+0x12d655) [0x7fd718586655]
/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0(_PyType_Lookup+0x2d) [0x7fd71858678d]
/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0(_PyObject_GenericGetAttrWithDict+0x4d) [0x7fd71856a73d]
/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0(+0x1121c9) [0x7fd71856b1c9]
/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0(PyObject_GetAttrString+0x3b) [0x7fd71856730b]
/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0(PyObject_HasAttrString+0x7) [0x7fd718567d87]
/usr/lib/uwsgi/plugins/python3_plugin.so(uwsgi_python_autoreloader_thread+0x179) [0x7fd718a04d19]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8ea7) [0x7fd71b2d3ea7]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7fd71aaa2def]
*** end of backtrace ***
How can we find out what is causing this and how to fix the issue?
Disabling psycopg2 SSL mode does not help.

This line in the backtrace made me think that maybe the issue has something to do with automatic reloading:
/usr/lib/uwsgi/plugins/python3_plugin.so(uwsgi_python_autoreloader_thread+0x179) [0x7fd718a04d19]
Then I found this issue: https://github.com/unbit/uwsgi/issues/1968
As a workaround I disabled autoreload and the service recovered. According to this page autoreloading is only for development purposes.

Related

Cookiecutter Django fails Github Actions on Run pre-commit

***EDIT Issue resolved. Several things needed to be done to setup pre-commit in my environment prior to commit/push.
'git init'
'pre-commit install'
open new terminal, activate venv
'pre-commit run —all-files'
Hope this helps someone in the future.
Junior Web Developer making his first post!
I'm setting up a Python Django project using the Cookie-cutter template https://github.com/cookiecutter/cookiecutter-django
However, upon any commit to GitHub, the GitHub Actions test fails on linter at the Run pre-commit step. I receive the error message: "Error: The process '/opt/hostedtoolcache/Python/3.9.10/x64/bin/pre-commit' failed with exit code 1"
My research indicates this is a generic python linter failure, but it's not clear why it's failing. The slug repo doesn't have any issues and I've setup the project many times, on 3 different machines (2 Macs and 1 Windows), pushing to new repositories each time, slightly modifying the settings each time, not modifying any code after project initialization, sadly receiving the same results.
I'm completely stumped and my progress has come to a stop on this issue. Please note I don't have much experience with GitHub Actions. Part of using this project template is having these nice features work to support future development.
One thing I'm confused about is why python 3.9.10 is being used in the pre-commit step when command "python3 --version" on all my machines I've used to initialize the project is returning python 3.9.9. A simple search in the project for "3.9.10" returns no results.
Below are my relevant project build settings. I've attempted many different combinations, but this is the result I'd like to get to production. Everything builds and runs via Docker-compose locally without issues. Thanks massively for your help and guidance! Some seemingly non-relevant links removed in the code due to reputation limit.
https://github.com/TElphee01/django1
version: 0.1.0
open_source_license: 2 - BSD
timezone: EST
windows: n
use_pycharm: n
use_docker: y
postgresql_version: 14.1
js_task_runner: gulp
cloud_provider: AWS
Mail_service: Mailgun
Use_async:n
Use_drf: y
custom_bootstrap_compilation: n
use_compressor: y
use_celery: y
use_mailhog: y
use_sentry: y
Use_whitenoise: y
use_heroku: y
ci_tool: Github
Keep_local_envs_in_vcs: y
debug: n
Error message found at: https://github.com/TElphee01/django1/runs/5325567134?check_suite_focus=true under Run pre-commit step
Run pre-commit/action#v2.0.3
install pre-commit
/opt/hostedtoolcache/Python/3.9.10/x64/bin/pre-commit run --show-diff-on-failure --color=always --all-files
[INFO] Initializing environment for github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for github.com/psf/black.
[INFO] Initializing environment for github.com/PyCQA/isort.
[INFO] Initializing environment for github.com/PyCQA/flake8.
[INFO] Initializing environment for github.com/PyCQA/flake8:flake8-isort.
[INFO] Installing environment for github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for github.com/psf/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for github.com/PyCQA/isort.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for github.com/PyCQA/flake8.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
trim trailing whitespace.................................................Passed
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook
Fixing README.md
check yaml...............................................................Passed
black....................................................................Passed
isort....................................................................Failed
- hook id: isort
- files were modified by this hook
Fixing /home/runner/work/django1/django1/tefrontend/users/tests/test_views.py
flake8...................................................................Passed
pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
diff --git a/README.md b/README.md
index a64ec04..c4c8a44 100644
Binary files a/README.md and b/README.md differ
diff --git a/tefrontend/users/tests/test_views.py b/tefrontend/users/tests/test_views.py
index ebdc864..4fe526a 100644
--- a/tefrontend/users/tests/test_views.py
+++ b/tefrontend/users/tests/test_views.py
## -11,11 +11,7 ## from django.urls import reverse
from tefrontend.users.forms import UserAdminChangeForm
from tefrontend.users.models import User
from tefrontend.users.tests.factories import UserFactory
-from tefrontend.users.views import (
- UserRedirectView,
- UserUpdateView,
- user_detail_view,
-)
+from tefrontend.users.views import UserRedirectView, UserUpdateView, user_detail_view
pytestmark = pytest.mark.django_db
Error: The process '/opt/hostedtoolcache/Python/3.9.10/x64/bin/pre-commit' failed with exit code 1
It looks like the pre-commit checks have detected some specific issues in your project:
the "end of file" check, which ensures that a file is either empty, or ends with one newline, and
the "isort" check, which has to do with the ordering and formatting of import statements.
In both cases, the tooling is also correcting the problem.
If you were to install and run pre-commit locally, you could just commit the changes it makes and then push your code when the commits pass the checks locally.
If you install pre-commit and then run pre-commit install in your repository, it will be installed as a pre-commit hook so these checks will be run for you automatically when you commit changes.

uwsgi not starting up

I keep getting this error in by terminal after pip install uwsgi and running uwsgi
I've tried various things thinking it is a gcc path error so added the location to libc.so.6 but it didn't help.
SOMEBODY PLEAAASSSEEE help!
!!! uWSGI process 10506 got Segmentation Fault !!!
*** backtrace of 10506 ***
uwsgi(uwsgi_backtrace+0x2c) [0x46429c]
uwsgi(uwsgi_segfault+0x21) [0x464641]
/lib64/libc.so.6(+0x35670) [0x7fc0fe450670]
uwsgi(uwsgi_setup+0x24b) [0x466a5b]
uwsgi(main+0x9) [0x41ac29]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x7fc0fe43cb15]
uwsgi() [0x41ac59]
*** end of backtrace ***
I got the answer...It's because pip install uwsgi needs to be on version 2.0.14 instead of 2.0.15...There is definitely a bug in the newer version!

mpi4py only works under mpiexec

I have set up mpi4py on a new server, and it isn't quite working. When I import mpi4py.MPI, it crashes. However, if I do the same thing under mpiexec, it works. On my other server and on my workstation, both techniques work fine. What am I missing on the new server?
Here's what happens on the new server:
$ python -c 'from mpi4py import MPI; print("OK")'
--------------------------------------------------------------------------
It looks like orte_init failed for some reason; your parallel process is
likely to abort. There are many reasons that a parallel process can
fail during orte_init; some of which are due to configuration or
environment problems. This failure appears to be an internal failure;
here's some additional information (which may only be relevant to an
Open MPI developer):
PMI2_Job_GetId failed failed
--> Returned value (null) (14) instead of ORTE_SUCCESS
--------------------------------------------------------------------------
--------------------------------------------------------------------------
It looks like orte_init failed for some reason; your parallel process is
likely to abort. There are many reasons that a parallel process can
fail during orte_init; some of which are due to configuration or
environment problems. This failure appears to be an internal failure;
here's some additional information (which may only be relevant to an
Open MPI developer):
orte_ess_init failed
--> Returned value (null) (14) instead of ORTE_SUCCESS
--------------------------------------------------------------------------
--------------------------------------------------------------------------
It looks like MPI_INIT failed for some reason; your parallel process is
likely to abort. There are many reasons that a parallel process can
fail during MPI_INIT; some of which are due to configuration or environment
problems. This failure appears to be an internal failure; here's some
additional information (which may only be relevant to an Open MPI
developer):
ompi_mpi_init: ompi_rte_init failed
--> Returned "(null)" (14) instead of "Success" (0)
--------------------------------------------------------------------------
*** An error occurred in MPI_Init_thread
*** on a NULL communicator
*** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,
*** and potentially your MPI job)
[Octomore:45430] Local abort before MPI_INIT completed successfully; not able to aggregate error messages, and not able to guarantee that all other processes were killed!
If I run it with mpiexec, it's fine.
$ mpiexec -np 1 python -c 'from mpi4py import MPI; print("OK")'
OK
I'm running on CentOS 6.7. I've installed Python 2.7 as a software collection, and I've loaded the openmpi/gnu/1.10.2 module. MPICH and MPICH2 are also installed, so they may be conflicting with OpenMPI. I haven't loaded the MPICH modules, though. I'm running Python in a virtualenv:
$ pip list
mpi4py (2.0.0)
pip (8.1.2)
setuptools (18.0.1)
wheel (0.24.0)
It turned out that mpi4py is not compatible with version 1.10.2 of OpenMPI. It works fine with version 1.6.5.
$ module load openmpi/gnu/1.6.5
$ python -c 'from mpi4py import MPI; print("OK")'
OK

GStreamer-CRITICAL buffer

When I execute a gstreamer-1.0 pipeline:
gst-launch-1.0 -evm videotestsrc ! v4l2sink device=/dev/video1
for video loop back using v4l2loopback version 0.6.3 it thows the following error:
"(gst-launch-1.0:17157): GStreamer-CRITICAL **: gst_buffer_get_meta: assertion `buffer != NULL' failed.
The behaviour is inconsistent; in 5 attempts, this error comes appears at least 3 times.
System Environment, Ubuntu 12.10, 32bit, 3.5.0-26-generic kernel.
It looks like some problem with the v4l2loopback element, because when I replace the v4l2lopback with fakesink, it didnt throw any error.

what is this error when deploying google python-appengine application?

this is the error message .. any help will be appreciated .
2011-02-23 23:09:11 Running command: "['C:\\Python25\\pythonw.exe', '-u', 'C:\\Program Files\\Google\\google_appengine\\appcfg.py', '--no_cookies', u'--email=adham587#gmail.com', '--passin', 'update', 'C:\\Users\\adham\\Desktop\\images']"
Application: refacingme; version: 1.
Server: appengine.google.com.
Scanning files on local disk.
Initiating update.
2011-02-23 23:09:42,223 WARNING appengine_rpc.py:405 ssl module not found.
Without the ssl module, the identity of the remote host cannot be verified, and
connections may NOT be secure. To fix this, please install the ssl module from
http://pypi.python.org/pypi/ssl .
To learn more, see http://code.google.com/appengine/kb/general.html#rpcssl .
Password for XXXXX#gmail.com: Error 409: --- begin server output ---
Another transaction by user XXXXXXXX is already in progress for this app and major version. That user can undo the transaction with appcfg.py's "rollback" command.
--- end server output ---
2011-02-23 23:09:46 (Process exited with code 1)
You can close this window now.
This problem can occur if an update is started and does not finish for whatever reason. As the error message notes, the correct thing to do is to give appcfg.py the rollback command. That will undo the failed changes and reset your app so it is ready for an update.
Try
easy_install ssl
The message says that module is missing.
#Adam: duly noted. I apologize for missing the "Warning text".
I believe his error will go away in a while since another operation might be going on at the same time. He should install ssl module nevertheless. If after a while and it doesn't help, he should perform a rollback.
Google App Engine: appcfg.py rollback

Categories

Resources