Skip to content

Instantly share code, notes, and snippets.

View stevekuznetsov's full-sized avatar

Steve Kuznetsov stevekuznetsov

  • Microsoft
  • United States
  • 09:30 (UTC -07:00)
View GitHub Profile
@stevekuznetsov
stevekuznetsov / error.txt
Created February 9, 2016 04:00
postgres setup error
$ PGPASSWORD=password psql --host=localhost --port=5432 --username=admin --dbname=db -f postgresql/creation.sql
psql:postgresql/creation.sql:1: ERROR: could not open extension control file "/opt/rh/rh-postgresql94/root/usr/share/pgsql/extension/uuid-ossp.control": No such file or directory
CREATE TYPE
psql:postgresql/creation.sql:9: ERROR: function uuid_generate_v4() does not exist
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
psql:postgresql/creation.sql:16: ERROR: relation "object_references" does not exist
psql:postgresql/creation.sql:22: ERROR: relation "object_references" does not exist
psql:postgresql/creation.sql:30: ERROR: function uuid_generate_v4() does not exist
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
psql:postgresql/creation.sql:35: ERROR: function uuid_generate_v4() does not exist
$ PGPASSWORD=password psql --host=localhost --port=5432 --username=admin --dbname=db
psql (9.3.9, server 9.4.4)
WARNING: psql major version 9.3, server major version 9.4.
Some psql features might not work.
Type "help" for help.
db=> CREATE EXTENSION "uuid-ossp";
ERROR: could not open extension control file "/opt/rh/rh-postgresql94/root/usr/share/pgsql/extension/uuid-ossp.control": No such file or directory
@stevekuznetsov
stevekuznetsov / openldap-server.log
Created February 11, 2016 16:36
LDAP server fail
$ oc logs openldap-server-1-sswhe --config=/tmp/openshift/test-extended/ldap_groups/openshift.local.config/master/admin.kubeconfig
+ exec /usr/local/bin/run-openldap.sh
+ /usr/local/bin/test-init.sh
+ (( i=30 ))
+ (( i>0 ))
++ ldapsearch
++ grep 'Can.t contact LDAP server'
+ ping_result='ldap_sasl_interactive_bind_s: Can'\''t contact LDAP server (-1)'
+ '[' -z 'ldap_sasl_interactive_bind_s: Can'\''t contact LDAP server (-1)' ']'
+ sleep 1
$ UPSTREAM_REMOTE=upstream hack/cherry-pick.sh 21265
++ Generating patch for 22ad56ddeda7bfd71714ab12b721c28336028987...49f1193126b92158ee089a7bcf91fca7ff6956e5 onto f0cd09a ...
fatal: Cannot update paths and switch to branch 'last_upstream_branch' at the same time.
Did you intend to checkout 'f0cd09a' which can not be resolved as commit?
!!! Error in hack/cherry-pick.sh:51
'git checkout -b last_upstream_branch "${lastrev}"' exited with status 128
Call stack:
1: hack/cherry-pick.sh:51 main(...)
Exiting with status 1
@stevekuznetsov
stevekuznetsov / shadow.go
Created February 24, 2016 18:08
shadowing
package main
func main() {
a, err := someFunc()
if err != nil {
return
}
if err := someOtherFunc(a); err != nil { // this `err` is not aliasing `err` in the outer scope
return
@stevekuznetsov
stevekuznetsov / tput.sh
Last active March 11, 2016 20:20
messing with lines
#!/bin/bash
# os::text::save_cursor saves the current cursor position if it is called in a TTY
# to allow us to provide os::text::clear_from_saved_cursor
function os::text::save_cursor() {
if [ -t 1 ]; then
tput sc
fi
}
@stevekuznetsov
stevekuznetsov / output.txt
Created March 15, 2016 18:32
shellcheck on util
In hack/util.sh line 75:
--write-config=${SERVER_CONFIG_DIR} \
^-- SC2086: Double quote to prevent globbing and word splitting.
In hack/util.sh line 87:
os::util::sed "s/:4001$/:${ETCD_PORT}/g" ${SERVER_CONFIG_DIR}/master/master-config.yaml
^-- SC2086: Double quote to prevent globbing and word splitting.
@stevekuznetsov
stevekuznetsov / resourcefor.go
Created March 21, 2016 17:04
getting resource name
var groupVersionResource unversioned.GroupVersionResource
resource := strings.ToLower(hpa.Spec.ScaleRef.Kind)
if groupVersion, err := unversioned.ParseGroupVersion(hpa.Spec.ScaleRef.APIVersion); err == nil {
groupVersionResource = groupVersion.WithResource(resource)
} else {
groupVersionResource = unversioned.GroupVersionResource{Resource: resource}
}
groupVersionResource, err := registered.RESTMapper().ResourceFor(groupVersionResource)
if err != nil {
@stevekuznetsov
stevekuznetsov / log.txt
Created April 13, 2016 14:22
SUCCESS after 254.700s: test/cmd/newapp.sh:225: executing 'oc new-app installable:file' expecting failure
I0413 10:12:50.065022 11763 helper.go:335] Image metadata already filled for sha256:33955e1cbbaa7c1ec046e1ba056c893dbb13ec47eb9d4c67e26044ac7286ae7e
I0413 10:12:50.071321 11763 rest.go:250] updated stream {"name":"installable","namespace":"cmd-newapp","uid":"cdd8acd3-0181-11e6-8458-54ee753e2644","resourceVersion":"555","generation":1,"creationTimestamp":"2016-04-13T14:12:49Z","Spec":{"DockerImageRepository":"","Tags":{"file":{"Name":"file","Annotations":{"io.openshift.generate.job":"true","io.openshift.generate.token.as":"file:/var/run/openshift.secret.token"},"From":{"kind":"DockerImage","name":"openshift/origin:v1.0.6"},"Reference":false,"Generation":
A: 1,"ImportPolicy":{"Insecure":false,"Scheduled":false}},"latest":{"Name":"latest","Annotations":null,"From":{"kind":"ImageStreamTag","name":"installable:token"},"Reference":false,"Generation":1,"ImportPolicy":{"Insecure":false,"Scheduled":false}},"no-token":{"Name":"no-token","Annotations":{"io.openshift.generate.job":"true"},"From":{"kind":"DockerImage
SUCCESS after 254.602s: test/cmd/newapp.sh:226: executing 'oc new-app installable:file' expecting failure
There was no output from the command.
Standard error from the command:
error: installing "installable:file" requires that you grant the image access to run with your credentials
WARNING: This will allow the pod to act as you across the entire cluster - ensure you
trust the image with those permissions before you continue.
You can see more information about the image by adding the --dry-run flag.
If you trust the provided image, include the flag --grant-install-rights.