Impossible to do a query in sqlite


#1

Hi all,
I have created a connection to a sqlite file, that has inside the table test.

But if I run the query redash gives me “no such table”.

select * from test

What’s wrong?

Thank you


#2

Probably my question has a really simple answer, but I do not find a solution and I’m blocked :frowning2:

Thank you


#3

Hi, I’m doing some simple tests and I had the same problem.


#4

Did you create the database file inside your Docker container or on a volume?


#5

Hi @arikfr I have created the db in my PC desktop and than I have moved it a folder shared with my docker container, and I have no problem with connection test, redash connects to my sqlite db, but it gives me “no such table”.

Please look a this short video:


#6

Give it a full path. When you specify just dummy.db it’s probably opened in a path relative to the code and probably not where you set the volume to mount. In such case sqlite just creates a new database file, which obviously doesn’t have your table/data.


#7

Hi @arikfr now I see it, but I have the same error, “no such table”

Thank you


#8

I my docker installation I have 3 container:

  • redash_nginx_1
  • redash_worker_1
  • redash_server_1
  • redash_postgres_1
  • redash_redis_1

The web interface that I use to set new datasource is redash_worker?


#9

Share it with the worker and server.


#10

Hi @arikfr please be still patient with me :slight_smile:

Below you have my configuration, but I’m not a docker user.
I have only restarted docker. Do I must give some “build” parameters to pass the new volumes parameters?

I have moved my sqlite in /var/redash/shared/ondata, but once again I have “no such table: test”

version: '2'
services:
  server:
    image: redash/redash:latest
    volumes:
      - /var/redash/shared/ondata
    command: server
    depends_on:
      - postgres
      - redis
    ports:
      - "5000:5000"
    environment:
      PYTHONUNBUFFERED: 0
      REDASH_LOG_LEVEL: "INFO"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
      REDASH_COOKIE_SECRET: ******
      REDASH_WEB_WORKERS: 4
  worker:
    image: redash/redash:latest
    volumes:
      - /var/redash/shared/ondata
    command: scheduler
    environment:
      PYTHONUNBUFFERED: 0
      REDASH_LOG_LEVEL: "INFO"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
      QUEUES: "queries,scheduled_queries,celery"
      WORKERS_COUNT: 2
  redis:
    image: redis:3.0-alpine
  postgres:
    image: postgres:9.5.6-alpine
    volumes:
      - /var/redash/shared/ondata
  nginx:
    image: redash/nginx:latest
    ports:
      - "8188:80"
    depends_on:
      - server
    links:
      - server:redash

#11

Hi @arikfr I’m blocked :frowning:

What’s wrong in your opinion?

Thank you


#12

Usually when doing changes to the definitions, you need to rebuild the image(s).