# mssql\_script module - Segmentation fault  error

**URL:** <https://forum.ansible.com/t/mssql-script-module-segmentation-fault-error/37992>\
**Category:** Ansible Project\
**Created:** [May 16, 2023, 6:47am UTC](https://forum.ansible.com/t/mssql-script-module-segmentation-fault-error/37992 "2023-05-16T06:47:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shloco](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@shloco](https://forum.ansible.com/u/shloco)\
**Post date:** [May 16, 2023, 6:47am UTC](https://forum.ansible.com/t/mssql-script-module-segmentation-fault-error/37992/1 "2023-05-16T06:47:16Z")

</div>

I’m running the bellow play

- name: Setup url

run\_once: true

community.general.mssql\_script:

login\_user: “{{ mssql\_login\_user }}”

login\_password: “{{ mssql\_login\_password }}”

login\_host: “{{ mssql\_host }}”

login\_port: “{{ mssql\_port }}”

db: MSSQLDB

script: “SELECT 1”

register: result\_params

on remote host - Python 3.6.8 , pymssql-2.2.7

I get the error bellow

fatal: [hostname]: FAILED! =\> {

“ansible\_facts”: {

“discovered\_interpreter\_python”: “/usr/libexec/platform-python”

},

“changed”: false,

“module\_stderr”: “Shared connection to hostname closed.\r\n”,

“module\_stdout”: “/bin/sh: line 1: 3580297 Segmentation fault (core dumped) /usr/libexec/platform-python /home/svc/.ansible/tmp/ansible-tmp-1684217329.507804-55251-184388487997846/AnsiballZ\_mssql\_script.py\r\n”,

“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,

“rc”: 139

}

---

<div class="post-metadata">

**Author:** ![Nicolas\_Ortiz](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@Nicolas\_Ortiz](https://forum.ansible.com/u/Nicolas_Ortiz)\
**Post date:** [June 22, 2023, 7:59pm UTC](https://forum.ansible.com/t/mssql-script-module-segmentation-fault-error/37992/2 "2023-06-22T19:59:14Z")

</div>

The error message you provided indicates a segmentation fault in the execution of the Ansible module mssql\_script on the remote host. A segmentation fault typically occurs when a program attempts to access memory that it is not allowed to access, leading to a crash.

There could be multiple reasons for this error, including compatibility issues, incorrect installation, or system-specific configurations. Here are a few suggestions to troubleshoot and resolve the issue:

Check compatibility: Ensure that the version of pymssql (2.2.7) you installed is compatible with the version of Python (3.6.8) on the remote host. Verify if there are any specific compatibility requirements mentioned in the pymssql documentation.

Verify installation: Double-check that pymssql is correctly installed on the remote host. You can try importing pymssql in a Python interactive session on the remote host to verify if it can be imported without any errors.

Review system-specific configurations: Some systems might require additional configurations or dependencies for pymssql to function properly. Ensure that all the necessary dependencies are installed on the remote host. Check if there are any specific system requirements mentioned in the pymssql documentation.

Update pymssql and dependencies: If possible, try updating pymssql to the latest version. It could include bug fixes or improvements that address the issue you are facing. Additionally, make sure all the required dependencies (such as FreeTDS) are up to date.

Enable verbose output: Modify your Ansible playbook to enable verbose output by adding the -vvv option. This can provide more detailed information about the error and help pinpoint the cause.

Review system logs: Check the system logs on the remote host for any relevant error messages or additional information related to the segmentation fault. The logs may provide clues about the underlying cause.
