Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to write points through Go client when authentication enabled #2391

Closed
dkulchenko opened this issue Apr 22, 2015 · 0 comments · Fixed by #2400
Closed

Unable to write points through Go client when authentication enabled #2391

dkulchenko opened this issue Apr 22, 2015 · 0 comments · Fixed by #2400
Assignees

Comments

@dkulchenko
Copy link

This is with latest HEAD, for both influxd and the Go client, though the problem occurs with any of the 0.9 RCs as well.

When requiring authentication on the server and providing it through the Go client, writing points fails with the error unable to parse Basic Auth credentials.

Here's a test script which will fail on any influxd setup with auth enabled:

package main

import (
    "log"
    "net/url"
    "time"

    "github.com/influxdb/influxdb/client"
)

func main() {
    u, err := url.Parse("http://localhost:8086/")
    if err != nil {
        log.Fatalf("unable to parse influx URL: %s", err)
    }

    conf := client.Config{
        URL:      *u,
        Username: "influx",
        Password: "influx",
    }

    influx, err := client.NewClient(conf)
    if err != nil {
        log.Fatalf("unable to create influxd client: %s", err)
    }

    _, err = influx.Write(client.BatchPoints{
        Points:   []client.Point{client.Point{Name: "metric", Fields: map[string]interface{}{"value": 2}, Timestamp: time.Now()}},
        Database: "influx",
    })

    if err != nil {
        log.Fatalf("error: %s", err)
    } else {
        log.Println("succeeded")
    }
}
@corylanou corylanou self-assigned this Apr 23, 2015
mark-rushakoff pushed a commit that referenced this issue Jan 10, 2019
Add delete column and functionality to buckets list and row
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants