Closed otwm closed 4 years ago
I knew what the problem was. Two aws eb instances were running. I will close this issue.
Thanks for sharing the solution so others can benefit @otwm! Glad you figured it out :)
@otwm Can you tell me how you got this to run in beanstalk? I'm trying but can not figure it out.
@otwm @jared-christensen I am currently trying to get Lighthouse server working in Elastic Beanstalk with docker-compose up and having issues, too. Did you have any luck?
I get docker-compose to work locally but after deploying to EB, console reports the instance is healthy but I can't connect to the url. I just get 504s.
I'm thinking it's something to do with port forwarding. I've been trying to set up a nginx reverse proxy, but no luck.
@kriscoleman I did end up getting it to work but I'm using app runner.
This is what my docker file looks like if that helps at all.
WORKDIR /app
COPY package*.json ./
RUN npm install --unsafe-perm=true
COPY . .
EXPOSE 9001
CMD ["npx", "lhci", "server", "--storage.storageMethod=sql", "--storage.sqlDialect=sqlite", "--storage.sqlDatabasePath=./db.sql"]
And my package.json
{
"name": "lighthouse-ci",
"version": "1.0.0",
"description": "docker volume create lhci-data docker container run --publish 9001:9001 --mount='source=lhci-data,target=/data' --detach patrickhulce/lhci-server",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+ssh://git@bitbucket.org/dhigroupinc/lighthouse-ci.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"homepage": "https://bitbucket.org/dhigroupinc/lighthouse-ci#readme",
"devDependencies": {
"@lhci/cli": "^0.8.0",
"@lhci/server": "^0.8.0",
"sqlite3": "^5.0.2"
}
}
@jared-christensen
Thank you so much!!
I scrapped my docker-compose.yml
and just added your docker file (with FROM node:12.18.3-alpine3.11
) and your package.json, and it's working!
I have it working in Elastic Beanstalk, too. I unfortunately couldn't seem to use AWS App Runner, as our code was in AWS CodeCommit and AWS App Runner wouldn't let me choose that as a git provider.
I think the storage is ephemeral so I might try to add persistent storage, but this unblocked me and got me going. Thank you for responding so fast!!
@kriscoleman Awesome! It was a struggle for me to get it working so I’m glad it worked for you too!
Gosh, me too. I spent a few days on this trying figure out why EB wasn't playing nice. You saved me a ton of pain and I just got the dopamine of closing a bajillion browser tabs. Thanks again @jared-christensen !!
We used the CDK to deploy to AWS using fargate and cloudfront. This might be useful to someone else:
https://github.com/buildigo/lighthouse-ci-server/blob/master/lib/lighthouse-ci-server-stack.ts
Lighthouse-ci server not working on AWS elastic beanstalk (autorun fails)
phenomenon
I installed the server through docker. The server works fine. The project is also registered through the wizard. So far so good. The problem is autorun. Autorun does not work with a 422 error.
autorun error message
upload error message
Environment:
aws elastic beanstalk docker This is a common setting. Dockerrun.aws.json
analysis
I tried putting the logs in @ lhci / cli / node_modules / @ lhci / utils / src / api-client.js file.
A 404 error is returned. I read the code to find out more about it and checked the url routes to check with the server.
As I tested each server api, I found something unusual. The server sometimes works fine, but sometimes it returns a 404. I've read the code and I know there's nothing wrong with it. It works fine on my local server.
If someone has experience with this, please share it.