Browsershot not wroking on Laravel queue - laravel

I have an issue where as I am taking screenshots of responses using Browsershot which works fine when using dispatchSync. But as soon as I switch over to dispatch and use the queue (redis) the jobs fail with the following output;
Working directory: /var/www/html
Output:
================
Error Output:
================
Error: Failed to launch the browser process! spawn /usr/bin/chromium-browser ENOENT
I might also mention this is running through a Docker container.

Related

Circle Ci - Start react server and test via cypress

I'm running cypress on a server started in cirleci script. Though cypress can't seam to find the local server that I just started. Here's my scripts / setup. I've also tried the cypress circlci-orb and get the same error, so was trying run things myself to help debug. Here's the script details:
- run:
name: 'Run app tests'
command: |
cd app
yarn install --frozen-lockfile
yarn lint
yarn cypress:ci
package.json script:
"cypress:ci": "CYPRESS_BASE_URL=http://localhost:3000 yarn start & wait-on http-get://localhost:3000 && cypress run"
Error:
$ craco start
ℹ 「wds」: Project is running at http://192.168.208.3/
ℹ 「wds」: webpack output is served from
ℹ 「wds」: Content not from webpack is served from /root/project/app/public
ℹ 「wds」: 404s will fallback to /
Starting the development server...
.....
react startup output
......
Cypress tests are kicked off and get the following error
We attempted to make an http request to this URL but the request failed without a response.
We received this error at the network level:
> Error: connect ECONNREFUSED 127.0.0.1:3000
The solution: Up your resource class! In your circleci/config.yml
jobs:
continuous-integration:
resource_class: large
It was non obvious as there were no memory/resource warnings, but according to the circle ci team:
When the machine runs out of memory processes are killed which could include the server.
That server was the cra-server i was trying to start. I upped the resource class and voilà it ran and was found by cypress! In our case we bumped it from a medium to a large class, but may be different for you.
Here's the available resource classes you can use:
https://circleci.com/product/features/resource-classes/

ddev permissions issue - cannot stop, rm, or kill project

About 99% of the time when I try to stop or rm a ddev project I get a 'permission denied' error, and then have to try a lot of different means to get ddev back to a healthy state so I can start working again. Then it happens all over again the next time I come to work on the project.
Can anyone suggest a) the quickest means to break out of this when I am unable to stop a docker container or ddev project b) a means to work out why it keeps happening and fix it?
To mitigate this I have tried:
ddev stop
ddev rm -a
ddev rm
ddev stop
Docker stop
Updating ddev
Upgrading docker
Restarting the machine (occasionally works)
Using the docker kill command
I am working on a linux machine Ubuntu 18.04
Ddev version is v1.8.0
Docker is 18.09.6, build 481bc77
Thank you!!
I would expect to be able to stop and start projects easily but seem to have been getting a permissions error about 99% of the time. I have not identified why it sometimes on the rare occasion works fine.
Stopping ddev-lpntheme-dba ... error
Stopping ddev-lpntheme-web ... error
Stopping ddev-lpntheme-db ... error
ERROR: for ddev-lpntheme-web cannot stop container: 761c2f876230df13267d3d2a7c5d92c869d796a41f1b45cf1c9831ee6673740f: Cannot kill container 761c2f876230df13267d3d2a7c5d92c869d796a41f1b45cf1c9831ee6673740f: unknown error after kill: docker-runc did not terminate sucessfully: container_linux.go:393: signaling init process caused "permission denied"
: unknown
ERROR: for ddev-lpntheme-dba cannot stop container: e5165f70b0b949aef305af013f4aae762968aa0afa99cf6f397c6960048a76bf: Cannot kill container e5165f70b0b949aef305af013f4aae762968aa0afa99cf6f397c6960048a76bf: unknown error after kill: docker-runc did not terminate sucessfully: container_linux.go:393: signaling init process caused "permission denied"
: unknown
Removing container: ddev-lpntheme-dba
Failed to remove project lpntheme:
could not remove container ddev-lpntheme-dba: API error (500): Could not kill running container e5165f70b0b949aef305af013f4aae762968aa0afa99cf6f397c6960048a76bf, cannot remove - Cannot kill container e5165f70b0b949aef305af013f4aae762968aa0afa99cf6f397c6960048a76bf: unknown error after kill: docker-runc did not terminate sucessfully: container_linux.go:393: signaling init process caused "permission denied"
: unknown
I've also managed to completely break the Docker daemon in the past trying to resolve this problem. (I was following this and didn't really know what I was doing How to stop running Container, if error response from daemon is: Cannot Kill Container [...] permission denied?)
Any help greatly appreciated!
More info from 7/6/19
crispin#sonic:~/dockerfolder/ToolLibraryProject$ ddev start
Starting ToolLibraryProject...
Recreating ddev-ssh-agent ... done
ssh-agent container is running: If you want to add authentication to the ssh-agent container, run 'ddev auth ssh' to enable your keys.
Running Command Command=ip address show dev docker0
Creating volume "ToolLibraryProject-mariadb" with default driver
Creating ddev-ToolLibraryProject-db ... done
Creating ddev-ToolLibraryProject-web ... done
Creating ddev-ToolLibraryProject-dba ... done
Recreating ddev-router ... done
Ensuring write permissions for ToolLibraryProject
Successfully started ToolLibraryProject
Project can be reached at https://ToolLibraryProject.ddev.local, http://ToolLibraryProject.ddev.local, https://127.0.0.1:32771, http://127.0.0.1:32772
crispin#sonic:~/dockerfolder/ToolLibraryProject$ ls
composer.json config LICENSE phpunit.xml.dist scripts web
composer.lock drush load.environment.php README.md vendor
crispin#sonic:~/dockerfolder/ToolLibraryProject$ ls
composer.json config LICENSE phpunit.xml.dist scripts web
composer.lock drush load.environment.php README.md vendor
crispin#sonic:~/dockerfolder/ToolLibraryProject$
crispin#sonic:~/dockerfolder/ToolLibraryProject$ ddev stop
Stopping ddev-ToolLibraryProject-web ... error
Stopping ddev-ToolLibraryProject-dba ... error
Stopping ddev-ToolLibraryProject-db ... error
ERROR: for ddev-ToolLibraryProject-web cannot stop container: 3485d615d2dfa46884493b91d7339b06834594fcb46f870cfe60a0486b87f1d3: Cannot kill container 3485d615d2dfa46884493b91d7339b06834594fcb46f870cfe60a0486b87f1d3: unknown error after kill: docker-runc did not terminate sucessfully: container_linux.go:393: signaling init process caused "permission denied"
: unknown
ERROR: for ddev-ToolLibraryProject-dba cannot stop container: cc2209064e0103fdab638445aeac2206217c83a17a7b97eea2216440bb5bb4e2: Cannot kill container cc2209064e0103fdab638445aeac2206217c83a17a7b97eea2216440bb5bb4e2: unknown error after kill: docker-runc did not terminate sucessfully: container_linux.go:393: signaling init process caused "permission denied"
: unknown
Removing container: ddev-ToolLibraryProject-web
Failed to remove project ToolLibraryProject:
could not remove container ddev-ToolLibraryProject-web: API error (500): Could not kill running container 3485d615d2dfa46884493b91d7339b06834594fcb46f870cfe60a0486b87f1d3, cannot remove - Cannot kill container 3485d615d2dfa46884493b91d7339b06834594fcb46f870cfe60a0486b87f1d3: unknown error after kill: docker-runc did not terminate sucessfully: container_linux.go:393: signaling init process caused "permission denied"
: unknown
And with docker logs ToolLibraryProject I get Error: No such container: ToolLibraryProject
Regarding file system I hope this makes sense:
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

Running nightwatch tests on a create-react-app on travis

I have an issue Running nightwatch tests on a create-react-app server (npm start) on travis. I'm starting the creat-react-app with
.travis.yml:
before_script:
- npm --prefix ./client start ./client &
script: npm run test-ci
however when nightwatch runs I am always getting
Starting the development server...
Starting selenium server... Warning: The 'no-use-before-declare' rule requires type information.
ts-loader: Using typescript#2.5.3 and /home/travis/build/client/tsconfig.json
started - PID: 4017
You can now view app in the browser.
Local: http://localhost:3000/
On Your Network: http://172.17.0.3:3000/
Note that the development build is not optimized.
To create a production build, use npm run build.
Error retrieving a new session from the selenium server
Connection refused! Is selenium server started?
{ Error: socket hang up
However the starting & running the nightwatch tests locally works perfect.
The issue was with Chrome, not a problem with react or Nightwatch.
https://github.com/travis-ci/travis-ci/issues/8836

Composer-Rest-Server not connecting

I am testing a a business network I created, I ran the Composer-rest-server and all worked fine, then shut the server as suggested in the developers guide , then I proceeded use the yo hyperledger composer to create the skeleton of the angular app, however, now the angular app is showing in the local browser, however, the composer-rest- server is not.
Expected Behavior:
I should start the composer-rest- server in localhost:3000 and the angular app as well
Actual Behavior:
I get this message;
scovering types from business network definition ...
Connection fails: Error: Error trying to ping. Error: Error trying to query chaincode. Error: Connect Failed
It will be retried for the next request.
Exception: Error: Error trying to ping. Error: Error trying to query chaincode. Error: Connect Failed
Error: Error trying to ping. Error: Error trying to query chaincode. Error: Connect Failed
at _checkRuntimeVersions.then.catch (/home/node/.nvm/versions/node/v6.11.2/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:696:34)
Your Environment
composer-cli#0.11.3
generator-hyperledger-composer#0.11.3
composer-rest-server#0.11.3
Docker version 17.06.0-ce, build 02c1d87
docker-compose version 1.13.0, build 1719ceb
The Problem
If you kill your fabric instance using ./stopFabric that you started using the ./startFabric command then all the containers that were apart of the business network were killed as well and therefore you need to reinstall the .bna and start the network again. (the development flow provided is purposely volatile for rapid development)
The Solution
1.) Type docker ps to see all of your running containers. You should see none if you are getting that error because your peer is not responding to pings
2.) Open a separate terminal and navigate to where you have fabric-dev-servers in the terminal and run ./fabricStart. This will start all the containers like your network Certificate Authority, the peer, the orderer, etc.
3.) Return to your project in another terminal. Do Step 1 & 2 found at the developer tutorial (you likely won't need to do step 3 since you likely already imported the network administrator identity going through the tutorial)
4.) Run composer network ping --card admin#tutorial-network. The ping should go through.
5.) Run docker ps. You should see 4 containers running
6.) Run composer-rest-server and follow the steps from the tutorial.
7.) Run cd tutorial-network-app to switch to where your angular application is (or wherever you generated it with the yo command)
8.) Navigate to http://localhost:3000 and everything should work.
Any other questions or problems just reply here and I can help.
The expected behaviour is that the REST server is already running (the the generator uses Loopback to spin up a REST server already (that's why you shut down the previous REST server)). Its described here https://hyperledger.github.io/composer/unstable/tutorials/developer-guide.html under 'Generate your Skeleton Web Application'.
After you created the application - following completion of the yo hyperledger-composer questions (and after providing the answers) you run your application using npm start from within the generated application directory. Your app is accessible at http://localhost:4200.

unhandled error when trying to run rethinkdb-poll-demo on windows

I've tried to follow the instructions on RethinkDB for Windows: developer preview youtube video, which uses the code from Github https://github.com/segphault/rethinkdb-poll-demo. RethinkDB runs as expected on localhost:8080, but when I tried to run app.js from the rethink-poll-demo directory by entering 'node app' in the command prompt, I get an error message after "Creating a pool connected to local host:28015
events.js:141 throw er; // Unhandled 'error' event
Error: listen EACCES 0.0.0.0:8000"
I haven't changed any code, am new to both node.js and rethinkDB. Does anyone have any idea what's going wrong?
You have another process binding to port 8000.
Check it by running: netstat -an

Resources