Getting OAuth Refresh Token Error UNAUTHORISED ERROR when hitting Bigtable - exception

I have an app that uses Bigtable-hbase api for creating an Bigtable Connection using Service Account File.
This works fine in the local and sometimes on weblogic server also.
But after some request through the api , I am getting the following error -
io.grpc.StatusRuntimeException: UNAUTHENTICATED: Unexpected failure get auth token at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:981)
at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:365)
at com.google.cloud.bigtable.grpc.io.RefreshingOAuth2CredentialsInterceptor.refreshCredentials(RefreshingOAuth2CredentialsInterceptor.java:379)
at com.google.cloud.bigtable.grpc.io.RefreshingOAuth2CredentialsInterceptor.access$100(RefreshingOAuth2CredentialsInterceptor.java:60)
at com.google.cloud.bigtable.grpc.io.RefreshingOAuth2CredentialsInterceptor$2.call(RefreshingOAuth2CredentialsInterceptor.java:328)
at com.google.cloud.bigtable.grpc.io.RefreshingOAuth2CredentialsInterceptor$2.call(RefreshingOAuth2CredentialsInterceptor.java:325)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)>
I am using following configuration to create the connection -
Configuration config = BigtableConfiguration.configure(projectId,instanceId);
config.set(BigtableOptionsFactory.BIGTABLE_SERVICE_ACCOUNT_JSON_KEYFILE_LOCATION_KEY, new File(filePath).toString());
Connection btConnection=ConnectionFactory.createConnection(config);
//then the code to read and write into the table`...
These code works fine sometimes and after some request it is throwing the above error.
I need to reason why it is happening and how can I resolve it so that application works fine when we sent the bulk request.
I think issue might be access refresh token , but how can I solve it?

Related

OCI SDK For DotNet Hangs When Doing Requests

I followed the example in described by Oracle here: https://docs.oracle.com/en-us/iaas/tools/dot-net-examples/51.3.0/vault/ListSecrets.cs.html and when I try any of the commands it sends a request and receives a response back with a response code of 200, but it does nothing after receiving a response. It just hangs. And I also only have 1 Vault and 1 Secret in that Vault. The logs stop with the log:
Setting Property Value from Header
Has any experienced this issue before?
I tried checking if it was the authentication, tried googling and tried other services like the KMSVaultService. I am expecting to get a value back when I call the ListSecrets method and for it not to hang.
The solution was to update the dependency packages. After doing that it started to work again

Heroku app: Error during WebSocket handshake: Unexpected response code: 200

I followed a tutorial on how to make a multiplayer tetris game, here is the repo:
https://github.com/Leftier/tetris
It worked just fine on localhost so I tried to deploy it in heroku (https://tetrixtest.herokuapp.com/ --ASD to move Q/E to rotate) but I get the following error:
WebSocket connection to 'wss://tetrixtest.herokuapp.com/' failed: Error during WebSocket handshake: Unexpected response code: 200
while trying to create the webSocket in this line (connection-manager.js line 14):
this.conn = new WebSocket(`wss://${window.location.hostname}:${window.location.port}`)
I don't know much about webSockets,
at first I thought that heroku was not able to handle websockets but that wasn't the case so I tried using the link directly as an argument instead of reading it from the browser but still the same issue.
I would like some clues/hints about why does this happens, I searched in google and github, but I only found issues related to socket.io
For me the solution was to turn on "Session affinity" by running this command heroku features:enable http-session-affinity
More info at https://devcenter.heroku.com/articles/session-affinity
Session affinity, sometimes referred to as sticky sessions, is a
platform feature that associates all HTTP requests coming from an
end-user with a single application instance (web dyno).

Configure PhpStorm to show Issues/Tasks from GitLab

I have a trouble to set up a GitLab's account to manage the tasks (issues) inside the PhpStorm from TOOLS > TASKS & CONTEXTS > CONFIGURE SERVERS
What is a TOKEN field ? Where do I find it, I've searched in my Profile on GitLab server but found nothing.
Only thing I have found and tried, is a Personal Access Tokens located here: https://gitlab.com/profile/personal_access_tokens
PERSONAL ACCESS TOKEN was already generated and used but it does not work.
=== UPDATED ===
Error log (I have replaced a real URL path with asterixes because of the privacy)
2017-09-25 19:59:41,023 [7154630] WARN - lij.tasks.impl.TaskManagerImpl - Cannot connect to GitlabRepository(URL='https://gitlab.com/***/***/issues')
com.intellij.tasks.impl.RequestFailedException: Request failed with HTTP error: 404 Not Found.
at com.intellij.tasks.impl.RequestFailedException.forStatusCode(RequestFailedException.java:16)
at com.intellij.tasks.impl.httpclient.TaskResponseUtil$GsonMultipleObjectsDeserializer.handleResponse(TaskResponseUtil.java:173)
at com.intellij.tasks.impl.httpclient.TaskResponseUtil$GsonMultipleObjectsDeserializer.handleResponse(TaskResponseUtil.java:151)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:222)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:164)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:139)
at com.intellij.tasks.gitlab.GitlabRepository.fetchProjects(GitlabRepository.java:139)
at com.intellij.tasks.gitlab.GitlabRepository.ensureProjectsDiscovered(GitlabRepository.java:254)
at com.intellij.tasks.gitlab.GitlabRepository.fetchIssues(GitlabRepository.java:160)
at com.intellij.tasks.gitlab.GitlabRepository.getIssues(GitlabRepository.java:107)
at com.intellij.tasks.TaskRepository.getIssues(TaskRepository.java:168)
at com.intellij.tasks.impl.TaskManagerImpl.a(TaskManagerImpl.java:783)
at com.intellij.tasks.impl.TaskManagerImpl.b(TaskManagerImpl.java:742)
at com.intellij.tasks.impl.TaskManagerImpl.a(TaskManagerImpl.java:736)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:342)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
From what I gather, if you generated the token correctly on the Gitlab side (SETTINGS > ACCESS TOKENS > CREATE PERSONAL ACCESS TOKEN) and inserted it into the token field at TOOLS > TASKS & CONTEXTS > CONFIGURE SERVERS in PhPStorm, it could be a timeout problem.
If you go to SETTINGS(Ctrl+Alt+S) > TASKS and change the CONNECTION TIMEOUT parameter to, say, 20000ms it should work.
Please refer to this post if you have any doubts.
You need to create a new Personal Access Token here https://gitlab.com/profile/personal_access_tokens
and put it in that field.
Have you checked this:
https://confluence.jetbrains.com/display/PhpStorm/Integration+with+an+Issue+Tracking+System+in+PhpStorm

Couchbase server connection is giving an authentication error

All I want to do is to do an upsert operation. I have a JsonDocument and I have a Couchbase server "123.456.789.1011" and a bucket inside, called "testbucket". Now, when I open the server using the IP address with port 8091, it asks me for a username and password say "uname","pwd" and, after entering, it opens. There is no any password for my bucket.
cluster = CouchbaseCluster.create("123.456.789.101");
cluster.clusterManager("testuser","testuser123");
bucket = cluster.openBucket("testbucket");
jsonObject = JsonObject.create()
.put("Order",map);
jsonDocument = JsonDocument.create("Hello",jsonObject);
jsonDocumentResponse = bucket.upsert(jsonDocument);
This is my code, but the problem is always on running the code I get an error saying that
ERROR spark.webserver.MatcherFilter -
com.couchbase.client.java.error.InvalidPasswordException: Passwords for bucket "testbucket" do not match.
at com.couchbase.client.java.CouchbaseAsyncCluster$1.call(CouchbaseAsyncCluster.java:156)
at com.couchbase.client.java.CouchbaseAsyncCluster$1.call(CouchbaseAsyncCluster.java:146)
at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$1.onError(OperatorOnErrorResumeNextViaFunction.java:77)
at rx.internal.operators.OperatorMap$1.onError(OperatorMap.java:49)
at rx.internal.operators.NotificationLite.accept(NotificationLite.java:147)
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.pollQueue(OperatorObserveOn.java:177)
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.access$000(OperatorObserveOn.java:65)
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber$2.call(OperatorObserveOn.java:153)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
I am new to Couchbase, and I really don;t know what to do. I Googled it but nothing is there on the web. Even their documentation is also not suggesting me anything. I hope someone on StackOverflow will surely have an answer for me. Thanks.
It would seem you need to pass a bucket password(which is different than the cluster password) in the openBucket method: http://docs.couchbase.com/sdk-api/couchbase-java-client-2.0.0/com/couchbase/client/java/Cluster.html#openBucket%28java.lang.String,%20java.lang.String%29
It looks like you're trying to connect a bucket using the cluster credentials. Try instead connect to a bucket with bucket username and an empty password:
cluster = CouchbaseCluster.create("123.456.789.101");
bucket = cluster.openBucket("testbucket", "");

Foursquare callback error Uncaught exception

I use foursquare API in an application. I have no issues when I run the app on my local machine but on a server I get this error after the user allows the app and is redirected to the callback url.
Fatal error: Uncaught exception 'EpiFoursquareException'
in /home/content/40/9029540/html/earlybirds/test/lib/EpiFoursquare.php:252
Stack trace:
#0 /home/content/40/9029540/html/earlybirds/test/lib/EpiFoursquare.php(208): EpiFoursquareException::raise(Object(EpiCurlManager), false)
#1 /home/content/40/9029540/html/earlybirds/test/lib/EpiFoursquare.php(196): EpiFoursquareJson->__get('response')
#2 /home/content/40/9029540/html/earlybirds/test/callback.php(45): EpiFoursquareJson->offsetGet('access_token')
#3 {main} thrown in /home/content/40/9029540/html/earlybirds/test/lib/EpiFoursquare.php on line 252
Anyone knows the reason?
I use PHP and mysql
Make sure you send the redirect_uri param when building your auth url and that it matches the one on the APP details page. I had to make two apps, one for testing locally and one for testing on my dev server which had, of course, a different URL.