question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unable to load schema information from the API server: the server has asked for the client to provide credentials

See original GitHub issue

I am getting following error

Previewing update (prod):

     Type                          Name                          Plan     Info
     pulumi:pulumi:Stack           syngenta-platform-prod                 1 error; 18 messages
     └─ kubernetes:core:ConfigMap  syngenta-platform-nodeAccess           1 error
 
Diagnostics:
  pulumi:pulumi:Stack (syngenta-platform-prod):
    Error: invocation of aws:ec2/getSubnet:getSubnet returned an error: grpc: the client connection is closing
        at /home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/@pulumi/pulumi/runtime/invoke.js:172:33
        at Object.onReceiveStatus (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:1210:9)
        at InterceptingListener._callNext (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:568:42)
        at InterceptingListener.onReceiveStatus (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:618:8)
        at callback (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:847:24)
    Error: invocation of aws:ec2/getSubnet:getSubnet returned an error: grpc: the client connection is closing
        at /home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/@pulumi/pulumi/runtime/invoke.js:172:33
        at Object.onReceiveStatus (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:1210:9)
        at InterceptingListener._callNext (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:568:42)
        at InterceptingListener.onReceiveStatus (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:618:8)
        at callback (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:847:24)
    Error: invocation of aws:ec2/getSubnet:getSubnet returned an error: grpc: the client connection is closing
        at /home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/@pulumi/pulumi/runtime/invoke.js:172:33
        at Object.onReceiveStatus (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:1210:9)
        at InterceptingListener._callNext (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:568:42)
        at InterceptingListener.onReceiveStatus (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:618:8)
        at callback (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:847:24)
 
    error: Running program '/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi' failed with an unhandled exception:
    Error: invocation of aws:ec2/getSubnet:getSubnet returned an error: grpc: the client connection is closing
        at /home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/@pulumi/pulumi/runtime/invoke.js:172:33
        at Object.onReceiveStatus (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:1210:9)
        at InterceptingListener._callNext (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:568:42)
        at InterceptingListener.onReceiveStatus (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:618:8)
        at callback (/home/narendra/Coding/platform/syngenta-platform-infra-using-pulumi/node_modules/grpc/src/client_interceptors.js:847:24)
 
  kubernetes:core:ConfigMap (syngenta-platform-nodeAccess):
    error: unable to load schema information from the API server: the server has asked for the client to provide credentials

Index.js

const pulumi = require("@pulumi/pulumi");
const aws = require("@pulumi/aws");
const awsx = require("@pulumi/awsx");
const eks = require("@pulumi/eks");

const config = {
  vpcName: "syngenta-platform",
  clusterName: "syngenta-platform"
};
// Create a VPC for our cluster.
const vpc = new awsx.ec2.Vpc(config.vpcName);

// Create the EKS cluster itself with Fargate enabled.
const cluster = new eks.Cluster(config.clusterName, {
  fargate: true,
  vpcId: vpc.id,
  privateSubnetIds: vpc.privateSubnetIds,
  deployDashboard: false
});

// Export the cluster's kubeconfig.
//TODO - make a TypeScript Project
//export const kubeconfig = cluster.kubeconfig;
exports.kubeconfig = cluster.kubeconfig;

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
metralcommented, Apr 8, 2020

@sylv3r

With a custom profile (and no default one in ~/.aws/credentials), the profile arg in a aws.Provider does not seem to be used at all for pulumi-nodejs:dynamic:Resource and kubernetes:core:ConfigMap

But if I add a default profile in ~/.aws/credentials, the resources are created

Looking at this closer, it appears that though the cluster and other resources are created, the dynamicResource (vpc-cni) and the configmap (aws-auth) are not created, as they rely on the cluster’s kubeconfig, which does not factor in the same credentials set in the custom AWS Provider.

We’re looking into a fix for this.


I still having an issue with aws:eks:FargateProfile, does not seem related though. Seems like I need to provide the private subnet myself ?

Yes, fargate only works with private subnets:

The IDs of subnets to launch pods into that use this profile. At this time, pods running on Fargate are not assigned public IP addresses, so only private subnets (with no direct route to an Internet Gateway) are accepted for this parameter.

1reaction
nsisodiyacommented, Dec 29, 2019

I think the problem is

  aws:profile: platform

I don’t use default aws profile. so I used pulumi config set aws:profile platform

Now that, I removed this config and copied aws creds from platform profile to default profile. I can see, ├─ kubernetes:core:ServiceAccount syngenta-platform-eks-admin created right now, I am running pulumi up and seems like it is working. Will update here again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

kubernetes - error: You must be logged in to the server
Running with an IoC tool like Terraform and you failed to pass the ... (the server has asked for the client to provide...
Read more >
Resolve the unauthorized server error for the Amazon EKS ...
I'm using kubectl commands to connect to the Amazon Elastic Kubernetes Service (Amazon EKS) API server. I received the message "error: You ...
Read more >
Troubleshooting | Google Kubernetes Engine (GKE)
The following error occurs when you try to connect to a GKE cluster using gcloud container clusters get-credentials , but the account doesn't...
Read more >
Troubleshooting Guide - Pulumi
This guide covers common troubleshooting techniques when using Pulumi, such as tracing, manually editing deployments, and resolving common errors.
Read more >
Chapter 4. The Kubernetes API Server - O'Reilly
attach provides you with the ability to attach a terminal to a running container within a Pod. The exec functionality that allows you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found