Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception with pool #97

Closed
Reonaydo opened this issue Aug 24, 2016 · 5 comments
Closed

Exception with pool #97

Reonaydo opened this issue Aug 24, 2016 · 5 comments

Comments

@Reonaydo
Copy link
Contributor

Hello!
I used connection pool to reuse connections. All was ok.
But after some time(about 24 hours) I get exception "index out of range" on each second request.
Also rollback also throw exception.
Here traceback:

Aug 24 15:20:18 justinstalledpanel python[930]: Traceback (most recent call last):                                                                                                                                                       
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain/app.py", line 86, in create_domain                                                                                                                             
Aug 24 15:20:18 justinstalledpanel python[930]: if (yield from is_record_exists(name, conn)):                                                                                                                                            
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain/app.py", line 48, in is_record_exists                                                                                                                          
Aug 24 15:20:18 justinstalledpanel python[930]: yield from cur.execute(query, (name,))                                                                                                                                                   
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/aiomysql/cursors.py", line 238, in execute                                                                                    
Aug 24 15:20:18 justinstalledpanel python[930]: yield from self._query(query)                                                                                                                                                            
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/aiomysql/cursors.py", line 459, in _query                                                                                     
Aug 24 15:20:18 justinstalledpanel python[930]: yield from conn.query(q)                                                                                                                                                                 
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/aiomysql/connection.py", line 377, in query                                                                                   
Aug 24 15:20:18 justinstalledpanel python[930]: yield from self._read_query_result(unbuffered=unbuffered)                                                                                                                                
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/aiomysql/connection.py", line 518, in _read_query_result                                                                      
Aug 24 15:20:18 justinstalledpanel python[930]: yield from result.read()                                                                                                                                                                 
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/aiomysql/connection.py", line 736, in read
Aug 24 15:20:18 justinstalledpanel python[930]: yield from self._read_result_packet(first_packet)
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/aiomysql/connection.py", line 806, in _read_result_packet
Aug 24 15:20:18 justinstalledpanel python[930]: yield from self._get_descriptions()
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/aiomysql/connection.py", line 889, in _get_descriptions
Aug 24 15:20:18 justinstalledpanel python[930]: FieldDescriptorPacket)
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/aiomysql/connection.py", line 499, in _read_packet
Aug 24 15:20:18 justinstalledpanel python[930]: packet = packet_type(buff, self._encoding)
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/pymysql/connections.py", line 382, in __init__
Aug 24 15:20:18 justinstalledpanel python[930]: self.__parse_field_descriptor(encoding)
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/pymysql/connections.py", line 390, in __parse_field_descriptor
Aug 24 15:20:18 justinstalledpanel python[930]: self.db = self.read_length_coded_string()
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/pymysql/connections.py", line 331, in read_length_coded_string
Aug 24 15:20:18 justinstalledpanel python[930]: length = self.read_length_encoded_integer()
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/pymysql/connections.py", line 312, in read_length_encoded_integer
Aug 24 15:20:18 justinstalledpanel python[930]: c = self.read_uint8()
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/pymysql/connections.py", line 282, in read_uint8
Aug 24 15:20:18 justinstalledpanel python[930]: result = self._data[self._position]
Aug 24 15:20:18 justinstalledpanel python[930]: IndexError: index out of range
Aug 24 15:20:18 justinstalledpanel python[930]: During handling of the above exception, another exception occurred:
Aug 24 15:20:18 justinstalledpanel python[930]: Traceback (most recent call last):
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/aiohttp/server.py", line 266, in start
Aug 24 15:20:18 justinstalledpanel python[930]: yield from self.handle_request(message, payload)
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/aiohttp/web.py", line 90, in handle_request
Aug 24 15:20:18 justinstalledpanel python[930]: resp = yield from handler(request)
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain/app.py", line 41, in middleware
Aug 24 15:20:18 justinstalledpanel python[930]: return (yield from handler(request))
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain/app.py", line 96, in create_domain
Aug 24 15:20:18 justinstalledpanel python[930]: yield from conn.rollback()
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/aiomysql/connection.py", line 327, in rollback
Aug 24 15:20:18 justinstalledpanel python[930]: yield from self._read_ok_packet()
Aug 24 15:20:18 justinstalledpanel python[930]: File "/var/www/autodomain-venv/lib/python3.4/site-packages/aiomysql/connection.py", line 298, in _read_ok_packet
Aug 24 15:20:18 justinstalledpanel python[930]: raise OperationalError(2014, "Command Out of Sync")
Aug 24 15:20:18 justinstalledpanel python[930]: pymysql.err.OperationalError: (2014, 'Command Out of Sync')
@jettify
Copy link
Member

jettify commented Aug 24, 2016

Hi
could you specify: aimysql, pymysql and python versions. This issue should be solved in master I will do release to PyPI very soon.

@Reonaydo
Copy link
Contributor Author

Hello!

~# python3 -V
Python 3.4.2

~# pip list
aiohttp (0.21.6)
aiomysql (0.0.7)
asyncio (3.4.3)
chardet (2.3.0)
envparse (0.2.0)
pip (1.5.6)
PyMySQL (0.6.7)
setuptools (5.5.1)

@jettify
Copy link
Member

jettify commented Aug 25, 2016

Could you test recent version? Issue should be fixed.

@Reonaydo
Copy link
Contributor Author

About 2 days without errors. It seems that issue fixed. Thank you!

@jettify
Copy link
Member

jettify commented Aug 30, 2016

Thanks for letting us know!

On Tue, 30 Aug 2016 at 07:10 Leonid Popov notifications@github.com wrote:

About 2 days without errors. It seems that issue fixed. Thank you!


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#97 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AANoZyr4v4E43SqG2GZ0C22mGHjbwJfEks5qk60ygaJpZM4Jru4u
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants