November 22, 2017

[SOLVED][gitlab-ci-multirunner] Cannot connect to the Docker daemon at unix:///var/run/docker.sock




Two errors you can fix like that

#1 set privileged = true

2017-11-21T15:17:26.802822881Z mount: permission denied (are you root?)
2017-11-21T15:17:26.803090353Z Could not mount /sys/kernel/security.
2017-11-21T15:17:26.803107368Z AppArmor detection and --privileged mode might break.
2017-11-21T15:17:26.806984781Z mount: permission denied (are you root?)


#2 Mount /var/run/docker.sock as a volume

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?




/etc/gitlab-runner/config.toml


concurrent = 4
check_interval = 0

[[runners]]
  limit = 4
  name = "fancy name"
  url = "https://www.gitlab.com"
  token = "secret token"
  executor = "docker"
  [runners.docker]
    tls_verify = false
    image = "alpine:3.4"
    privileged = true
    disable_cache = false
    volumes = ["/cache", "/var/run/docker.sock:/var/run/docker.sock"]
  [runners.cache]
    Insecure = false

November 21, 2017

[SOLVED]"[: 1: [: Syntax error: end of file unexpected"



If you getting
"[: 1: [: Syntax error: end of file unexpected" 
in gitlab while executing jobs in under .gitlab-ci.yml
check if your entrypoint.sh of the Docker image you using in this job.


Wrong:
exec $@


Right:
exec "$@"


Source: https://docs.docker.com/engine/reference/builder/#exec-form-entrypoint-example

July 22, 2017

[SOLVED]Synology: "You have exceeded your emergency code limit. Please contact your system administrator"


Got stuck with "You have exceeded your emergency code limit. Please contact your system administrator" on your synology?

Me too.. ..my mobile phone wend dead taking the Google Authenticator app with it and my trusty Synology DS411+II don't wont let me to log in without 2-auth.

This blogpost suggested to add your own reset codes to google_authenticator file - it didn't work for me :(

Here is my solution - I renamed the file.

Login with your admin account via ssh.
and rename (remove) the google_authenticator file

cd /usr/syno/etc/preference/<username>/
mv google_authenticator google_authenticator_backup

and logged me with my account via web interface and got this shiny 2-auth configuration dialog.




May 2, 2017

Open canvas content as data url

Select

document.location = $0.toDataURL()

[SOLVED]Fatal error: Call to a member function setSaveParametersInSession() on a non-object

If you get "Fatal error: Call to a member function setSaveParametersInSession() on a non-object"


check if your config.xml is properly formatted and class names are between XML tags without new lines

Wrong:
<blocks>
    <some_widgets>
        <rewrite>
            <adminhtml_some_info>ClassName
            </adminhtml_some_info>
    </some_widgets>
</blocks>


OK:
<blocks>
    <some_widgets>
        <rewrite>
            <adminhtml_some_info>ClassName</adminhtml_some_info>
    </some_widgets>
</blocks>

April 6, 2017

[SOLVED] Wrong resolution on second display



If you don't see required resolution

xrandr


#add new mode
xrandr --addmode VGA-1 "1920x1080"

#activate mode via xrandr
xrandr --output VGA-1 --mode  "1920x1080"

Source: http://www.martinaulbach.net/linux/command-line-magic/59-setting-higher-screen-resolution-for-external-monitor-in-ubuntu-14-10

February 18, 2017

[SOLVED]Error response status: 6 Selenium error: no such session (Chrome selenium tests on gitlab runner)

Selenium tests with chrome on gitlab gave me this error "Error response status: 6 Selenium error: no such session". I order to fix it

Install virtual display
apt-get install -qq -y xvfb

#try to fool google-chrome to run without sandbox
mv /usr/bin/google-chrome /usr/bin/google-chrome-orig \
    && echo '#!/bin/bash' > /usr/bin/google-chrome \
    && echo '/usr/bin/google-chrome-orig --no-sandbox --disable-setuid-sandbox --allow-sandbox-debugging "$@"' >> /usr/bin/google-chrome  \
    && chmod +x /usr/bin/google-chrome

Before starting your test start virtual display
Xvfb :0 -ac +extension RANDR -screen 0 1366x768x24 &

than run your test in
xvfb-run polymer test -l chrome

Make your own or use my docker image
https://hub.docker.com/r/printminion/polymer-tester/

Example dockerfile: https://github.com/printminion/polymer-tester/blob/master/Dockerfile


Error:
(node:4444) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
Installing and starting Selenium server for local browsers
Selenium server running on port 38917
Web server running on port 2000 and serving from /builds/printminion-group/canvas-editor-base
chrome 56                Tests failed: {"message":"[get(\"http://localhost:2000/components/canvas-editor-base/generated-index.html?cli_browser_id=0\")] Error response status: 6 Selenium error: no such session\n  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64) (WARNING: The server did not provide any stacktrace information)\nCommand duration or timeout: 38 milliseconds\nBuild info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'\nSystem i...
Test run ended in failure: Error: [get("http://localhost:2000/components/canvas-editor-base/generated-index.html?cli_browser_id=0")] Error response status: 6 Selenium error: no such session
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 38 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'runner-4e4528ca-project-266495-concurrent-0', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.7.3-coreos-r2', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=chrome not reachable
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64), platform=ANY}]
Session ID: 6ec7ed7d595d2f61a6b0eca7a536976c

chrome 56 (error)                    

Error: Error: [get("http://localhost:2000/components/canvas-editor-base/generated-index.html?cli_browser_id=0")] Error response status: 6 Selenium error: no such session
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 38 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'runner-4e4528ca-project-266495-concurrent-0', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.7.3-coreos-r2', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=chrome not reachable
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64), platform=ANY}]
Session ID: 6ec7ed7d595d2f61a6b0eca7a536976c

error:   cli runtime exception: Error: Error: [get("http://localhost:2000/components/canvas-editor-base/generated-index.html?cli_browser_id=0")] Error response status: 6 Selenium error: no such session
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 38 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'runner-4e4528ca-project-266495-concurrent-0', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.7.3-coreos-r2', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=chrome not reachable
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64), platform=ANY}]
Session ID: 6ec7ed7d595d2f61a6b0eca7a536976c
error:   Error: Error: [get("http://localhost:2000/components/canvas-editor-base/generated-index.html?cli_browser_id=0")] Error response status: 6 Selenium error: no such session
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 38 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'runner-4e4528ca-project-266495-concurrent-0', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.7.3-coreos-r2', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=chrome not reachable
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.7.3-coreos-r2 x86_64), platform=ANY}]
Session ID: 6ec7ed7d595d2f61a6b0eca7a536976c
    at /usr/local/lib/node_modules/polymer-cli/node_modules/web-component-tester/runner/steps.js:151:27
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/polymer-cli/node_modules/web-component-tester/runner/steps.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:103:7)
ERROR: Build failed: exit code 1

January 10, 2017

[SOLVED]Docker API connection refused 127.0.0.1:2376

Create a file called /etc/systemd/system/docker-tcp.socket to make Docker available on a TCP socket on port 2375.

[Unit]
Description=Docker Socket for the API

[Socket]
ListenStream=2375
BindIPv6Only=both
Service=docker.service

[Install]
WantedBy=sockets.target


Then enable this new socket:

systemctl enable docker-tcp.socket
systemctl stop docker
systemctl start docker-tcp.socket
systemctl start docker
Test that it's working:

docker -H tcp://127.0.0.1:2375 ps


Source: https://coreos.com/os/docs/latest/customizing-docker.html