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

AttributeError: 'LogRecord' object has no attribute 'asctime' #12

Open
artplan1 opened this issue Nov 17, 2023 · 2 comments
Open

AttributeError: 'LogRecord' object has no attribute 'asctime' #12

artplan1 opened this issue Nov 17, 2023 · 2 comments

Comments

@artplan1
Copy link

Traceback (most recent call last):
File \"/usr/local/lib/python3.11/site-packages/scrapeops_scrapy/core/error_logger.py\", line 141, in emit
dateTime = record.asctime
^^^^^^^^^^^^^^
AttributeError: 'LogRecord' object has no attribute 'asctime'
@bemayr
Copy link

bemayr commented Jan 9, 2024

I just stumbled upon this same problem after an unfortunate chain of dependency issues.
After trying to deploy a Scrapy project with the ScrapeOps integration to Zyte, the deploy failed, because of incompatible versions of urllib3.

botocore 1.31.49 has requirement urllib3<1.27,>=1.25.4, but you have urllib3 2.1.0

After digging into this I suspect that Zyte internally uses botocore for their S3 integrations and this issue is related to boto/botocore#2926 (which is a pity).
So I started to downgrade my elastic integration, because it caused issues with urllib3 as well, but found out that this package conflicts with urllib3 as well.
As introduced in 6e0e211, version 0.5.4 now relies on 2.1.0 of urllib3 which raises the conflict.

So, I suspect that @artplan1 uses version 0.5.3 of this package, which raises this error because of the missing if hasattr(record, 'message'): in error_logger.py.
Version 0.5.4 works without a problem locally. 👏

@arnoldschan
Copy link

Scrapeops version 0.5.4 still raises this issue

Python 3.10.8 on Macbook Air M2

scrapeops_scrapy   0.5.4

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

3 participants