Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Can not use the migration tool #22

Closed
feliu opened this issue Nov 29, 2017 · 4 comments
Closed

Can not use the migration tool #22

feliu opened this issue Nov 29, 2017 · 4 comments

Comments

@feliu
Copy link

feliu commented Nov 29, 2017

Steps to reproduce the error:

  1. subzero base-project
  2. cd project/
  3. docker-compose up -d
  4. subzero migrations init

Error:

bash-3.2# subzero migrations init
Writing database dump to /Users/adasia/Desktop/project/tmp/dev-initial.sql
pg_dumpall: could not open the output file "/src/tmp/dev-initial.sql.roles": Permission denied
pg_dump: [archiver] could not open output file "/src/tmp/dev-initial.sql.schema": Permission denied
fs.js:651
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^

Error: ENOENT: no such file or directory, open '/Users/adasia/Desktop/project/tmp/dev-initial.sql.roles'
at Object.fs.openSync (fs.js:651:18)
at Object.fs.readFileSync (fs.js:553:33)
at dumpSchema (/Users/adasia/PycharmProjects/subzero-cli/dist/migrations.js:162:28)
at initMigrations (/Users/adasia/PycharmProjects/subzero-cli/dist/migrations.js:45:3)
at Command. (/Users/adasia/PycharmProjects/subzero-cli/dist/migrations.js:208:32)
at Command.listener (/Users/adasia/PycharmProjects/subzero-cli/node_modules/commander/index.js:315:8)
at emitTwo (events.js:125:13)
at Command.emit (events.js:213:7)
at Command.parseArgs (/Users/adasia/PycharmProjects/subzero-cli/node_modules/commander/index.js:653:12)
at Command.parse (/Users/adasia/PycharmProjects/subzero-cli/node_modules/commander/index.js:475:21)

The tmp folder is empty. Thanks in advance!

@ruslantalpa
Copy link
Member

how did you create the project/ directory and what are it's "permissions". Also, are you using the master (compiled from source) or the version published on npm? What OS?

here is how the process looks on my computer

________________________________________________________________________________
| ~/tmp/vvv @ 192-168-0-100 (ruslantalpa) 
| => subzero base-project
? Enter the directory path where you want to create the project project
? Choose the starter kit postgrest-starter-kit (REST)
Cloning into 'project'...
remote: Counting objects: 523, done.
remote: Total 523 (delta 0), reused 0 (delta 0), pack-reused 523
Receiving objects: 100% (523/523), 1.11 MiB | 998.00 KiB/s, done.
Resolving deltas: 100% (209/209), done.
Checking connectivity... done.

You can now do:

git remote add origin <your git repo url here>
git push -u origin master

________________________________________________________________________________
| ~/tmp/vvv @ 192-168-0-100 (ruslantalpa) 
| => cd project/
total 32
-rw-r--r--   1 ruslantalpa  staff    27B Nov 29 13:31 .babelrc
-rw-r--r--   1 ruslantalpa  staff   743B Nov 29 13:31 .env
drwxr-xr-x  13 ruslantalpa  staff   442B Nov 29 13:31 .git/
-rw-r--r--   1 ruslantalpa  staff    12B Nov 29 13:31 .gitignore
-rw-r--r--   1 ruslantalpa  staff   1.1K Nov 29 13:31 LICENSE.txt
-rw-r--r--   1 ruslantalpa  staff   7.2K Nov 29 13:31 README.md
drwxr-xr-x   4 ruslantalpa  staff   136B Nov 29 13:31 db/
-rw-r--r--   1 ruslantalpa  staff   3.8K Nov 29 13:31 docker-compose.yml
drwxr-xr-x   7 ruslantalpa  staff   238B Nov 29 13:31 openresty/
-rw-r--r--   1 ruslantalpa  staff   737B Nov 29 13:31 package.json
drwxr-xr-x   3 ruslantalpa  staff   102B Nov 29 13:31 postgrest/
________________________________________________________________________________
| ~/tmp/vvv/project @ 192-168-0-100 (ruslantalpa) 
| => docker-compose up -d
WARNING: The MAX_ROWS variable is not set. Defaulting to a blank string.
WARNING: The PRE_REQUEST variable is not set. Defaulting to a blank string.
Creating network "postgreststarterkit_default" with the default driver
Creating postgreststarterkit_db_1 ... 
Creating postgreststarterkit_rabbitmq_1 ... 
Creating postgreststarterkit_db_1
Creating postgreststarterkit_db_1 ... done
Creating postgreststarterkit_postgrest_1 ... 
Creating postgreststarterkit_rabbitmq_1 ... done
Creating postgreststarterkit_pg_amqp_bridge_1 ... 
Creating postgreststarterkit_postgrest_1 ... done
Creating postgreststarterkit_openresty_1 ... 
Creating postgreststarterkit_openresty_1 ... done
________________________________________________________________________________
| ~/tmp/vvv/project @ 192-168-0-100 (ruslantalpa) 
| => subzero dashboard
________________________________________________________________________________
| ~/tmp/vvv/project @ 192-168-0-100 (ruslantalpa) 
| => subzero migrations init
Writing database dump to /Users/ruslantalpa/tmp/vvv/project/tmp/dev-initial.sql
Created sqitch.conf
Created sqitch.plan
Created deploy/
Created revert/
Created verify/
Created deploy/0000000001-initial.sql
Created revert/0000000001-initial.sql
Created verify/0000000001-initial.sql
Added "0000000001-initial" to sqitch.plan
Diffing /Users/ruslantalpa/tmp/vvv/project/tmp/dev-initial.sql and /Users/ruslantalpa/tmp/vvv/project/tmp/prod-initial.sql
Writing the result to /Users/ruslantalpa/tmp/vvv/project/db/migrations/revert/0000000001-initial.sql
Copying /Users/ruslantalpa/tmp/vvv/project/tmp/dev-initial.sql to /Users/ruslantalpa/tmp/vvv/project/db/migrations/deploy/0000000001-initial.sql
________________________________________________________________________________
| ~/tmp/vvv/project @ 192-168-0-100 (ruslantalpa) 
| => ls -al
total 32
drwxr-xr-x  13 ruslantalpa  staff   442 Nov 29 13:32 .
drwxr-xr-x   3 ruslantalpa  staff   102 Nov 29 13:31 ..
-rw-r--r--   1 ruslantalpa  staff    27 Nov 29 13:31 .babelrc
-rw-r--r--   1 ruslantalpa  staff   743 Nov 29 13:31 .env
drwxr-xr-x  13 ruslantalpa  staff   442 Nov 29 13:31 .git
-rw-r--r--   1 ruslantalpa  staff    12 Nov 29 13:31 .gitignore
-rw-r--r--   1 ruslantalpa  staff  1100 Nov 29 13:31 LICENSE.txt
-rw-r--r--   1 ruslantalpa  staff  7406 Nov 29 13:31 README.md
drwxr-xr-x   5 ruslantalpa  staff   170 Nov 29 13:32 db
-rw-r--r--   1 ruslantalpa  staff  3885 Nov 29 13:31 docker-compose.yml
drwxr-xr-x   7 ruslantalpa  staff   238 Nov 29 13:31 openresty
-rw-r--r--   1 ruslantalpa  staff   737 Nov 29 13:31 package.json
drwxr-xr-x   3 ruslantalpa  staff   102 Nov 29 13:31 postgrest
________________________________________________________________________________
| ~/tmp/vvv/project @ 192-168-0-100 (ruslantalpa) 
| => cd ..
total 0
drwxr-xr-x  13 ruslantalpa  staff   442B Nov 29 13:32 project/
________________________________________________________________________________
| ~/tmp/vvv @ 192-168-0-100 (ruslantalpa) 
| => ls -al
total 0
drwxr-xr-x   3 ruslantalpa  staff  102 Nov 29 13:31 .
drwxr-xr-x  15 ruslantalpa  staff  510 Nov 29 13:31 ..
drwxr-xr-x  13 ruslantalpa  staff  442 Nov 29 13:32 project
________________________________________________________________________________
| ~/tmp/vvv @ 192-168-0-100 (ruslantalpa) 
| => 

@feliu feliu closed this as completed Dec 2, 2017
@feliu
Copy link
Author

feliu commented Dec 2, 2017

Thanks for your detailed reply!

@ruslantalpa
Copy link
Member

what was the error? permissions on the directory?

@feliu
Copy link
Author

feliu commented Dec 4, 2017

yes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants