-
Notifications
You must be signed in to change notification settings - Fork 271
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
Dev env sqlite db is not being created? #729
Comments
I think the issue is that we use the same sqlite file for tests and for the dev server, which can make things inconsistent. @Glandos any thoughts about this? should we use another sqlite file for tests? |
It's a weird issue because doing a clean install again on another directory without adding any of my modified files yielded the same error. However I was finally able to view my changes and make some adjustments by doing a clean install on a VM and then adding my changed files. |
|
I tried removing .tox/ directory but I still get the same 4 errors, all of which say Docs, flake8 and black all pass. |
Could you provide the full output of |
|
You are missing #730. I encountered the same issue today 😉 SQLAlchemy 1.4 broke its API, and Without leaving your environment you can:
Remove |
That fixed it, and all tests passed. thanks!! I'll be submitting the PR soon :) |
Hello,
I found this repo and found it very cool and so wanted to contribute.
I followed contributing instructions and got it all set up.
I started making my proposed changes and was using 'make serve' to view the app and do my testing with the demo project.
It was all working fine, I made some last changes and ran make test. I got some errors saying "Hint: make sure your test modules/packages have valid Python names.". I looked this up, and on Stack overflow saw that running pytest directly solved the issue and so I ran "python -m pytest" and saw how all the tests passed.
Afterward, I wanted to go to the demo project again to take screenshots of the proposed changes. I was able to navigate to the home page just fine but then I clicked on the demo and I got this error:
INFO [werkzeug] * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
INFO [werkzeug] 127.0.0.1 - - [02/Apr/2021 20:37:52] "GET / HTTP/1.1" 200 -
INFO [werkzeug] 127.0.0.1 - - [02/Apr/2021 20:37:53] "GET /static/js/popper.min.js.map HTTP/1.1" 404 -
INFO [werkzeug] 127.0.0.1 - - [02/Apr/2021 20:37:53] "GET /static/js/bootstrap.min.js.map HTTP/1.1" 404 -
INFO [werkzeug] 127.0.0.1 - - [02/Apr/2021 20:37:53] "GET /static/css/bootstrap.min.css.map HTTP/1.1" 404 -
ERROR [ihatemoney.run] Exception on /demo [GET] Traceback (most recent call last): File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
cursor, statement, parameters, context File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute cursor.execute(statement, parameters) sqlite3.OperationalError: no such table: project
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/flask_restful/init.py", line 272, in error_router
return original_handler(e)
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/ihatemoney/ihatemoney/web.py", line 574, in demo
project = Project.query.get("demo")
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 959, in get
return self._get_impl(ident, loading.load_on_pk_identity)
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 1068, in _get_impl
return db_load_fn(self, primary_key_identity)
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 282, in load_on_pk_identity
return q.one()
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3274, in one
ret = self.one_or_none()
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3243, in one_or_none
ret = list(self)
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3316, in iter
return self._execute_and_instances(context)
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3341, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 988, in execute
return meth(self, multiparams, params)
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1107, in _execute_clauseelement
distilled_params,
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
e, statement, parameters, cursor, context
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1466, in _handle_dbapi_exception
util.raise_from_cause(sqlalchemy_exception, exc_info)
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 128, in reraise
raise value.with_traceback(tb)
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
cursor, statement, parameters, context
File "/Users/javiercontreras/Desktop/EECS481/481-HW6/env/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: project
[SQL: SELECT project.id AS project_id, project.name AS project_name, project.password AS project_password, project.contact_email AS project_contact_email, project.logging_preference AS project_logging_preference, project.default_currency AS project_default_currency
FROM project
WHERE project.id = ?]
[parameters: ('demo',)]
(Background on this error at: http://sqlalche.me/e/e3q8)
Now I can't view any project but my tests keep passing. Judging by the error message I think maybe by running pytest directly I deleted the db and now it can't find it?
I would appreciate any help, I would really hate all of what I proposed to go to waste because I can't view it anymore
Thanks!!
EDIT: Just to be clear, I am only modifying two HTML files, and adding a function to models.py
The text was updated successfully, but these errors were encountered: