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

database install issues #29

Open
hmcgrath opened this issue Nov 7, 2024 · 11 comments
Open

database install issues #29

hmcgrath opened this issue Nov 7, 2024 · 11 comments

Comments

@hmcgrath
Copy link
Collaborator

hmcgrath commented Nov 7, 2024

installed from dev branch, install successful.
loaded Case 1:

2024-11-07T15:34:52 SUCCESS Plugin installed successfully
2024-11-07T15:35:12 INFO CanCurve : ui populated for testCase 'case1'
2024-11-07T15:35:28 WARNING Python error : An error has occurred while executing Python code: See message log (Python Error) for more details.

CanCurve Log:
2024-11-07T15:35:12 WARNING cc.BldgsDialog: failed to remove the existing project database filepath w/
[WinError 3] The system cannot find the path specified: ''
2024-11-07T15:35:12 INFO cc.BldgsDialog: ui populated for testCase 'case1'
2024-11-07T15:35:28 INFO cc.BldgsDialog.tab4actions_run: start
2024-11-07T15:35:28 INFO cc.BldgsDialog.tab4actions_run:

         Step 1
         ----------------------

2024-11-07T15:35:28 INFO c00: using user-provided depth-replacement-fraction dataset
2024-11-07T15:35:28 INFO load_ci_df: loaded cost-item table (1108, 4)

Python Error:
2024-11-07T15:35:28 WARNING Traceback (most recent call last):
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\assertions.py", line 124, in assert_drf_db
_assert_sqlite_table_exists(conn, 'drf')
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\assertions.py", line 23, in _assert_sqlite_table_exists
cursor = conn.execute("SELECT name FROM sqlite_master WHERE type='table' AND name=?", (table_name, ))
sqlite3.DatabaseError: file is not a database

         During handling of the above exception, another exception occurred:
         
         Traceback (most recent call last):
          File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\dialog.py", line 528, in action_tab4actions_run
          _, _, _, err_msg = self._run_c00_setup_project(logger=log, out_dir=out_dir)
          File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\dialog.py", line 638, in _run_c00_setup_project
          ci_df, drf_df, ofp, err_msg = func(
          File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\core.py", line 802, in c00_setup_project
          drf_df_raw = load_drf(drf_db_fp, log=log, expo_units=expo_units)
          File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\core.py", line 136, in load_drf
          assert_drf_db(conn)
          File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\assertions.py", line 130, in assert_drf_db
          raise AssertionError(f"MasterRuleBook failed expectation check\n {e}")
         AssertionError: MasterRuleBook failed expectation check
          file is not a database
@hmcgrath
Copy link
Collaborator Author

hmcgrath commented Nov 7, 2024

this also might be helpfile:

An error has occurred while executing Python code:

AssertionError: MasterRuleBook failed expectation check file is not a database
Traceback (most recent call last):
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\assertions.py", line 124, in assert_drf_db
_assert_sqlite_table_exists(conn, 'drf')
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\assertions.py", line 23, in _assert_sqlite_table_exists
cursor = conn.execute("SELECT name FROM sqlite_master WHERE type='table' AND name=?", (table_name, ))
sqlite3.DatabaseError: file is not a database

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\dialog.py", line 528, in action_tab4actions_run
_, _, _, err_msg = self._run_c00_setup_project(logger=log, out_dir=out_dir)
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\dialog.py", line 638, in _run_c00_setup_project
ci_df, drf_df, ofp, err_msg = func(
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\core.py", line 802, in c00_setup_project
drf_df_raw = load_drf(drf_db_fp, log=log, expo_units=expo_units)
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\core.py", line 136, in load_drf
assert_drf_db(conn)
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\assertions.py", line 130, in assert_drf_db
raise AssertionError(f"MasterRuleBook failed expectation check\n {e}")
AssertionError: MasterRuleBook failed expectation check
file is not a database

Python version: 3.9.18 (heads/master:5eba59e, Feb 1 2024, 20:02:10) [MSC v.1929 64 bit (AMD64)]
QGIS version: 3.34.5-Prizren Prizren, 4b308492

Python Path:
C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\whitebox_workflows_for_qgis
C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\LAStools
C:/PROGRA1/QGIS331.5/apps/qgis-ltr/./python
C:/Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA1/QGIS331.5/apps/qgis-ltr/./python/plugins
C:\PROGRA1\QGIS331.5\apps\grass\grass83\etc\python
C:\Users\hmcgrath\Documents
C:\Program Files\QGIS 3.34.5\bin\python39.zip
C:\PROGRA1\QGIS331.5\apps\Python39\DLLs
C:\PROGRA1\QGIS331.5\apps\Python39\lib
C:\Program Files\QGIS 3.34.5\bin
C:\PROGRA1\QGIS331.5\apps\Python39
C:\PROGRA1\QGIS331.5\apps\Python39\lib\site-packages
C:\PROGRA1\QGIS331.5\apps\Python39\lib\site-packages\win32
C:\PROGRA1\QGIS331.5\apps\Python39\lib\site-packages\win32\lib
C:\PROGRA1\QGIS331.5\apps\Python39\lib\site-packages\Pythonwin
C:/Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\hmcgrath\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\canflood
C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve

@cefect
Copy link
Collaborator

cefect commented Nov 7, 2024 via email

@hmcgrath
Copy link
Collaborator Author

hmcgrath commented Nov 7, 2024

I did just download a ZIP from dev branch, 2-3 hours ago. is there a new version since then?

Is the DRF been emptied? it is only 1kb, and when I open in sql it seems empty.

@hmcgrath
Copy link
Collaborator Author

hmcgrath commented Nov 8, 2024

downloaded cancurve this morning and reinstalled plugin.
still getting error.

An error has occurred while executing Python code:

AssertionError: MasterRuleBook failed expectation check file is not a database
Traceback (most recent call last):
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\assertions.py", line 124, in assert_drf_db
_assert_sqlite_table_exists(conn, 'drf')
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\assertions.py", line 23, in _assert_sqlite_table_exists
cursor = conn.execute("SELECT name FROM sqlite_master WHERE type='table' AND name=?", (table_name, ))
sqlite3.DatabaseError: file is not a database

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\dialog.py", line 559, in action_tab4actions_step1
self._run_c00_setup_project()
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\dialog.py", line 638, in _run_c00_setup_project
ci_df, drf_df, ofp, err_msg = func(
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\core.py", line 802, in c00_setup_project
drf_df_raw = load_drf(drf_db_fp, log=log, expo_units=expo_units)
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\core.py", line 136, in load_drf
assert_drf_db(conn)
File "C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\bldgs\assertions.py", line 130, in assert_drf_db
raise AssertionError(f"MasterRuleBook failed expectation check\n {e}")
AssertionError: MasterRuleBook failed expectation check
file is not a database

Python version: 3.9.18 (heads/master:5eba59e, Feb 1 2024, 20:02:10) [MSC v.1929 64 bit (AMD64)]
QGIS version: 3.34.5-Prizren Prizren, 4b308492

Python Path:
C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\whitebox_workflows_for_qgis
C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\LAStools
C:/PROGRA1/QGIS331.5/apps/qgis-ltr/./python
C:/Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA1/QGIS331.5/apps/qgis-ltr/./python/plugins
C:\PROGRA1\QGIS331.5\apps\grass\grass83\etc\python
C:\Users\hmcgrath\Documents
C:\Program Files\QGIS 3.34.5\bin\python39.zip
C:\PROGRA1\QGIS331.5\apps\Python39\DLLs
C:\PROGRA1\QGIS331.5\apps\Python39\lib
C:\Program Files\QGIS 3.34.5\bin
C:\PROGRA1\QGIS331.5\apps\Python39
C:\PROGRA1\QGIS331.5\apps\Python39\lib\site-packages
C:\PROGRA1\QGIS331.5\apps\Python39\lib\site-packages\win32
C:\PROGRA1\QGIS331.5\apps\Python39\lib\site-packages\win32\lib
C:\PROGRA1\QGIS331.5\apps\Python39\lib\site-packages\Pythonwin
C:/Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve
C:\Users\hmcgrath\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\canflood

@cefect
Copy link
Collaborator

cefect commented Nov 8, 2024 via email

@cefect cefect changed the title failure to generate code database install issues Nov 8, 2024
@cefect
Copy link
Collaborator

cefect commented Nov 8, 2024

can you check the MasterRuleBook database that installed: both in the .zip file you used and the install location (C:\Users/hmcgrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cancurve\db).

It should be called mrb_20241007.db and should be ~132kb.

I'm guessing something went wrong in the downloading or the extraction of the zip.

Either way, I'll need to improve the error messages.

@hmcgrath
Copy link
Collaborator Author

hmcgrath commented Nov 8, 2024

the database when I download and unzip from github is only 1KB.
image

@cefect
Copy link
Collaborator

cefect commented Nov 8, 2024 via email

@hmcgrath
Copy link
Collaborator Author

hmcgrath commented Nov 8, 2024

the only way I get the full database (132KB) is if I open Desktop GitHub and create a pull request. then copy it to the default place or browse to it in a new location.
I tried download the zip (https://github.com/NRCan/CanCurve/archive/refs/heads/dev.zip) from github, using both Chrome and Edge browsers, both start with database being 1kb before and after unzip.

@cefect
Copy link
Collaborator

cefect commented Nov 11, 2024

Did you try downloading the .zip file from the latest release?

image

@cefect
Copy link
Collaborator

cefect commented Nov 27, 2024

@hmcgrath can I close this?

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