Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker setup issues #3

Closed
Betree opened this issue Jan 20, 2018 · 6 comments
Closed

Docker setup issues #3

Betree opened this issue Jan 20, 2018 · 6 comments

Comments

@Betree
Copy link
Contributor

Betree commented Jan 20, 2018

I encountered some issues while trying to run Debattons using Docker as detailed in the README:

After /opt/debattons/docker/cmd.sh build-and-run, debattons:dev is correctly created but doesn't start orientdb. Container logs show:

/usr/local/bin/build-and-run.dev.sh: line 31: /opt/orientdb/bin/server.sh: No such file or directory

The installation log tells us what the problem really is:

$ wget http://central.maven.org/maven2/com/orientechnologies/orientdb-community-gremlin/3.0.0RC1/orientdb-community-gremlin-3.0.0RC1.tar.gz
/usr/local/bin/setup.sh: line 50: wget: command not found

After adding apt-get install wget to build script, the database gets created successfully:

Creating database [remote:localhost/debattons] using the storage type [PLOCAL]...
Database created successfully.

(PR incoming for this part)

However I then get another error :

+ yarn install --no-bin-links
+ cd /opt/debattons/api-server
+ mvn spring-boot:run
yarn install v1.3.2
info No lockfile found.
[1/4] Resolving packages...
[ERROR] Could not create local repository at /home/user/.m2/repository -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LocalRepositoryNotAccessibleException
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "@angular/cli > @angular-devkit/[email protected]" has unmet peer dependency "@angular-devkit/[email protected]".
warning "@angular/cli > @schematics/[email protected]" has unmet peer dependency "@angular-devkit/[email protected]".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 137.24s.
+ chmod +x ./node_modules/@angular/cli/bin/ng
+ ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0
module.js:471
    throw err;
    ^

Error: Cannot find module '@angular-devkit/core'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/opt/debattons/ui/node_modules/@angular-devkit/schematics/src/tree/virtual.js:10:16)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

I'll look more into that later, I need to try again with a fresh install.


Config: Ubuntu 16.04 x64, Docker version 17.12.0-ce, build c97c6d6

@anthony-o
Copy link
Contributor

anthony-o commented Jan 20, 2018

OK I think I know why, it's due to the fact that we're using .m2 and .npm folders in your $HOME.

So docker will create such folders if they don't exist and create them with the user root so they become unusable for the debattons:dev image which uses your own $UID & $GID to run.

You should be able to fix this problem giving the rights to your own user to those 2 folders.
I think we should add a chown command in docker/cmd.sh :)

@anthony-o
Copy link
Contributor

Perhaps that it is also linked to this yarn issue: yarnpkg/yarn#944 (comment), which seems to be fixed by adding --network-concurrency 1 to yarn commands.

@Betree
Copy link
Contributor Author

Betree commented Jan 20, 2018

Thanks I'll try these two fixes tomorrow 😉

@anthony-o
Copy link
Contributor

Mmmh I've tested the parameter and the bug is still here:

+ sudo -E yarn global add @angular/[email protected] --network-concurrency 1
yarn global v1.3.2
[1/4] Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/asn1: ETIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "/usr/local/share/.config/yarn/global/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
ERROR: Service 'debattons' failed to build: The command '/bin/sh -c setup.sh --no-debattons-git-copy' returned a non-zero code: 1

@anthony-o
Copy link
Contributor

@Betree I've just changed the Docker execution architecture, so try to remove all temporary files (or delete all the project & re-clone the repo) and retry ./docker/cmd.sh build-and-run.
I've encountered the Cannot find module '@angular-devkit/core' problem and fixed it by passing to the latest version of angular-cli thanks to angular/angular-cli#9307 (comment)

@Betree
Copy link
Contributor Author

Betree commented Feb 4, 2018

Yep it did the trick 🙂

@Betree Betree closed this as completed Feb 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants