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.

403 Error when opening remote shell into container

See original GitHub issue

Hello, thank you very much for this very useful tool! When I try opening a remote shell into any of my pods I get a 403 error back. I am wondering if you know why that might be?

The error I see in kubebox is:

Error: Failed to get resource /api/v1/namespaces/<xxx>/pods/<xxx>/exec?stdout=1&stdin=1&stderr=1&tty=1&container=main&command=%2Fbin%2Fsh&command=-c&comma │
│nd=TERM%3Dxterm+%24%28+%28type+getent+%3E+%2Fdev%2Fnull+2%3E%261+%26%26+getent+passwd+root+%7C+cut+-d%3A+-f7+2%3E%2Fdev%2Fnull%29+%7C%7C+echo+%2Fbin%2Fsh%29, status code: 403

On the other hand I am able to open a shell into the main container using kubectl exec -it <xx> /bin/sh.

Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
gheinrichcommented, Nov 17, 2018

I noticed that kubectl uses a POST and kubebox uses a GET for the exec endpoint.

This fixed it for me:

@@ -176,7 +176,7 @@ class Client {
     command.forEach(c => path.addQuery('command', c));
     return merge({
       path    : path.toString(),
-      method  : 'GET',
+      method  : 'POST',
       headers : {
         // https://tools.ietf.org/html/rfc6455
         Connection               : 'Upgrade',

I can send a Pull Request.

0reactions
astefanutticommented, Jul 24, 2019

Let me speculatively close this. Feel free to re-open if you still face the issue with the latest release version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is the 403 Forbidden Error and How to Fix It (8 Methods ...
You might encounter the 403 forbidden error when you visit an empty website directory or a specific page that has a permission error....
Read more >
403 "Error: Forbidden" when opening the URL of my Cloud ...
If you receive a 403 "Error: Forbidden" error message when accessing your Cloud Run service, it means that your client is not authorized...
Read more >
403 Forbidden Error - What Is It and How to Fix It
The 403 Forbidden error usually occurs due to access misconfiguration. The misconfiguration involves improper read, write, or execute permission ...
Read more >
“403 Forbidden” Error - What is It and How to Fix It? - SiteGround
The “403 Forbidden” Error indicates you are restricted from accessing a webpage. Learn more about the common problems causing it and how to ......
Read more >
SharePoint Online: Fix "The remote server returned an error
Follow this checklist to resolve Executequery 403 forbidden error in SharePoint Online PowerShell: You may have provided the credentials of another tenant, ...
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