Comments (12)
The fix involved ensuring that dependent tables are specified when updating the cache with a newly-added table. This is fixed in peewee master branch. I will push a new release (will be 3.3.4) shortly.
from sqlite-web.
Is there any table that has a foreign key to sample?
from sqlite-web.
Looking more closely it looks like you have a table named expression that has a foreign key to sample. Can you share the full schema? You can do this by opening sqlite shell and running ".schema" at the prompt.
from sqlite-web.
yes, there is
create table expression(sample varchar(80)
, gene_symbol varchar(40)
, tpm double
, log2_tpm double
, PRIMARY KEY (sample, gene_symbol)
, FOREIGN KEY (gene_symbol) references gene(gene_symbol)
, FOREIGN KEY (sample) references sample(sample))
But the error occurs also when I click on expression
and there is no table referencing expression.
from sqlite-web.
Ah, actually I just noticed:
- at the time the error occured,
expression
was not yet generated - now, as
expression
exists, I can click onsample
without error. - Clicking on
expression
still produces the error (there is no table referencing expression)
from sqlite-web.
Are you using sqlite-web to load data? What do you mean "generated"?
I'd like to be able to reproduce the issue.
from sqlite-web.
by "generating" I mean executing the create table
in the sqlite-web query interface.
To load data, I use an R script, although the issue occured also when the tables were still empty. (at least sample and expression were empty).
from sqlite-web.
Cool. Can you share the queries you executed? So I can replicate the issue.
from sqlite-web.
I don't have time right now, but I will try to set-up a full reproducible example during the next week.
from sqlite-web.
I'm going to close this and will re-open after you've commented. You will still be able to comment when you have time, even though it's closed. I'll reopen it at that point.
from sqlite-web.
Here we go!
Steps to reproduce.
- I created a clean environment using anaconda
conda create -n sqlite-web-test
source activate sqlite-web-test
pip install sqlite-web
python --version
Python 3.6.5 :: Anaconda custom (64-bit)
- create a database with a single table
sqlite3 test.sqlite "create table gene(gene_symbol varchar(40) primary key);"
- run sqlite-web
sqlite_web test.sqlite
-
open the web interface, click on the
gene
table. Click onQuery
. -
create the table using
Query
in the web interface.
create table expression(sample varchar(80)
, gene_symbol varchar(40)
, tpm double
, foreign key (gene_symbol) references gene(gene_symbol))
- click on the
expression
table. Experience an Internal Server Error.
from sqlite-web.
Traceback:
Traceback (most recent call last):
File "/home/charles/pypath/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/charles/pypath/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/charles/pypath/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/charles/pypath/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/charles/pypath/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./sqlite_web.py", line 202, in inner
return fn(table, *args, **kwargs)
File "./sqlite_web.py", line 218, in table_structure
ds_table = dataset[table]
File "/home/charles/pypath/playhouse/dataset.py", line 63, in __getitem__
self.update_cache(table)
File "/home/charles/pypath/playhouse/dataset.py", line 92, in update_cache
literal_column_names=True)
File "/home/charles/pypath/playhouse/reflection.py", line 598, in generate_models
literal_column_names=literal_column_names)
File "/home/charles/pypath/playhouse/reflection.py", line 586, in introspect
related_name=related_names.get(src))
File "/home/charles/pypath/playhouse/reflection.py", line 120, in set_foreign_key
self.rel_model = model_names[foreign_key.dest_table]
KeyError: u'gene'
After restarting the application, the table loads up fine, so this looks to be a cache-invalidation type of issue.
from sqlite-web.
Related Issues (20)
- Internal Server Error when browse database content HOT 3
- Value is not a numeric/real. for allow null HOT 3
- Value is not a numeric/real. for allow null HOT 2
- Suggestion Features HOT 1
- Hide long value from list HOT 3
- Feature: Put delete button beside rows HOT 1
- Long table names cause layout issues HOT 1
- Headless operation does not work HOT 4
- sqlite-web errors when trying to drop a column HOT 2
- Encoding HOT 6
- Support multiple DB's HOT 4
- How to specify SQLITE_WEB_PASSWORD in k8s deploy? HOT 1
- admin password is not encrypted and it's not secure HOT 3
- peewee.OperationalError: unknown tokenizer: mozporter when opening Thunderbirds global-messages.sqlite HOT 1
- Docker Image for arm 64 HOT 1
- The switch from POST to GET for queries creates problems for queries with new lines inside the Home Assistant Addon HOT 15
- Forgotten DockerHub image HOT 2
- Bookmark drop down in query not visible on IOS devices HOT 2
- Log file is not created and logging is printed to console HOT 1
- Are other DB's planned? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlite-web.