question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I set "start_date" as datetime but anyway I got this error

See original GitHub issue

Apache Airflow version: 2.0.0

Kubernetes version (if you are using kubernetes) (use kubectl version):

Environment:

  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

What happened:

Python version: 3.8.6 Airflow version: 2.0.0 Node: 48e4ab66fdda

Traceback (most recent call last): File “/home/airflow/.local/lib/python3.8/site-packages/flask/app.py”, line 2447, in wsgi_app response = self.full_dispatch_request() File “/home/airflow/.local/lib/python3.8/site-packages/flask/app.py”, line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File “/home/airflow/.local/lib/python3.8/site-packages/flask/app.py”, line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File “/home/airflow/.local/lib/python3.8/site-packages/flask/_compat.py”, line 39, in reraise raise value File “/home/airflow/.local/lib/python3.8/site-packages/flask/app.py”, line 1950, in full_dispatch_request rv = self.dispatch_request() File “/home/airflow/.local/lib/python3.8/site-packages/flask/app.py”, line 1936, in dispatch_request return self.view_functionsrule.endpoint File “/home/airflow/.local/lib/python3.8/site-packages/airflow/www/auth.py”, line 34, in decorated return func(*args, **kwargs) File “/home/airflow/.local/lib/python3.8/site-packages/airflow/www/decorators.py”, line 60, in wrapper return f(*args, **kwargs) File “/home/airflow/.local/lib/python3.8/site-packages/airflow/www/views.py”, line 1193, in task attr = getattr(ti, attr_name) File “/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py”, line 792, in previous_start_date_success return self.get_previous_start_date(state=State.SUCCESS) File “/home/airflow/.local/lib/python3.8/site-packages/airflow/utils/session.py”, line 65, in wrapper return func(*args, session=session, **kwargs) File “/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py”, line 776, in get_previous_start_date return prev_ti and pendulum.instance(prev_ti.start_date) File “/home/airflow/.local/lib/python3.8/site-packages/pendulum/init.py”, line 174, in instance raise ValueError(“instance() only accepts datetime objects.”) ValueError: instance() only accepts datetime objects.

What you expected to happen:

Get info about task instance

How to reproduce it:

Anything else we need to know:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kaxilcommented, Feb 25, 2021

This is fixed by https://github.com/apache/airflow/pull/14416 and will be released in 2.0.2

1reaction
eladkalcommented, Jan 19, 2021

Can you please share a reproduce example? The traceback suggest that you are using get_previous_start_date in your DAG. I have a guess that you are using one of the prev date success macros and you encounter this error in the first run on Airflow 2.0.0 but not on Airflow 1.10.X?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Conversion error when converting 'nvarchar' to 'datetime' in ...
The way to solve this is to use the (slightly adapted) ISO-8601 date format that is supported by SQL Server - this format...
Read more >
convert character data to datetime - MSDN - Microsoft
Hi! I need to insert character data into a SQL 2005 table in the datetime format. The strings I need to convert are...
Read more >
Dynamic StoredProc: Error from datetime - SQL Server Forums
Error: Syntax error converting character string to smalldatetime data type. I have tried a couple different date formats, but the result is ...
Read more >
Planned start date must be after current date - ServiceNow
I was able to create the Field level error message whenever the planned start date is earlier than the current date. But regardless...
Read more >
Need Help to convert DATETIME result into DATE on SQL ...
I've tried DATETIME2 but not working and the StartDate needs to be '0001-01-01'. Any help with this is highly appreciated.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found