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

Cannot load test data #42

Open
nerdess opened this issue Apr 2, 2016 · 13 comments
Open

Cannot load test data #42

nerdess opened this issue Apr 2, 2016 · 13 comments

Comments

@nerdess
Copy link

nerdess commented Apr 2, 2016

localhost:8000 is working fine but when I execute

run ./localdev.js testdata zen

i get lots of postgres-related errors. attached my postgres logfile

postgresql_error_log.txt

@nerdess
Copy link
Author

nerdess commented Apr 17, 2016

I checked load_test_data.sh and found out the problem is within this line

PGPASSWORD=$POSTGRES_PASSWORD psql --single-transaction -w -h $POSTGRES_HOST -U $POSTGRES_USERNAME -d $POSTGRES_NAME -f "$PROJECT_DIR/scripts/database/pg/populate-dojos.sql" --port $POSTGRES_PORT

$POSTGRES_NAME uses the database "cp-dojos-development" but when I look into this database it has no tables so of course any INSERT state fails.

Where can I find the schema for cp-dojos-development?

@Wardormeur
Copy link
Contributor

Migrations are ran/checked upon each run, try running ./localdev run zen once before using testdata

@nerdess
Copy link
Author

nerdess commented Apr 18, 2016

there is no testdata, the database cp-dojos-development is emtpy...!

@Wardormeur
Copy link
Contributor

The tables are created through migrations scripts which are run when the service is ran (ie : https://github.com/CoderDojo/cp-dojos-service/blob/master/service.js#L39 )
Even though you'll have the schema through the run, is disrecommend using test-data as CoderDojo/community-platform#926 shows that a part of those are broken

@nerdess
Copy link
Author

nerdess commented May 19, 2016

without test data there is no german version of the page so i cannot try and fix this issue: CoderDojo/community-platform#856

also, without testdata i cannot login to try and replicate the bug. i can't even register as a new user on localhost since the "Select a user type" dropdown is not populated with the various coderdojo usertypes (Parent/Guardian, Mentor....)

i'd really love to fix some issues on the platform but without a working local dev environment i cannot do anything :(

@Wardormeur
Copy link
Contributor

I'll try to have a look soon, but you don't need the test-data to run zen, running it with empty data is also possible
You'll need the translation file from crowdin to get it in german (https://crowdin.com/project/zen-community-platform/de#) and put it in the locale folder (under a newly created de_DE folder)

@nerdess
Copy link
Author

nerdess commented May 20, 2016

but how can i login without the testdata?

also: the translation file is several files/folders, not sure what is needed there....

@Wardormeur
Copy link
Contributor

Wardormeur commented May 22, 2016

I don't believe you need any data to get it running,(as you can still register locally). Like I said, I'll have a look at it asap though.
In the meantime, can you tell me which version of postgres are you running?
Regarding the translations, there is a "cloud-like" button on the right side before the list of file that allows you to download all the files at once :)

@Wardormeur
Copy link
Contributor

Hye, just tested here, testdata works when migrations are ran before, run ./localdev run zen first, then the testdata one.
The reason is the run cmd is adding the tables which are required to insert the data in, and your error (which I also had by not runnning "run zen") specifically says you're missing the table initialization

@nerdess
Copy link
Author

nerdess commented Jun 28, 2016

sorry for responding so late :)

did a git pull, ran npm install and ./localdev run zen and now the data migration worked...!

@nerdess
Copy link
Author

nerdess commented Jun 28, 2016

well actually.....cheered too early. I was trying to login once using manager@example.com / test but then all just fell apart. when i execute ./localdev run zen i now get a strange error and localhost is not available:

Error running service: Error running command: node ./service.js - Error: Command failed: node ./service.js
module.js:442
throw err;
^

Error: Cannot find module '../build/Debug/addon'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/Users/sissi/Sites/cp-local-development/workspace-zen/cp-dojos-service/node_modules/heapdump/lib/main.js:18:15)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)

  • Error: Command failed: node ./service.js
    module.js:442
    throw err;
    ^

Error: Cannot find module '../build/Debug/addon'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/Users/sissi/Sites/cp-local-development/workspace-zen/cp-dojos-service/node_modules/heapdump/lib/main.js:18:15)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)

at ChildProcess.exithandler (child_process.js:207:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Socket.<anonymous> (internal/child_process.js:323:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:492:12) - module.js:442
throw err;
^

Error: Cannot find module '../build/Debug/addon'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/Users/sissi/Sites/cp-local-development/workspace-zen/cp-dojos-service/node_modules/heapdump/lib/main.js:18:15)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)

2016-06-28T14:54:30.263Z ewp8fatj3t0a/1467125668925/23347/- INFO client {type:web,port:10303,pin:role:cd-users,cmd:}
2016-06-28T14:54:30.264Z ewp8fatj3t0a/1467125668925/23347/- INFO client {type:web,port:10303,pin:role:cd-profiles,cmd:
}
events.js:160
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE 0.0.0.0:10306
at Object.exports._errnoException (util.js:1007:11)
at exports._exceptionWithHostPort (util.js:1030:20)
at Server._listen2 (net.js:1253:14)
at listen (net.js:1289:10)
at net.js:1399:9
at _combinedTickCallback (internal/process/next_tick.js:77:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
Error running service: Error running command: node ./service.js - Error: Command failed: node ./service.js
events.js:160
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE 0.0.0.0:10306
at Object.exports._errnoException (util.js:1007:11)
at exports._exceptionWithHostPort (util.js:1030:20)
at Server._listen2 (net.js:1253:14)
at listen (net.js:1289:10)
at net.js:1399:9
at _combinedTickCallback (internal/process/next_tick.js:77:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)

  • Error: Command failed: node ./service.js
    events.js:160
    throw er; // Unhandled 'error' event
    ^

Error: listen EADDRINUSE 0.0.0.0:10306
at Object.exports._errnoException (util.js:1007:11)
at exports._exceptionWithHostPort (util.js:1030:20)
at Server._listen2 (net.js:1253:14)
at listen (net.js:1289:10)
at net.js:1399:9
at _combinedTickCallback (internal/process/next_tick.js:77:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)

at ChildProcess.exithandler (child_process.js:207:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Socket.<anonymous> (internal/child_process.js:323:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:492:12) - events.js:160
  throw er; // Unhandled 'error' event
  ^

Error: listen EADDRINUSE 0.0.0.0:10306
at Object.exports._errnoException (util.js:1007:11)
at exports._exceptionWithHostPort (util.js:1030:20)
at Server._listen2 (net.js:1253:14)
at listen (net.js:1289:10)
at net.js:1399:9
at _combinedTickCallback (internal/process/next_tick.js:77:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)

events.js:160
throw er; // Unhandled 'error' event
^

Error: ENAMETOOLONG: name too long, stat 'workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests/workspace-zen/cp-e2e-tests'
at Error (native)

@nerdess
Copy link
Author

nerdess commented Jun 29, 2016

did a "npm rebuild" and now get a different error which sums up as this:

Seneca Fatal Error
==================

Message: Module version mismatch. Expected 48, got 47.

did "npm install --save seneca" but this does not help/change anything.....also removed the node_modules folder and ran "npm install" again no success.

btw: running node 6.2.2. and npm 3.9.5.

@Wardormeur
Copy link
Contributor

We didn't test on node 6.2 so far until we have proper tests, so that only 0.10.43 is the recognized version which runs properly

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