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

Not starting at remote Ubuntu #23

Open
Laurent105 opened this issue Apr 8, 2019 · 4 comments
Open

Not starting at remote Ubuntu #23

Laurent105 opened this issue Apr 8, 2019 · 4 comments

Comments

@Laurent105
Copy link

Hi there!

Really want to start Dashboard on InstaPy. Following instructions, I receive the following error. FYI, working on Lightsail AWS.

ubuntu@ip-xx-xx-xx-xx:~/instapy-dashboard$ sudo npm start
[email protected] start /home/ubuntu/instapy-dashboard
concurrently --kill-others-on-fail "react-scripts start" "npm run server"
[1]
[1] > [email protected] server /home/ubuntu/instapy-dashboard
[1] > node ./src/services/server.js
[1]
[1] /home/ubuntu/instapy-dashboard/src/services/server.js:10
[1] const allowedHosts = process.env.ALLOWED_HOSTS.split(' ')
[1] ^
[1]
[1] TypeError: Cannot read property 'split' of undefined
[1] at Object. (/home/ubuntu/instapy-dashboard/src/services/server.js:10:48)
[1] at Module._compile (internal/modules/cjs/loader.js:805:30)
[1] at Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10)
[1] at Module.load (internal/modules/cjs/loader.js:672:32)
[1] at tryModuleLoad (internal/modules/cjs/loader.js:612:12)
[1] at Function.Module._load (internal/modules/cjs/loader.js:604:3)
[1] at Function.Module.runMain (internal/modules/cjs/loader.js:868:12)
[1] at internal/main/run_main_module.js:21:11
[1] npm ERR! code ELIFECYCLE
[1] npm ERR! errno 1
[1] npm ERR! [email protected] server: node ./src/services/server.js
[1] npm ERR! Exit status 1
[1] npm ERR!
[1] npm ERR! Failed at the [email protected] server script.
[1] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[1]
[1] npm ERR! A complete log of this run can be found in:
[1] npm ERR! /home/ubuntu/.npm/_logs/2019-04-08T16_02_34_324Z-debug.log
[1] npm run server exited with code 1
--> Sending SIGTERM to other processes..
[0] react-scripts start exited with code SIGTERM
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: concurrently --kill-others-on-fail "react-scripts start" "npm run server"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2019-04-08T16_02_34_388Z-debug.log

And the log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]
6 info lifecycle [email protected]
start: [email protected]
7 verbose lifecycle [email protected]start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/ubuntu/instapy-dashboard/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
9 verbose lifecycle [email protected]start: CWD: /home/ubuntu/instapy-dashboard
10 silly lifecycle [email protected]
start: Args: [ '-c',
10 silly lifecycle 'concurrently --kill-others-on-fail "react-scripts start" "npm run server"' ]
11 silly lifecycle [email protected]start: Returned: code: 1 signal: null
12 info lifecycle [email protected]
start: Failed to exec start script
13 verbose stack Error: [email protected] start: concurrently --kill-others-on-fail "react-scripts start" "npm run server"
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:193:13)
13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:193:13)
13 verbose stack at maybeClose (internal/child_process.js:1001:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:266:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/ubuntu/instapy-dashboard
16 verbose Linux 4.15.0-1035-aws
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v11.13.0
19 verbose npm v6.7.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: concurrently --kill-others-on-fail "react-scripts start" "npm run server"
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Thanks in advance for help!

@converge
Copy link
Owner

converge commented Apr 8, 2019

did you create the .env file ?

@Laurent105
Copy link
Author

Of course:

ls -l

-rw-r--r--    1 root root   2432 Apr  8 15:33 README.md
drwxr-xr-x    3 root root   4096 Apr  8 14:27 __tests__
drwxr-xr-x 1199 root root  36864 Apr  8 15:54 node_modules
-rw-r--r--    1 root root   2829 Apr  8 15:33 npm-debug.log
-rw-r--r--    1 root root 789884 Apr  8 15:53 package-lock.json
-rw-r--r--    1 root root   1363 Apr  8 14:53 package.json
drwxr-xr-x    2 root root   4096 Apr  8 14:27 public
drwxr-xr-x    2 root root   4096 Apr  8 14:27 screenshots
-rw-r--r--    1 root root    464 Apr  8 15:31 setup.env
drwxr-xr-x    4 root root   4096 Apr  8 14:27 src

Content of setup.env

# MacOS: /Users/your_user_name/InstaPy
# you can also check this information when running your quickstart.py, 
'# the first lines contains
# -> Workspace in use: "/Users/converge/InstaPy"
INSTAPY_FOLDER=/home/ubuntu/InstaPy
# if using only on localhost, keep it:
ALLOWED_HOSTS=http://localhost:3000 http://localhost:3000
REACT_APP_API_ENTRY_POINT=http://localhost:3001
# basic setup, ok to keep it ->
# Node port
NODE_PORT=3001
# ReactJS Create APP port
PORT=3000

I've tried replacing localhost with public IP. And JFI 3000 and 3001 ports are opened in firewall.

@converge
Copy link
Owner

converge commented Apr 9, 2019

the file name should be .env , your file name is actually setup.env

@Laurent105
Copy link
Author

Laurent105 commented Apr 10, 2019

Thanks for help, that fixed. Maybe a good idea to give that file a name or put ".env" in brackets in the readme? It's not intuitive.

Now I will try to fix problem in InstaPy blocking AWS server from responding any requests. While it is working, I cannot load the InstaPy-dashboard or SSH connect to the server itself.

Thanks for your work!

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