Hi here, I have another issue when switching from ...
# help
x
Hi here, I have another issue when switching from a local postgresql server to Aurora PostgreSQL(Engine version 11.9) . Any idea what when wrong?
Copy code
time="2021-04-02T20:56:29Z" level=error msg="Failed to migrate" func="pkg/db.(*DatabaseMigrator).Migrate" file="build/pkg/db/migration.go:44" direction=up error="sql: Scan error on column index 0, name \"current_schema\": converting NULL to string is unsupported in line 0: SELECT CURRENT_SCHEMA()" host=<http://lakefs.charlie.kariusdx.com|lakefs.charlie.kariusdx.com> method=POST path=/api/v1/setup_lakefs request_id=6da192ba-ca43-4495-973c-4715afda9ad3 service_name=rest_api
y
Hey @Xubo Fei, perhaps you are using a non-default schema name in your connection string? If your database connection string in the lakeFS configuration includes the
search_path
parameter, you need to create this schema on your database.
For example, if your configuration includes
?search_path=my_schema
, you need to run
CREATE SCHEMA my_schema;
on your database.
Alternatively, drop the
search_path
parameter to use the default schema (usually called "public")
x
Copy code
<postgres://lakefs:XXXXX@XXXX:5432/lakefs>
y
Looks good
Maybe the "lakefs" database does not exist
x
(base) ~  psql -h localhost -p 5400 -U lakefs Password for user lakefs: psql (10.15, server 11.9) WARNING: psql major version 10, server major version 11. Some psql features might not work. SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off) Type “help” for help. lakefs=> \dn List of schemas Name | Owner --------+---------- public | postgres (1 row)
y
Did you create such a database / user?
thanks!
x
yes
y
can you run
\l
?
x
Copy code
lakefs=> \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
 lakefs    | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres         +
           |          |          |             |             | postgres=CTc/postgres+
           |          |          |             |             | lakefs=CTc/postgres
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 rdsadmin  | rdsadmin | UTF8     | en_US.UTF-8 | en_US.UTF-8 | rdsadmin=CTc/rdsadmin
 template0 | rdsadmin | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/rdsadmin          +
           |          |          |             |             | rdsadmin=CTc/rdsadmin
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
(5 rows)
y
and how about
SELECT CURRENT_SCHEMA()
?
x
Copy code
lakefs=> SELECT CURRENT_SCHEMA();
 current_schema
----------------

(1 row)
y
so you're not able for example to do
\dt
?
x
Copy code
lakefs=> \dt
Did not find any relations.
its empty database
y
And after running
SET search_path TO public
, does the output of
SELECT CURRENT_SCHEMA();
return something?
x
Copy code
lakefs=> SET search_path TO public;
SET
lakefs=> SELECT CURRENT_SCHEMA();
 current_schema
----------------

(1 row)
y
I see
I will try to spin up an Aurora and see if I can reproduce this. Sorry for the inconvenience
x
Copy code
lakefs=> SHOW search_path;
 search_path
-------------
 public
(1 row)
Thanks Yoni.
y
I think the reason is, that the
lakefs
database is not owned by the user lakefs
Can you try to delete this database and re-create it with the lakefs user?
x
progressed. but
Copy code
permission denied to create extension \"pgcrypto
looks like it need some addtional permission
y
Yes, the user needs to have the CREATE permission on the database
x
nice works now. Thanks for your help @Yoni Augarten!
🎉 1
y
Sure!
@Xubo Fei could you tell me what the problem was with the "CURRENT_SCHEMA" issue? For future reference
x
as you suggested. the 
lakefs
 database is not owned by the user lakefs
I dropped database and use lakefs user to create the db.
y
Great! Thanks
Please let us know if you run into any (more) issues
👍 1
j
@Ingrid Rosselis Sant Ana Da Cunha
👀 1