# Create module mssql\_query Error port

**URL:** <https://forum.ansible.com/t/create-module-mssql-query-error-port/32085>\
**Category:** Ansible Project\
**Created:** [January 29, 2020, 1:36pm UTC](https://forum.ansible.com/t/create-module-mssql-query-error-port/32085 "2020-01-29T13:36:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karther](https://avatars.discourse-cdn.com/v4/letter/k/3ec8ea/32.png) [@Karther](https://forum.ansible.com/u/Karther)\
**Post date:** [January 29, 2020, 1:36pm UTC](https://forum.ansible.com/t/create-module-mssql-query-error-port/32085/1 "2020-01-29T13:36:36Z")

</div>

Hello,

I have create this module mssql\_query.py in ansible in /library/mssql\_query.py :

[https://github.com/melmorabity/ansible-mssql-query/blob/master/mssql\_query.py](https://github.com/melmorabity/ansible-mssql-query/blob/master/mssql_query.py)

I have this error :

The error was: TypeError: connect() got an unexpected keyword argument ‘port’

when i execut this task :

- local\_action:  
module: mssql\_query  
login\_host: my\_host  
login\_user: my\_user  
login\_password: my\_password  
query: SELECT \* FROM dbo.my\_table\_1  
db: my\_database  
autocommit: True  
as\_dict: false  
delegate\_to: localhost

Like without port: 1433 i have the same error…

I don’t know why ?

Can you help me please !!

Best Regards,

Karther

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [January 29, 2020, 1:42pm UTC](https://forum.ansible.com/t/create-module-mssql-query-error-port/32085/2 "2020-01-29T13:42:24Z")

</div>

> Hello,
> 
> I have create this module mssql\_query.py in ansible in /library/mssql\_query.py :
> 
> [https://github.com/melmorabity/ansible-mssql-query/blob/master/mssql\_query.py](https://github.com/melmorabity/ansible-mssql-query/blob/master/mssql_query.py)
> 
> I have this error :
> 
> The error was: TypeError: connect() got an unexpected keyword argument 'port'
> 
> when i execut this task :
> 
> - local\_action:  
> module: mssql\_query  
> login\_host: my\_host  
> login\_user: my\_user  
> login\_password: my\_password  
> query: SELECT \* FROM dbo.my\_table\_1  
> db: my\_database  
> autocommit: True  
> as\_dict: false  
> delegate\_to: localhost
> 
> Like without port: 1433 i have the same error....
> 
> I don't know why ?
> 
> Can you help me please !!

This is now really off topic, but I suppose port should be an integer instead of a string.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![Karther](https://avatars.discourse-cdn.com/v4/letter/k/3ec8ea/32.png) [@Karther](https://forum.ansible.com/u/Karther)\
**Post date:** [January 30, 2020, 8:54am UTC](https://forum.ansible.com/t/create-module-mssql-query-error-port/32085/3 "2020-01-30T08:54:42Z")

</div>

Hello,

I have the same error like with port int in my programme python

The creation module Ansible in well in contexte “Ansible project” … 😕

Thanks you

Karther
