Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build-logs for running build tells me "build not found" #1714

Closed
thoraxe opened this issue Apr 13, 2015 · 13 comments
Closed

build-logs for running build tells me "build not found" #1714

thoraxe opened this issue Apr 13, 2015 · 13 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@thoraxe
Copy link
Contributor

thoraxe commented Apr 13, 2015

[root@ose3-master openshift-ansible]# osc get build -n sinatra
NAME                             TYPE      STATUS    POD
simple-openshift-sinatra-sti-1   STI       Running   simple-openshift-sinatra-sti-1
[root@ose3-master openshift-ansible]# osc build-logs -n sinatra simple-openshift-sinatra-sti-1
Error from server: Build: not found 'simple-openshift-sinatra-sti-1'
osc version
osc v0.4.3.1
kubernetes v0.14.1-582-gb12d75d
@brenton brenton added the kind/bug Categorizes issue or PR as related to a bug. label Apr 14, 2015
@brenton brenton added this to the 0.5.0 (beta3) milestone Apr 14, 2015
@brenton
Copy link
Contributor

brenton commented Apr 14, 2015

@abhgupta, please excuse the noise. I thought this was a different issue.

@bparees, any idea who could investigate this?

@bparees
Copy link
Contributor

bparees commented Apr 14, 2015

@Kargakis you've been in this space relatively recently, can you take a look?

@smarterclayton
Copy link
Contributor

This is a dupe of an existing issue, but started with the last rebase.

@0xmichalis
Copy link
Contributor

@Kargakis you've been in this space relatively recently, can you take a look?

Sure, will do tomorrow.

@0xmichalis
Copy link
Contributor

Hmm, doesn't seem I can reproduce this in the current master neither with build-logs nor with start-build --follow

@smarterclayton
Copy link
Contributor

Try commenting out the set +e I added to test end to end.

It looks like it happens after builds complete.

On Apr 15, 2015, at 9:19 AM, Michail Kargakis notifications@github.com wrote:

Hmm, doesn't seem I can reproduce this in the current master neither with build-logs nor with start-build --follow


Reply to this email directly or view it on GitHub.

@0xmichalis
Copy link
Contributor

@thoraxe can you

  1. get the build-logs from a build in the default namespace?
  2. process a template in another namespace than default?
    eg.
osc process -n test -f examples/sample-app/application-template-stibuild.json

@sdodson
Copy link
Member

sdodson commented Apr 16, 2015

Both the default and a created namespace works as 'system:openshift-client' user. I suspect this is a user permissoins issue, it doesn't work as 'joe' which is a user defined via htpasswd identity provider.

Default namespace -- works

osc process -f examples/sample-app/application-template-stibuild.json > test.json
osc create -f test.json 
osc get builds
osc build-logs ruby-sample-build-1

Make a new namespace, re-test -- works

openshift admin new-project --admin=system:openshift-client issue1714
osc create -n issue1714 -f test.json 
osc get builds -n issue1714
osc build-logs -n issue1714 ruby-sample-build-1

Here it is as 'joe'

[joe@ose3 ~]$ osc login
Already logged into "https://ose3.os1.phx2.redhat.com:8443" as "joe".
Using project "sinatra"
[joe@ose3 ~]$ osc create -f test.json 
services/frontend
routes/route-edge
imageStreams/origin-ruby-sample
imageStreams/ruby-20-centos7
buildConfigs/ruby-sample-build
deploymentConfigs/frontend
services/database
deploymentConfigs/database
[joe@ose3 ~]$ osc get builds
NAME                             TYPE      STATUS     POD
ruby-sample-build-1              STI       Running    ruby-sample-build-1
simple-openshift-sinatra-sti-1   STI       Complete   simple-openshift-sinatra-sti-1
[joe@ose3 ~]$ osc build-logs ruby-sample-build-1
Error from server: "/osapi/v1beta1/proxy/buildLogs/ruby-sample-build-1?namespace=sinatra" is forbidden because joe cannot proxy on buildLogs with name "ruby-sample-build-1" in sinatra

@smarterclayton
Copy link
Contributor

@csrwng please get involved here as well

@csrwng
Copy link
Contributor

csrwng commented Apr 16, 2015

So the issue is that because we are now using the proxy to get at the build logs, we're exposing an issue in the Kubernetes proxy. It is responding with a 301 because the original request doesn't end with a "/" in the path, but the location in the 301 response doesn't include parameters that were passed in the original response, so we lose the namespace parameter:
A request to

https://10.0.2.15:8443/osapi/v1beta1/proxy/buildLogs/simple-openshift-sinatra-sti-1?namespace=project1

results in a 301 like:

HTTP/1.1 301 Moved Permanently
Location: /osapi/v1beta1/proxy/buildLogs/simple-openshift-sinatra-sti-1/

which doesn't include the namespace param.
Offending code is here:
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/apiserver/proxy.go#L197-L201

I'll submit a fix for the proxy upstream and switch the origin build logs to use the new log sub-resource.

@csrwng
Copy link
Contributor

csrwng commented Apr 17, 2015

Fixed with #1784

@brenton
Copy link
Contributor

brenton commented Apr 20, 2015

@csrwng, even after pulling in #1784 I'm seeing:

# osc build-logs simple-openshift-sinatra-sti-1
Error from server: "/osapi/v1beta1/proxy/buildLogs/simple-openshift-sinatra-sti-1?namespace=sinatra" is forbidden because joe cannot proxy on buildLogs with name "simple-openshift-sinatra-sti-1" in sinatra

Joe is the admin for the sinatra project.

@brenton
Copy link
Contributor

brenton commented Apr 20, 2015

cesar explains the fix for me in more detail. It this actually working as expected with the known current issue of only the admin's being able to access logs.

jboyd01 pushed a commit to jboyd01/origin that referenced this issue Feb 15, 2018
…service-catalog/' changes from b69b4a6c80..b758460ba7

b758460ba7 origin build: modify hard coded path
871582f73a origin build: add origin tooling
9fa4e70 chart changes for v0.1.8 (openshift#1741)
cada49c handle instance deletion that occurs during async provisioning or async update (openshift#1587) (openshift#1708)
3032f01 phony output binaries (openshift#1729)
0c98a72 remove last vestiges of glide (openshift#1696)
8435935 Prune vendor (openshift#1739)
0f657ec allow setting go version, clean up alignment
08af73f Disable test-dep target temporarily
41984a5 Check for existing bindings only for instances with DeprovisionStatus == ServiceInstanceDeprovisionStatusRequired. (openshift#1640)
706e555 chart changes for v0.1.7 (openshift#1721)
23644db we inconsistently rm thing with and without docker (openshift#1713)
a38092d Chart changes for Release v0.1.6 (openshift#1718)
2fd4ecf Add PodPreset into settings api group (openshift#1694)
bac68f4 update docs of developer's guide (openshift#1716)
3200b16 add integration test for proper async binding retry (openshift#1688)
6d809c3 Add custom columns to OpenAPI schema (openshift#1597)
fcdefa6 Workaround spf13/viper stringarray bug (openshift#1700)
ebbeb8c undo 6bad71d358ad3ad39eb8c003f5807cca1ec1d1e7 (openshift#1714)
1ee9659 Load all client auth plugins in the cli (openshift#1695)
b9ad10d must run tests (openshift#1698)
c621cdc add stages to Travis
REVERT: b69b4a6c80 origin build: modify hard coded path
REVERT: 527fac4d02 origin build: add origin tooling

git-subtree-dir: cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog
git-subtree-split: b758460ba7a45d370da9d5d634e71c16e9eb282a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

8 participants