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

Resetting database on regtest fails due to FOREIGN KEY constraint violation #32

Open
AustEcon opened this issue Aug 1, 2022 · 0 comments
Assignees

Comments

@AustEcon
Copy link
Contributor

AustEcon commented Aug 1, 2022

This is a todo task that I don't want to fix right this minute as there are other tasks that take precidence

PS C:\Users\donha> electrumsv-sdk start --inline reference_server
2022-08-01 16:30:17 INFO     runners                  Starting reference_server ...
2022-08-01 16:30:19 DEBUG    logs                     File logging path=C:\Users\donha\AppData\Local\ElectrumSV-SDK\remote_repos\electrumsv-reference-server\localdata\logs\esv_reference_server.log
2022-08-01 16:30:19 DEBUG    server                   Running in regtest mode
2022-08-01 16:30:19 DEBUG    server                   Datastore location C:\Users\donha\AppData\Local\ElectrumSV-SDK\remote_repos\electrumsv-reference-server\localdata\esv_reference_server.sqlite
2022-08-01 16:30:19 INFO     app-state                Dropping database tables
2022-08-01 16:30:19 ERROR    server                   unexpected exception in __main__
Traceback (most recent call last):
  File "C:\Users\donha\AppData\Local\ElectrumSV-SDK\remote_repos\electrumsv-reference-server\server.py", line 159, in <module>
    asyncio.run(main())
  File "C:\Users\donha\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\donha\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
    return future.result()
  File "C:\Users\donha\AppData\Local\ElectrumSV-SDK\remote_repos\electrumsv-reference-server\server.py", line 122, in main
    application_state = ApplicationState(which_network, datastore_location, internal_host,
  File "C:\Users\donha\AppData\Local\ElectrumSV-SDK\remote_repos\electrumsv-reference-server\esv_reference_server\application_state.py", line 116, in __init__
    self.database_context.run_in_thread(_setup_database)
  File "C:\Users\donha\AppData\Local\ElectrumSV-SDK\python_libs\reference_server\electrumsv_database\sqlite.py", line 314, in run_in_thread
    return cast(T1, future.result())
  File "C:\Users\donha\AppData\Local\Programs\Python\Python310\lib\concurrent\futures\_base.py", line 446, in result
    return self.__get_result()
  File "C:\Users\donha\AppData\Local\Programs\Python\Python310\lib\concurrent\futures\_base.py", line 391, in __get_result
    raise self._exception
  File "C:\Users\donha\AppData\Local\ElectrumSV-SDK\python_libs\reference_server\electrumsv_database\sqlite.py", line 362, in __call__
    result = self._fn(*self._args, **self._kwargs, db=db)
  File "C:\Users\donha\AppData\Local\ElectrumSV-SDK\remote_repos\electrumsv-reference-server\esv_reference_server\application_state.py", line 108, in _setup_database
    self.msg_box_repository.drop_tables(db)
  File "C:\Users\donha\AppData\Local\ElectrumSV-SDK\remote_repos\electrumsv-reference-server\esv_reference_server\msg_box\repositories.py", line 53, in drop_tables
    db.execute("DROP TABLE IF EXISTS msg_box_api_token")
sqlite3.IntegrityError: FOREIGN KEY constraint failed
@AustEcon AustEcon self-assigned this Aug 1, 2022
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

1 participant