Wkhtmltopdf, binaries not found - wkhtmltopdf

I have a website that was developed in 2012 in Symfony 2.4 by Yann, a developer who created about 70% of the site and myself who has been developing on it since about 2013-2014
Our site was originally hosted by Yann and everything worked well. Until the moment he started to stop paying his server, which caused us many site crashes.
So he was asked to migrate to OVH in 2016, we took a web plesk solution for this purpose. And since we migrated we lost a feature, the generation of PDFs.
And no way to make it work again since.
Here's the error we got :
The exit status code '127' says something went wrong:
stderr: "sh: /vendor/wkhtmltopdf/bin: No such file or directory
"
stdout: ""
command: /vendor/wkhtmltopdf/bin --lowquality '/tmp/knp_snappy5b55e3aa348db3.85109382.html' '/tmp/knp_snappy5b55e3aa349b42.36987656.pdf'.
Here's my config.yml :
knp_snappy:
pdf:
enabled: true
binary: /vendor/wkhtmltopdf/bin
options: []
image:
enabled: true
binary: /vendor/wkhtmltoimage/bin
options: []
And i have a folder named /vendor/wkhtmltopdf/bin as this screenshot proves it :
My OVH architecture
So i dunno what to do ...

according to snappy docs, the config.yml needs to point to actual binary, not to just bin folder. please add the binary names in the config.yml and it should all be OK

I just changed for adding binary names like that :
knp_snappy:
pdf:
enabled: true
binary: /vendor/wkhtmltopdf/bin/wkhtmltopdf
options: []
image:
enabled: true
binary: /vendor/wkhtmltoimage/bin/wkhtmltoimage
options: []
And i got the same error :
The exit status code '127' says something went wrong:
stderr: "sh: /vendor/wkhtmltopdf/bin/wkhtmltopdf: No such file or directory
"
stdout: ""
command: /vendor/wkhtmltopdf/bin/wkhtmltopdf --lowquality '/tmp/knp_snappy5b5ef7bd7b0378.87600401.html' '/tmp/knp_snappy5b5ef7bd7b1028.75774701.pdf'.

Related

Google App Engine Flexible environment deployment failed using Google Cloud SDK from WINDOWS OS 10

My production site developed in CodeIgniter Frame work, It has more than 10k files, I deployed last week successfully without any issues. Today My deployment got failed, I just corrected one query in script.
I got the below issues
C:\myproject>gcloud app deploy --version 13 app.yaml
Services to deploy:
descriptor: [C:\myproject\app.yaml]
source: [C:\myproject]
target project: [xyz]
target service: [uat]
target version: [13]
target url: [https://uat-dot-xyz.appspot.com]
Do you want to continue (Y/n)? Y
Beginning deployment of service [uat]...
#============================================================#
#= Uploading 0 files to Google Cloud Storage =#
#============================================================#
File upload done.
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: This deployment has too many files. New versions are limited to 10000 files for this app.
- '#type': type.googleapis.com/google.rpc.BadRequest
fieldViolations:
- description: This deployment has too many files. New versions are limited to 10000
files for this app.
field: version.deployment.files[...]
I referred the below SO posting
gcloud app deploy failed because deployment has too many files for PHP CodeIgnitor files
gcloud app deploy : This deployment has too many files
Approaches for overcoming 10000 file limit on Google App Engine?
Communicating between google app engine services
I enabled .gcloudignore file as per the below and created in myproject
https://cloud.google.com/sdk/gcloud/reference/topic/gcloudignore
How to include files in .gcloudignore that are ignored in .gitignore
C:\>gcloud config set gcloudignore/enabled true
Updated property [gcloudignore/enabled].
C:\>gcloud config list
[accessibility]
screen_reader = False
[compute]
region = region-name
zone = zone-name
[core]
account = xyz#domainname.com
disable_usage_reporting = True
project = xyz
[gcloudignore]
enabled = true
My current Cloud SDK version is: 320.0.0
Installing components from version: 320.0.0
I could not find the solution. Why suddenly My deployment failed Using Gcloud SDK to GAE flexible environment ( Note: My project has more than 10 k files, Upto Last week I didnt get this issue)
Plz, Help me to solve this issue, If I miss anything in this,
Thanks in Advance.
It looks that there was a change on the way App Engine deploy the files.
Running the command gcloud config set app/trigger_build_server_side false solved the issue
Now on Dec 15 this change seems to be reverted and normal deploys should be working as before

Storing Artifacts From a Failed Build

I am running some screen diffing tests in one of my Cloud Build steps. The tests produce png files that I would like to view after the build, but it appears to upload artifacts on successful builds.
If my test fail, the process exits with a non-zero code, which results in this error:
ERROR: build step 0 "gcr.io/k8s-skaffold/skaffold" failed: step exited with non-zero status: 1
Which further results in another error
ERROR: (gcloud.builds.submit) build a22d1ab5-c996-49fe-a782-a74481ad5c2a completed with status "FAILURE"
And no artifacts get uploaded.
I added || true after my tests, so it exits successfully, and the artifacts get uploaded.
I want to:
A) Confirm that this behavior is expected
B) Know if there is a way to upload artifacts even if a step fails
Edit:
Here is my cloudbuild.yaml
options:
machineType: 'N1_HIGHCPU_32'
timeout: 3000s
steps:
- name: 'gcr.io/k8s-skaffold/skaffold'
env:
- 'CLOUD_BUILD=1'
entrypoint: bash
args:
- -x # print commands as they are being executed
- -c # run the following command...
- build/test/smoke/smoke-test.sh
artifacts:
objects:
location: 'gs://cloudbuild-artifacts/$BUILD_ID'
paths: [
'/workspace/build/test/cypress/screenshots/*.png'
]
Google Cloud Build doesn't allow us to upload artifacts (or run some steps ) if a build step fails. This is the expected behavior.
There is an already feature request created in Public Issue Tracker to allow us to run some steps even though the build has finished or failed. Please feel free to star it to get all the related updates on this issue.
A workaround per now is as you mentioned using || true after the tests or use || exit 0 as mentioned in this Github issue.

Jekyll Error - "serve" only works once

Started working on an update to my website. It was working fine the other day but now I get an error.
I generally type on CMD (i'm on Windows 10) "bundle exec Jekyll serve --watch" and the server goes. I can edit and save and its all reflected in browser upon refresh.
Now I can do this, but if I make one change to any file it works. Do another change and I get an error. I have to terminate and type again.
Below is the error:
D:\Tristen Grant\Documents\GitHub\portfolio>bundle exec jekyll serve --watch
DL is deprecated, please use Fiddle
Configuration file: D:/Tristen Grant/Documents/GitHub/portfolio/_config.yml
Source: D:/Tristen Grant/Documents/GitHub/portfolio
Destination: D:/Tristen Grant/Documents/GitHub/portfolio/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.595 seconds.
Auto-regeneration: enabled for 'D:/Tristen Grant/Documents/GitHub/portfolio'
Configuration file: D:/Tristen Grant/Documents/GitHub/portfolio/_config.yml
Server address: http://127.0.0.1:3000//
Server running... press ctrl-c to stop.
Regenerating: 1 file(s) changed at 2016-09-06 16:16:28 ...done in 0.521498 seconds.
Regenerating: 1 file(s) changed at 2016-09-06 16:16:30 ...error:
Error: No such file or directory - git rev-parse HEAD
Error: Run jekyll build --trace for more information.
[2016-09-06 16:19:35] ERROR Errno::ENOTSOCK: An operation was attempted on something that is not a socket.
C:/Ruby21-x64/lib/ruby/2.1.0/webrick/server.rb:170:in `select'
Terminate batch job (Y/N)? y
Terminate batch job (Y/N)? y
I'm using Ruby 2.1.5 64 bit version. RubyDevKit, Sass, Bourbon.
Any ideas how to fix this? I don't know much about Jekyll or ruby. Just starting out.
I also get this error in CMD. You should have github's desktop app installed; try running the same commands from the GitShell you get with that app.
For me that works, it saves me the trouble of installing git globally on Windows and setting it up.

Wercker: Build failing on 'set up environment'. Why?

I have a Jekyll blog which I'm trying to push to an AWS S3 bucket. I have followed this tutorial.
The build keeps failing. Wercker gives me the following error message:
Build failed on master
setup environment
GET https://registry.hub.docker.com/v1/repositories/wercker/ruby/images returned 404
It the displays my wercker.yml file:
box: wercker/ruby
no-response-timeout: 10
build:
steps:
- bundle-install
- script:
name: Run Jekyll doctor
code: bundle exec jekyll doctor
- script:
name: Build Jekyll site
code: bundle exec jekyll build --trace
deploy:
steps:
- s3sync:
key_id: $AWS_ACCESS_KEY_ID
key_secret: $AWS_SECRET_ACCESS_KEY
bucket_url: $AWS_BUCKET_URL
source_dir: _site/
opts: --acl-public --add-header=Cache-Control:max-age=3600
I'm out of my depth here. Google is only returning other Wercker pages with the same error message. What is causing the error? What steps do I need to take to fix this?
Here's a link to the error page itself.
Any help would be appreciated! Thanks.
Solved!
It appears that the tutorial is outdated.
I needed to update wercker.yml to work with Wercker v2.
To do this, I changed:
box: wercker/ruby
to
box: ruby.

gitlab-shell ssl cert issues

I've tried now for several hours te set up gitlab and especially gitlab-shell. After being trolled by the documentation I found a sample config, that fitted my needs, but I get an API 500 error :
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: FAILED. code: 500
gitlab-shell self-check failed
Try fixing it:
Make sure GitLab is running;
Check the gitlab-shell configuration file:
sudo -u git -H editor /home/git/gitlab-shell/config.yml
Please fix the error above and rerun the checks.
To explain my current setup:
#/home/git/gitlab-shell/config.yml
user: git
gitlab_url: https://[myfqdn]/
http_settings:
ca_file: "/etc/gitlab-ssl/git-mydomain-chain.pem"
ca_path: "/etc/gitlab-ssl"
self_signed_cert: false
repos_path: "/home/git/repositories/"
auth_file: "/home/git/.ssh/authorized_keys"
redis:
bin: "/usr/bin/redis-cli"
namespace: resque:gitlab
host: localhost
port: 6379
log_level: INFO
audit_usernames: false
In the /etc/gitlab-ssl directory are two files:
* my privatekey git-mydomain-key.pem
* the combinded public key and CA-key git-mydomain-chain.pem
In addition I added the ca-key to the ca-certificates (it's a cacert signed one).
Can anyone help me and tell me what went wrong?
This error has nothing to do with gitlab. This is pure YAML parser (Psych in your case) error.
Line 5 column 3 is:
ca_path:
⇑ HERE
That said you have a strange unterminated string right above:
⇓⇓⇓ WTF?!
ca_file: "/etc/gitlab-ssl/git-mydomain-chain.pem #This file contains my public key and the ca key
Remove everything after hash (inclusive) and close the string quotes.
Hope it helps.

Resources