Skip to content

Instantly share code, notes, and snippets.

time="2021-09-22T18:36:36Z" level=error msg="failed to request new Vault token" app=vault-secrets-webhook err="Error making API request.\n\nURL: PUT https://myvault.external/v1/auth/kube-auth-path/login\nCode: 400. Errors:\n\n* missing client token"
time="2021-09-22T18:36:38Z" level=error msg="failed to request new Vault token" app=vault-secrets-webhook err="Error making API request.\n\nURL: PUT https://myvault.external/v1/auth/kube-auth-path/login\nCode: 400. Errors:\n\n* missing client token"
... <# 45 seconds worth of retries #> ...
time="2021-09-22T18:36:40Z" level=error msg="Admission review request failed" app=vault-secrets-webhook dry-run=false error="failed to create vault client: timeout [45s] during waiting for Vault token" kind=v1/Secret name=vsecret ns=default op=create path=/secrets request-id=54c75d62-e1d9-403b-87b4-3c5602168df7 webhook-id=vault-secrets-secret webhook-kind=mutating wh-version=v1beta1
time="2021-09-22T18:36:40Z" level=error msg="failed to request new Vault token" app=vault-secret
apiVersion: v1
kind: Secret
metadata:
name: vsecret
annotations:
vault.security.banzaicloud.io/vault-addr: https://my-external.vault
vault.security.banzaicloud.io/vault-namespace: MyTeams/Namespace
vault.security.banzaicloud.io/vault-role: default
vault.security.banzaicloud.io/vault-skip-verify: "true"
vault.security.banzaicloud.io/vault-path: my-kube-path
Sampling process 61580 for 1 second with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling ruby (pid 61580) every 1 millisecond
Process: ruby [61580]
Path: /Users/USER/*/ruby
Load Address: 0x107401000
Identifier: ruby
Version: 0
Code Type: X86-64
Parent Process: debugserver [61621]
@wmene
wmene / minter.xml
Created May 4, 2015 21:28
Build Fedora4 with slashless identifiers
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:c="http://www.springframework.org/schema/c"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!-- Mints PIDs using random UUIDs -->
<bean class="org.fcrepo.kernel.impl.identifiers.UUIDPidMinter"
/>
@wmene
wmene / gist:314f74a09e1390d4a302
Created April 20, 2015 23:14
Fedora export context=archive stacktrace
ERROR 2015-04-20 16:08:51.375 [ajp-bio-8009-exec-11449] (BaseRestResource) Unexpected error fulfilling REST API request
java.lang.StringIndexOutOfBoundsException: String index out of range: 3040
at java.lang.String.substring(String.java:1907) ~[na:1.7.0_75]
at java.lang.String.subSequence(String.java:1946) ~[na:1.7.0_75]
at java.io.PrintWriter.append(PrintWriter.java:1042) ~[na:1.7.0_75]
at org.fcrepo.server.utilities.StringUtility.splitAndIndent(StringUtility.java:139) ~[fcrepo-server-3.8.0.jar:na]
at org.fcrepo.server.storage.translation.FOXMLDOSerializer.appendDatastreams(FOXMLDOSerializer.java:370) ~[fcrepo-server-3.8.0.jar:na]
at org.fcrepo.server.storage.translation.FOXMLDOSerializer.serialize(FOXMLDOSerializer.java:118) ~[fcrepo-server-3.8.0.jar:na]
at org.fcrepo.server.storage.translation.DOTranslatorImpl.serialize(DOTranslatorImpl.java:99) ~[fcrepo-server-3.8.0.jar:na]
at org.fcrepo.server.storage.translation.DOTranslatorModule.serialize
@wmene
wmene / gist:e775d78938abe0708cad
Created April 14, 2015 18:42
Fedora doFields MySQL table description
+---------------+--------------+-------------------+------+-----+---------+-------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+---------------+--------------+-------------------+------+-----+---------+-------+---------------------------------+---------+
| pid | varchar(64) | latin1_bin | NO | MUL | NULL | | select,insert,update,references | |
| label | varchar(255) | latin1_swedish_ci | YES | | NULL | | select,insert,update,references | |
| state | varchar(1) | latin1_swedish_ci | NO | | A | | select,insert,update,references | |
| ownerId | varchar(64) | latin1_swedish_ci | YES | | NULL | | select,insert,update,references | |
| cDate | bigint(20) | NULL | NO | | NULL | | select,insert,update,references | |
def monitor_stale(flags = {})
stale = Dor::WorkflowService.get_stale_queued_workflows('sdr', hours_ago: 24, limit: 1000)
pp stale
stale.each do |h|
h[:repo] = 'sdr'
ap({:h => h}) if flags[:debug]
Dor::WorkflowService.update_workflow_status(h[:repo], h[:druid], h[:workflow], h[:step], 'waiting', expected: 'queued')
end
end
@wmene
wmene / fcrepo4-no-slashes.diff
Created October 23, 2014 18:23
Generate PIDs without slashes in Fedora4 - diff
diff --git a/fcrepo-webapp/src/main/resources/spring/minter.xml b/fcrepo-webapp/src/main/resources/spring/minter.xml
index 323cb17..55054c5 100644
--- a/fcrepo-webapp/src/main/resources/spring/minter.xml
+++ b/fcrepo-webapp/src/main/resources/spring/minter.xml
@@ -5,9 +5,8 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!-- Mints PIDs using random UUIDs -->
- <bean class="org.fcrepo.kernel.impl.identifiers.UUIDPathMinter"
- c:length="${fcrepo.uuid.path.length:2}"
@wmene
wmene / .pryrc
Created October 15, 2014 17:39
For a rails project
Pry.prompt = [proc { |obj, nest_level| "#{RUBY_VERSION} (#{obj}):#{nest_level} Pry > " }, proc { |obj, nest_level| "#{RUBY_VERSION} (#{obj}):#{nest_level} * " }]
#%w{map_by_method hirb}.each { |gem| require gem }
# Toys methods
# Stealed from https://gist.github.com/807492
class Array
def self.toy(n=10, &block)
block_given? ? Array.new(n,&block) : Array.new(n) {|i| i+1}
end
@wmene
wmene / .irbrc
Created October 15, 2014 17:37
Use pry everywhere
# https://github.com/carlhuda/bundler/issues/183#issuecomment-1149953
if defined?(::Bundler)
global_gemset = ENV['GEM_PATH'].split(':').grep(/ruby.*@global/).first
if global_gemset
all_global_gem_paths = Dir.glob("#{global_gemset}/gems/*")
all_global_gem_paths.each do |p|
gem_path = "#{p}/lib"
$LOAD_PATH << gem_path
end
end