crawl / sequell

##crawl bot Sequell; depends on https://github.com/crawl/go-sequell
40 stars 25 forks source link

`seqdb load ` fails with error `panic: pq: relation "l_file" does not exist` #40

Closed Pipeliner closed 9 years ago

Pipeliner commented 9 years ago

I'm trying to run a local instance of Sequell to analyze my offline games. In order to build all the environment it needs I wrote step by step the following Dockerfile:

FROM phusion/baseimage
ADD . /sequell
RUN apt-get update -y 
RUN apt-get install -y golang ruby perl make postgresql git postgresql-contrib build-essential mercurial
RUN apt-get install -y libpthread-stubs0-dev wget
RUN  wget https://re2.googlecode.com/files/re2-20140304.tgz && tar xvf re2*.tgz && cd re2 && make && make install
RUN chown -R postgres:postgres /sequell
RUN    /etc/init.d/postgresql start &&\
    sudo -u postgres psql --command "CREATE USER sequell WITH SUPERUSER PASSWORD 'sequell';" &&\
    sudo -u postgres createdb -O sequell sequell &&\
    sudo -u postgres psql -d sequell --command "CREATE EXTENSION citext;"
ENV GOPATH /go
RUN mkdir /go
RUN cd sequell && make
ENV PATH /go/bin:$PATH
ENV PERL_MM_USE_DEFAULT 1

RUN cpan -i DBI
RUN apt-get install -y libpq-dev
RUN cpan -i DBD::Pg
RUN cpan -i DBD::SQLite
RUN cpan -i Bot::BasicBot
RUN cpan -i YAML::XS
RUN cpan -i YAML::Any
RUN cpan -i Tie::Cache
RUN cpan -i File::Next
RUN cpan -i App::Nopaste
RUN cpan -i re::engine::RE2
RUN cpan -i Lingua::Stem
RUN cpan -i Text::Levenshtein::Damerau
RUN cpan -i Text::Levenshtein::Damerau::XS
RUN cpan -i JSON
RUN cpan -i Sub::Recursive
RUN cpan -i HTML::Entities

# RUN cd /sequell && scripts/install-perl-modules && gem install bundler && bundle install
RUN apt-get install -y bundler libsqlite3-dev
WORKDIR /sequell
RUN bundle install
RUN apt-get install -y postgresql-9.3-orafce
USER postgres
RUN /etc/init.d/postgresql start && psql -d sequell --command "CREATE EXTENSION orafce;"
RUN /etc/init.d/postgresql start && seqdb --host /var/run/postgresql createdb 
RUN /etc/init.d/postgresql start && seqdb fetch 
RUN /etc/init.d/postgresql start && seqdb load 
RUN /etc/init.d/postgresql start && seqdb create-indexes

Building it fails on seqdb load stage with the following error:

panic: pq: relation "l_file" does not exist

While all the previous difficulties resolved by splitting install commands and installing requirements not mentioned, this issue seem to be from some relation (table?) not created or referenced incorrectly.

greensnark commented 9 years ago

Use seqdb newdb to create the database and tables.

If you want to use createdb, you need to explicitly run seqdb create-tables afterwards: createdb just creates an empty Postgres db.

greensnark commented 9 years ago

Closing