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

DatabaseError('database disk image is malformed') when importing multiple tickers #1674

Closed
Byunk opened this issue Sep 2, 2023 · 6 comments

Comments

@Byunk
Copy link

Byunk commented Sep 2, 2023

I believe this is the same bug as #1573, and it sporadically occurs but is observed quite frequently.

Simple code that reproduces your problem

data = yf.download(["JPM", "BAC", "WFC", "C"], period="10y")

Debug log

[*********************100%%**********************]  4 of 4 completed

3 Failed downloads:
['BAC', 'JPM', 'WFC']: DatabaseError('database disk image is malformed')
The Column Header : [('Date', ''), ('Close', 'BAC'), ('Close', 'C'), ('Close', 'JPM'), ('Close', 'WFC')]
           Date Close                   
                  BAC          C JPM WFC
0    2013-09-03   NaN  49.369999 NaN NaN
1    2013-09-04   NaN  49.599998 NaN NaN
2    2013-09-05   NaN  49.860001 NaN NaN
3    2013-09-06   NaN  49.220001 NaN NaN
4    2013-09-09   NaN  50.090000 NaN NaN
...         ...   ...        ...  ..  ..
2513 2023-08-28   NaN  41.320000 NaN NaN
2514 2023-08-29   NaN  41.720001 NaN NaN
2515 2023-08-30   NaN  41.369999 NaN NaN
2516 2023-08-31   NaN  41.290001 NaN NaN
2517 2023-09-01   NaN  41.590000 NaN NaN

[2518 rows x 5 columns]

yfinance version

0.2.28

Python version

3.9.15

Operating system

macOS 13.4.1

@ValueRaider
Copy link
Collaborator

That's not debug log. Run with yf.enable_debug_mode()

@Byunk
Copy link
Author

Byunk commented Sep 3, 2023

@ValueRaider Unfortunately, it cannot be reproduce with yf.enable_debug_mode(), still be occasionally observed though. Is it related to how frequently call API so that it affected by logging?

@ValueRaider
Copy link
Collaborator

No, this is an internal bug. Anything unusual about your environment? E.g. cloud or multiple process instances?

@Byunk
Copy link
Author

Byunk commented Sep 3, 2023

Probably nothing unusual. I ran with my local macOS environment, and it occurs either while it runs with few other processes are running or no process is running at the same time.

@ValueRaider
Copy link
Collaborator

Can you try Git branch hotfix/database-error? #1080

@Byunk
Copy link
Author

Byunk commented Sep 4, 2023

@ValueRaider It seems to work properly now. Thank you 👍

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