The resource could not be found in jclouds - openstack-swift

I got this when I am trying
04:59:49.489 [main] DEBUG jclouds.wire` - <<
<html><h1>Not Found</h1><p>The resource could not be found.</p></html>
null
04:59:49.520 [main] DEBUG o.j.rest.internal.InvokeHttpMethod - >> invoking container:list
04:59:49.521 [main] DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - Sending request -1849476372: GET http://xxx.xx.xx.xxx:8080/v1/AUTH_2c5c2fbbfe22422496d5ebf6861199f2/?format=json HTTP/1.1
04:59:49.521 [main] DEBUG jclouds.headers - >> GET http://xxx.xx.xx.xxx:8080/v1/AUTH_2c5c2fbbfe22422496d5ebf6861199f2/?format=json HTTP/1.1
04:59:49.522 [main] DEBUG jclouds.headers - >> Accept: application/json
04:59:49.522 [main] DEBUG jclouds.headers - >> X-Auth-Token:
At line
swiftApi.getObjectApiForRegionAndContainer("RegionOne", CONTAINER_NAME).get(OBJECT_NAME);
how to resolve this
Please share any links or sample application related to content retrieval from openstack by jclouds.

Try the Swift example in the jclouds OpenStack Guide. I just tried it on a DevStack instance and it's working.
If you can get that to work, you should be able to get your own code to work too.

Related

Bug? v12.0.4 Account Console loading

Is there a bug with respect to Keycloak v12.0.4 ?
It is hanging on 'Account Console loading ...'.
HTTP sequence on clicking 'Impersonate' on all realms below. NB: https://example.com/authjs/keycloak.js is a 404 NOT FOUND.
POST https://example.com/auth/admin/realms/master/users/3467c293-741d-4345-8e06-a2a17ea71458/impersonation HTTP/1.1
GET https://example.com/auth/realms/master/account HTTP/1.1
GET https://example.com/auth/realms/master/account/ HTTP/1.1
GET https://example.com/authjs/keycloak.js HTTP/1.1
GET https://example.com/auth/resources/d5e5y/account/keycloak.v2/welcome-page-scripts.js HTTP/1.1
Yes, you are right this is a bug that according to the Keycloak mailing list is currently being tracked by the following stories:
authjs/keycloak.js 404 NOT FOUND related stories;
Infinite loop logging as an user or impersonating an user as admin.
The authjs/keycloak.js 404 NOT FOUND error on 12.0.x is related to this bug https://issues.redhat.com/browse/KEYCLOAK-16709?jql=text%20~%20%22%2Fauthjs%2Fkeycloak.js%22%20ORDER%20BY%20lastViewed%20DESC - you just need a leading / on KEYCLOAK_FRONTEND_URL and it fixes it.

Log url of request on InternalServerError in http4s

http4s returns InternalServerError if an unhandled error happened.
Is it possible to log url of the request when InternalServerError happened?
If yes, what is the best way to do it?
Isn't it doing this right out of the box?
Here's log from g8 template project from quick start guide https://http4s.org/v0.21/
with added route that throws runtime exception:
[ioapp-compute-1] INFO o.h.s.m.Logger - HTTP/1.1 GET /bad_joke Headers(Accept: */*, Cache-Control: no-cache, Host: localhost:8089, Connection: Keep-Alive, User-Agent: Apache-HttpClient/4.5.12 (Java/11.0.8), Accept-Encoding: gzip,deflate) body=""
[ioapp-compute-1] INFO o.h.s.m.Logger - service raised an error: class java.lang.RuntimeException
[ioapp-compute-1] ERROR o.h.s.service-errors - Error servicing request: GET /bad_joke from 127.0.0.1
java.lang.RuntimeException: haha
at pack.H4sRoutes$$anonfun$jokeRoutes$1.applyOrElse(H4sRoutes.scala:19)
at pack.H4sRoutes$$anonfun$jokeRoutes$1.applyOrElse(H4sRoutes.scala:13)
at $anonfun$combineK$1 # org.http4s.syntax.KleisliResponseOps.$anonfun$orNotFound$1(KleisliSyntax.scala:38)
at getOrElse # org.http4s.syntax.KleisliResponseOps.$anonfun$orNotFound$1(KleisliSyntax.scala:38)
at guaranteeCase$extension # org.http4s.server.middleware.RequestLogger$.$anonfun$impl$9(RequestLogger.scala:97)
at map # org.http4s.server.middleware.RequestLogger$.$anonfun$impl$9(RequestLogger.scala:101)
at flatMap # org.http4s.server.middleware.RequestLogger$.$anonfun$impl$7(RequestLogger.scala:82)
at flatMap # org.http4s.server.middleware.ResponseLogger$.$anonfun$impl$7(ResponseLogger.scala:65)
at guaranteeCase$extension # org.http4s.server.middleware.ResponseLogger$.$anonfun$impl$7(ResponseLogger.scala:88)
at main$ # pack.Main$.main(Main.scala:5)

Error uploading google action via gactions

I created a project marvin-xyz, and a json action file marvin.json
When I try to upload it with the CIA tools from google: gactions,
I get the following error:
$gactions test --action_package marvin.json --project marvin-xyz
Pushing the app for the Assistant for testing...
ERROR: Failed to test the app for the Assistant
ERROR: Internal error encountered.
2017/09/28 10:35:28 Server did not return HTTP 200
xyz is just a placeholder here - the project exists - in both cases, the real one has been used
Any advice?
EDIT: here it the update with the verbose option
$gactions --verbose test --action_package marvin.json --project marvin-xyz
Checking for updates...
Successfully fetched update metadata
Finished checking for updates -- no updates available
Pushing the app for the Assistant for testing...
POST /v2/users/me/previews/marvin-xyz:updateFromAgentDraft?updateMask=previewActionPackage.actionPackage.actions%2CpreviewActionPackage.actionPackage.conversations%2CpreviewActionPackage.actionPackage.types%2CpreviewActionPackage.startTimestamp%2CpreviewActionPackage.endTimestamp HTTP/1.1
Host: actions.googleapis.com
User-Agent: Gactions-CLI/2.0.7 (darwin; amd64; stable/XYZ)
Content-Length: 697
Content-Type: application/json
Accept-Encoding: gzip
{"name":"users/me/previews/marvin-xyz","previewActionPackage":{"actionPackage":{"actions":[{"description":"Default Welcome Intent","fulfillment":{"conversationName":"marvin"},"intent":{"name":"actions.intent.MAIN","trigger":{"queryPatterns":[{"queryPatterns":"I want to talk to marvin"},{"queryPatterns":"talk to marvin"},{"queryPatterns":"wake up marvin"},{"queryPatterns":"is marvin there?"},{"queryPatterns":"where is marvin?"},{"queryPatterns":"hello marvin"},{"queryPatterns":"pass me to marvin"},{"queryPatterns":"marvin please"}]}},"name":"MAIN"}],"conversations":{"marvin":{"name":"marvin","url":"https://example.com/sidekick/api/v1/"}}},"name":"users/me/previews/marvin-xyz"}}
Reading credentials from: creds.data
ERROR: Failed to test the app for the Assistant
ERROR: Internal error encountered.
2017/09/29 23:37:09 Server did not return HTTP 200

Spring-Boot-Admin on Cloud Foundry: Showing UP applications as OFFLINE

We are developing a Boot-Admin dashboard using the codecentric provided library of spring-boot-admin-server version 1.4.5
Some of the applications are registering itself with the server via Eureka, and some directly using the spring-boot-admin-starter-client version 1.4.5.
All components are deployed on a PCF environment and are communication over HTTPS. In either ways, the applications though are able to register themselves with the admin sever but are showing up as OFFLINE only. There are no errors reported in the logs for any of the components viz. admin-server, admin-client, eureka-server, eureka-client.
However the only application showing as Up is the admin server itself.
The application properties for spring-boot-admin-client app to run in PCF is:
spring:
application:
name: bootadmin-ms-charlie
boot:
admin:
url: https://bootadmin-dashboard.abc.intl.com
ssl:
trust_store:
path: classpath:ssl/sslcacert.jks
password: a-password
As the result is same for both methods of registration, I've skipped putting the config here for apps registering via Eureka path to keep it simple.
The same is working perfectly fine locally, where the admin dashboard shows all the applications as expected.
Is there any configuration that needs to be done in specific to Cloud Foundry?
Or any obvious mistake that I might have made?
Any suggestions are most welcome.
---EDIT---
Here are the logs from SBA server showing that the communication between server and client is working okay. If these logs give any indication of an error, please point out.
OUT 2017-01-23 05:15:15.139 DEBUG 10 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : DispatcherServlet with name 'dispatcherServlet' processing POST request for [/api/applications]
OUT 2017-01-23 05:15:15.151 DEBUG 10 --- [nio-8080-exec-1] m.m.a.RequestResponseBodyMethodProcessor : Read [class de.codecentric.boot.admin.model.Application] as "application/json;charset=UTF-8" with [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter#7df33a9f]
OUT 2017-01-23 05:15:15.163 DEBUG 10 --- [nio-8080-exec-1] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Written [Application [id=3805ee6a, name=bootadmin-ms-charlie, managementUrl=http://23fcf304-82d6-44cd-7fce-2a5027de9f21:8080, healthUrl=http://23fcf304-82d6-44cd-7fce-2a5027de9f21:8080/health, serviceUrl=http://23fcf304-82d6-44cd-7fce-2a5027de9f21:8080]] as "application/json" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter#7df33a9f]
OUT 2017-01-23 05:15:15.166 DEBUG 10 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
OUT 2017-01-23 05:15:15.166 DEBUG 10 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Successfully completed request
OUT bootadmin-dashboard.abc-intl.com - [23/01/2017:05:15:15.140 +0000] "POST /api/applications HTTP/1.1" 201 302 308 "-" "Java/1.8.0_121" 60.16.25.20:43224 x_forwarded_for:"10.10.10.10" x_forwarded_proto:"https" vcap_request_id:a40159e4-543f-40e0-627e-e8f1e7688b99 response_time:0.034164523 app_id:adcc8a33-83f4-448d-9ae2-bf2a2b16ea72
OUT 2017-01-23 05:15:18.719 DEBUG 10 --- [ updateTask1] o.s.web.client.RestTemplate : Created GET request for "http://23fcf304-82d6-44cd-7fce-2a5027de9f21:8080/health"
OUT 2017-01-23 05:15:18.722 DEBUG 10 --- [ updateTask1] o.s.web.client.RestTemplate : Setting request Accept header to [application/json, application/*+json]
The logs from client are all clean. It throws warning of "Failed to refister" only when the server is down.
Based upon the discussion on https://github.com/codecentric/spring-boot-admin/issues/399 it has been found out that below properties are vital for SBA clients to work with Dashboard on Cloud Foundry or container based architecture:
spring:
boot:
admin:
client:
management-url: <complete management-url for the client>
health-url: <complete health endpoint url for the client>
service-url: <complete root/service url for the client>
This is due to the fact that, when a client registers itself with the
SBA server it uses the runC container ID to form its service url. Such url is not valid for the Cloud Foundry router. That results in failure of communication between SBA dashboard and the client later on, causing it to show as OFFLINE.
The other approach can be to go ahead with container IPs, using spring.boot.admin.client.prefer-ip=true. That would list all containers/CF instacnes on SBA but not give a clear picture of overall health of the complete app from a site/AZ. Also direct connection to containers is never encouraged in CF as per the principles of cloud-native app and 12-factors.

Dredd seems to hang with api calls to asp.net kestrel server

When I run dredd, it seems to just hang after the first api call. I'm not sure how to debug or diagnose. I'm running an asp.net 5 mvc 6 api service with the dnx web command. How can I see what's going on or what the issue might be?
I tried adding hooks for debugging and see that it calls the first api and then just never triggers the after event. I tested the api with postman and curl with correct results. Dredd also works with the same blueprint if I'm using an express node.js server.
The only combination that fails is Dredd with the asp.net kestrel server response. The server logs that the request is made and a response is sent so it does trigger the test, but just never finishes.
Is Dredd looking for some sort of after processing hook, because I see the server receiving the request with dredd regardless of .net or node.js. Even if I spin up the .net api process in another process it doesn't work, why would that matter? It should just be http requests for dredd in any case right?
Does it care that it's coming back from a kestrel server?
kestrel response
Content-Type → application/json; charset=utf-8
Date → Wed, 06 Jan 2016 17:14:10 GMT
Server → Kestrel
Transfer-Encoding → chunked
Body {"foo":"bar"}
dredd.yml
dry-run: null
hookfiles: null
language: nodejs
sandbox: false
server: dnx web
server-wait: 3
init: false
names: false
only: []
output: []
header: []
sorted: false
user: null
inline-errors: false
details: false
method: []
color: true
level: verbose
timestamp: false
silent: false
path: []
blueprint: test.apib
endpoint: 'http://localhost:5000'
console output of dredd command
Starting server with command: dnx web
Waiting 3 seconds for server command to start...
Hosting environment: Production
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
info: Beginning Dredd testing...
info: Found Hookfiles: hooks.js
hook: before all
hook: before each
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[1]
Request starting HTTP/1.1 GET http://localhost:5000/message
info: Microsoft.AspNet.Mvc.Controllers.ControllerActionInvoker[1]
Executing action method Foo.Controllers.HelloController.Get with arguments () - ModelState is Valid'
info: Microsoft.AspNet.Mvc.Infrastructure.ObjectResultExecutor[1]
Executing ObjectResult, writing value Microsoft.AspNet.Mvc.ActionContext.
info: Microsoft.AspNet.Mvc.Infrastructure.MvcRouteHandler[2]
Executed action Foo.Controllers.HelloController.Get in 0.0165ms
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[2]
Request finished in 0.041ms 200 application/json; charset=utf-8
test.apib
# GET /message
+ Response 200 (application/json; charset=utf-8)
{"foo":"bar"}
It is correctly passing on my machine (MacOSX with coreclr mono rc2)
The same goes with the nodejs version you provided in the repo.
The only thing I had to change in my application was the startup command:
dnx run --server Microsoft.AspNet.Server.Kestrel
but I do not really think that is the problem here.