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.

Incorrect password, local config.yaml not used

See original GitHub issue

OS/Web Information

  • Web Browser: Chrome
  • Local OS: Windows / MacOS
  • Remote OS: Ubuntu
  • Remote Architecture: amd64
  • code-server --version: 3.10.1

Steps to Reproduce

  1. Create a config.yaml and fill in the fields like this
bind-addr: 0.0.0.0:8080
auth: password
hashed-password: xxxx
cert: false

The hashed password was generated with printf "thisismypassword" | sha256sum | cut -d' ' -f1 2. Setup Nginx proxy conf file, and launch with docker compose

 code-server:
    image: codercom/code-server:latest
    container_name: "code-server"
    hostname: "code-server"
    restart: unless-stopped
    user: root
    environment: 
      - DOCKER_USER=${USER}
    expose:
      - "8080"
    volumes:
      - ${WORK_DIR}:/home/coder/project
      - ${HOME}/.vscode:/home/coder/.local/share/code-server
      - ${HOME}/.config/code-server:/home/coder/.config/code-server

  1. Go to my browser and type in the password, but always receive a “Incorrect password” error.
  2. I checked the config file ~/.config/code-server/config.yaml inside the container and it was the same as the local one.

Expected

Login page leads to coder workspace upon entering the password specified in local config.yaml

Actual

Login page shows “Incorrect password”. Container logs output “Failed login attempt”.

Logs

This were the logs from the container

[2021-05-20T14:20:59.093Z] info  Wrote default config file to ~/.config/code-server/config.yaml
[2021-05-20T14:20:59.548Z] info  code-server 3.10.1 421237f499079cf88d68c02163b70e2b476bbb0d
[2021-05-20T14:20:59.549Z] info  Using user-data-dir ~/.local/share/code-server
[2021-05-20T14:20:59.570Z] info  Using config file ~/.config/code-server/config.yaml
[2021-05-20T14:20:59.570Z] info  HTTP server listening on http://0.0.0.0:8080
[2021-05-20T14:20:59.570Z] info    - Authentication is enabled
[2021-05-20T14:20:59.570Z] info      - Using password from ~/.config/code-server/config.yaml
[2021-05-20T14:20:59.571Z] info    - Not serving HTTPS
Failed login attempt {"xForwardedFor":"x.x.x.x","remoteAddress":"x.x.x.x","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","timestamp":1621520562}

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jingw222commented, May 21, 2021

Thanks for the quick reply. Since the environment variable $HASHED_PASSWORD always takes precedence I finally managed to login that way. Not sure if it was caused by some of sort cache by container volumes.

1reaction
code-ashercommented, May 20, 2021

All right now that I have the right directory it works for me. I generated my password the same way. Nothing looks out of place to me.

Does the login page say that the password is from the config file?

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm install gives unauthorized name or password is incorrect ...
I had auth credentials in my .npmrc file which weren't registered with the public registry. If you have other config pairs in that...
Read more >
Configuring a registry - Docker Documentation
Configuring a registry. The Registry configuration is based on a YAML file, detailed below. While it comes with sane default values out of...
Read more >
Configure the EB CLI - AWS Elastic Beanstalk
If no profiles are found, or a profile is found but does not have permission to use Elastic Beanstalk, the EB CLI prompts...
Read more >
Introduction to YAML Configurations - CircleCI
Steps are a list of commands to run inside the Docker container. # CircleCI configuration file version: 2.1 jobs: build: docker: - image:...
Read more >
Config file processing in Spring Boot 2.4
security.user.password: usera --- spring.profiles: local ... When using spring.config.import: vault://, application no more writes ...
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