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

cause: ValueError('year 55675 is out of range') #186

Open
mclark-ably opened this issue Sep 15, 2023 · 4 comments
Open

cause: ValueError('year 55675 is out of range') #186

mclark-ably opened this issue Sep 15, 2023 · 4 comments

Comments

@mclark-ably
Copy link

Getting this error when consuming from a queue when the message has an epoch timestamp. Is this a bug or is there a workaround?

@mosquito
Copy link
Owner

mosquito commented Sep 15, 2023

Please attach the code example, this should be very helpful

@mclark-ably
Copy link
Author

mclark-ably commented Sep 15, 2023

Sure, heres the code

import os
import asyncio
import aiormq
import ssl
import logging

logging.basicConfig(level=logging.DEBUG)

ably_queue_name = os.environ['ABLY_QUEUE_NAME']
ably_host_endpoint = os.environ['ABLY_HOST_ENDPOINT']
ably_host_port = 5671
ably_api_key = os.environ["ABLY_API_KEY"]
ably_queue_endpoint = f"amqps://{ably_api_key}@{ably_host_endpoint}/shared"

print(ably_api_key)



async def on_message(message):
  print(message.body.timestamp)
    


async def consumer_messages2():
 
  connection = await aiormq.connect(ably_queue_endpoint)
  
  channel = await connection.channel()

  await channel.basic_consume(ably_queue_name,on_message,no_ack=False)


loop = asyncio.get_event_loop()
loop.run_until_complete(consumer_messages2())
loop.run_forever()

And the debug output

DEBUG:asyncio:Using selector: EpollSelector DEBUG:aiormq.connection:Connecting to: amqps://******.******:******@eu-west-1-a-queue.ably.io:5671/shared DEBUG:aiormq.connection:Prepare to send ChannelFrame(payload=b'\x01\x00\x01\x00\x00\x00\x06\x00\x14\x00\n\x010\xce', should_close=False, drain_future=None) DEBUG:aiormq.connection:Received frame <Channel.OpenOk object at 0x7f2ee9353c80> in channel #1 weight=16 on <Connection: "amqps://******.******:******@eu-west-1-a-queue.ably.io:5671/shared" at 0x7f2ee93129d0> DEBUG:aiormq.connection:Prepare to send ChannelFrame(payload=b'\x01\x00\x01\x00\x00\x00\x05\x00U\x00\n\x00\xce', should_close=False, drain_future=None) DEBUG:aiormq.connection:Received frame <Confirm.SelectOk object at 0x7f2ee932ac20> in channel #1 weight=12 on <Connection: "amqps://******.******:******@eu-west-1-a-queue.ably.io:5671/shared" at 0x7f2ee93129d0> DEBUG:aiormq.connection:Prepare to send ChannelFrame(payload=b'\x01\x00\x01\x00\x00\x00D\x00<\x00\x14\x00\x00\x11ATX0YA:mike-queue&ctag1.9a80d364ba954d8789fffe03c032510a\x00\x00\x00\x00\x00\xce', should_close=False, drain_future=None) DEBUG:aiormq.connection:Received frame <Basic.ConsumeOk object at 0x7f2ee93058c0> in channel #1 weight=51 on <Connection: "amqps://******.******:******@eu-west-1-a-queue.ably.io:5671/shared" at 0x7f2ee93129d0> DEBUG:aiormq.connection:Received frame <Basic.Deliver object at 0x7f2ee9384520> in channel #1 weight=79 on <Connection: "amqps://******.******:******@eu-west-1-a-queue.ably.io:5671/shared" at 0x7f2ee93129d0> DEBUG:aiormq.connection:Reader exited for <Connection: "amqps://ATX0YA.AGsQUA:******@eu-west-1-a-queue.ably.io:5671/shared" at 0x7f2ee93129d0> DEBUG:aiormq.connection:Cancelling cause reader exited abnormally DEBUG:aiormq.connection:Sending <Connection.Close object at 0x7f2ee9379490> to <Connection: "amqps://******.******:******@eu-west-1-a-queue.ably.io:5671/shared" at 0x7f2ee93129d0> DEBUG:aiormq.connection:Writer on connection amqps://******.******:******@eu-west-1-a-queue.ably.io:5671/shared closed DEBUG:aiormq.connection:Writer exited for <Connection: "amqps://******.******:******:******@eu-west-1-a-queue.ably.io:5671/shared" at 0x7f2ee93129d0> DEBUG:aiormq.connection:Closing connection <Connection: "amqps://******.******:******:******@eu-west-1-a-queue.ably.io:5671/shared" at 0x7f2ee93129d0> cause: ValueError('year 55675 is out of range')

@mosquito
Copy link
Owner

Could you please add dumped message or another way how can I reproduce it?

@mclark-ably
Copy link
Author

A basic message would look like this

id: '0peB9toeCW:0:0', connectionId: '0peB9toeCW', timestamp: 1695029470478, data: 'hello', name: ''

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