'204 No Content' no data found in influxdb - influxdb

Successfully installed influxdb on windows and everything is working as expected locally. But having trouble posting data from outside using http api.
I am able to connect to admin panel locally through
http://localhost:8083/
I am using below command for posting data from a remote server:
curl -i -XPOST 'http://172.29.6.195:8086/write?db=telegraf' --data-binary 'test_load,host=njxap1dbadm01 value=13.64'
I am getting below success message:
HTTP/1.1 204 No Content
Request-Id: d3b58c0c-f620-11e5-80a1-000000000000
X-Influxdb-Version: unknown
Date: Wed, 30 Mar 2016 02:40:55 GMT
log on server side:
[http] 2016/03/29 22:40:55 172.29.18.10 - - [29/Mar/2016:22:40:55
-0400] POST /write?db=telegraf HTTP/1.1 204 0 - curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC
zlib/1.2.3 libidn/1.18 libssh2/1.4.2
d3b58c0c-f620-11e5-80a1-000000000000 0
Even though I got the sucess message on client side some how the data is not getting saved on the database.
I checked for the data from admin panel and returning no data.Checked with curl get also no results.
I have retention policy of 1day for my database.
Please help me resolve with the issue of why the data is not getting saved to database.

I'm trying to reproduce this, but I'm not able to with the latest version on InfluxDB.
~$ curl -i -XPOST 'http://localhost:8086/write?db=telegraf' --data-binary 'test_load,host=njxap1dbadm01 value=13.64'
HTTP/1.1 204 No Content
Request-Id: 38fcfb17-fac3-11e5-8004-000000000000
X-Influxdb-Version: unknown
Date: Tue, 05 Apr 2016 00:13:28 GMT
Logs:
[http] 2016/04/04 17:13:28 ::1 - - [04/Apr/2016:17:13:28 -0700] POST /write?db=telegraf HTTP/1.1 204 0 - curl/7.43.0 38fcfb17-fac3-11e5-8004-000000000000 3.776752ms
Querying:
> use telegraf
Using database telegraf
> show series
key
test_load,host=njxap1dbadm01
> select * from test_load
name: test_load
---------------
time host value
1459815208633910164 njxap1dbadm01 13.64
Do you know what version of InfluxDB you are using?

Related

Artifactory Docker 404 after upgrade to 7.4.1

After an Artifactory upgrade to 7.4.1 from 6.10.4, I've made the necessary port changes and the UI works fine, but I'm seeing the following in the artifactory-service log when attempting to use docker login via the subdomain method:
Request /v2/ should be a repo request and does not match any repo key
The docker login command prompts for authentication but then returns:
Error response from daemon: login attempt to http://<local-docker-repo>.<artifactory-url>.com/v2/ failed with status: 404 Not Found
Artifactory is running in a Kubernetes cluster behind an nginx ingress controller, which has an ingress set up specifically to serve https://<local-docker-repo>.<artifactory-url>.com via the same backend as the Artifactory UI. It seems like some URL rewrite functionality is not working, I'm just not sure how I've misconfigured it as I had no problems in the previous version.
Curl results as follows:
curl -i -L -k http://docker-local.<artifactory-url>.com/v2/
HTTP/1.1 308 Permanent Redirect
Server: nginx/1.15.9
Date: Mon, 21 Sep 2020 00:25:32 GMT
Content-Type: text/html
Content-Length: 171
Connection: keep-alive
Location: https://docker-local.<artifactory-url>.com/v2/
X-JFrog-Override-Base-Url: ://docker-local.\<artifactory-url>.com:80
X-Forwarded-Port: 80
Host: docker-local.artifactory.<artifactory-url>.com
X-Forwarded-For: 10.60.1.1
HTTP/2 401
server: nginx/1.15.9
date: Mon, 21 Sep 2020 00:25:32 GMT
content-type: application/json;charset=ISO-8859-1
content-length: 91
www-authenticate: Basic realm="Artifactory Realm"
x-artifactory-id: ea0c76c54c1ef5de:45761df0:174ad9a6887:-8000
x-artifactory-node-id: artifactory-0
x-jfrog-override-base-url: ://docker-local.<artifactory-url>.com:443
x-forwarded-port: 443
host: docker-local.<artifactory-url>.com
x-forwarded-for: 10.60.x.x
strict-transport-security: max-age=15724800; includeSubDomains
{
"errors" : [ {
"status" : 401,
"message" : "Authentication is required"
} ]
Any help would be greatly appreciated!
Edit: As a workaround I've enabled Repository Path as the Docker access method, which works fine -- still not sure where subdomain is going wrong.
The issue was that the $repo variable in the nginx rewrite rules provided by Artifactory was not getting populated for some reason. Since we only have a single registry being used in the subdomain method, I updated the rewrite rule to provide the repo name which resolved the issue.
To illustrate:
rewrite ^/(v1|v2)/(.*) /artifactory/api/docker/$repo/$1/$2;
was changed to:
rewrite ^/(v1|v2)/(.*) /artifactory/api/docker/docker-local/$1/$2;

Inserting measurements through shell script and CURL failing

curl -i -XPOST 'http://127.0.0.1:8086/write?db=test' --data-binary $"inspec_reporting,profile=$profile success_control=$success_control,failure_control=$failure_control,skip_control=$skip_control,success_summary=$success_summary,failure_summary=$failure_summary,skip_summary=$skip_summary"
The above one is not working.
it is failing by adding special characters. When printed, not getting those special characters. Getting those special characters only with curl & influxDB.
HTTP/1.1 400 Bad Request
Content-Type: application/json
Request-Id: b60dd70d-ac82-11e9-9742-000000000000
X-Influxdb-Build: OSS
X-Influxdb-Error: unable to parse '$'inspec_reporting,profile=rhel7_enhanced_profile success_control=65,failure_control=72,skip_control=1,success_summary=252,failure_summary=211,skip_summary=1'': invalid boolean
X-Influxdb-Version: 1.6.2
X-Request-Id: b60dd70d-ac82-11e9-9742-000000000000
Date: Mon, 22 Jul 2019 13:15:01 GMT
Content-Length: 302
{"error":"unable to parse
'$'inspec_reporting,profile=rhel7_enhanced_profile
success_control=\u001b[38;5;41m65,failure_control=\u001b[38;5;9m72,skip_control=\u001b[38;5;247m1,success_summary=\u001b[38;5;41m252,failure_summary=\u001b[38;5;9m211,skip_summary=\u001b[38;5;247m1'':
invalid boolean"}

Insufficient scope when attempting to get Docker Hub catalog

I'm attempting to get a catalog listing for Docker hub, but so far I'm just getting an error in response. My understanding is I'd need to pass a bearer token with the catalog request, so I start by getting that token with the related scope:
curl -u "username:password "https://auth.docker.io/token?service=registry.docker.io&scope=registry:catalog:*"
(this is using username/password from my Docker Hub account)
I then pass the returned token to the registry:
curl -vL -H "Authorization: Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6I(...)" https://registry-1.docker.io/v2/_catalog
In response to that request, I'm getting:
* Trying 54.86.130.73...
* Connected to registry-1.docker.io (54.86.130.73) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.docker.io
* Server certificate: RapidSSL SHA256 CA - G3
* Server certificate: GeoTrust Global CA
> GET /v2/_catalog HTTP/1.1
> Host: registry-1.docker.io
> User-Agent: curl/7.43.0
> Accept: */*
> Authorization: Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6I(...)
>
< HTTP/1.1 401 Unauthorized
HTTP/1.1 401 Unauthorized
< Content-Type: application/json; charset=utf-8
Content-Type: application/json; charset=utf-8
< Docker-Distribution-Api-Version: registry/2.0
Docker-Distribution-Api-Version: registry/2.0
< Www-Authenticate: Bearer realm="https://auth.docker.io/token",service="registry.docker.io",scope="registry:catalog:*",error="insufficient_scope"
Www-Authenticate: Bearer realm="https://auth.docker.io/token",service="registry.docker.io",scope="registry:catalog:*",error="insufficient_scope"
< Date: Fri, 06 May 2016 23:00:08 GMT
Date: Fri, 06 May 2016 23:00:08 GMT
< Content-Length: 134
Content-Length: 134
< Strict-Transport-Security: max-age=31536000
Strict-Transport-Security: max-age=31536000
<
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"registry","Name":"catalog","Action":"*"}]}]}
...which seems to be asking me to go back and get authorized with the URL I entered above.
Should this be possible? If so, what am I missing?
I got the same problem, raised this with docker support and got the following answer,
"The catalog endpoint does not work against Docker Hub because that endpoint actually lists all the repositories on a Registry, and we disabled it as it would list all repositories on Docker Hub."
If you want repository information for a username or organization, an alternative is to use V1 api. The problem with this is you need to make multiple calls based on the number of repos available.
The following command will give the repos available for a given username :
curl -k -H "Authorization: Basic <encripted username:password>" -H "Accept: application/json" -X GET "https://index.docker.io/v1/search?q=<username>&n=100"
Here q is the query and n is the number of items to be returned in each page.
Another call can be made based on what data you need by passing repo as a parameter.

Cannot log in Neo4j server

On a fresh install of neo4j-community-2.2.4 I get the message "Invalid username or password." when submitting the login form at localhost:7474/browser with the default username neo4j and password neo4j.
I did enable org.neo4j.server.webserver.address=0.0.0.0 and dbms.security.auth_enabled=true with a server stop and start and a browser shift-reload.
I then changed the property org.neo4j.server.webserver.address=127.0.0.1 to match my /etc/hosts and tried on 127.0.0.1:7474/browser but got the same message.
Here is the browser console output:
Remote Address:127.0.0.1:7474
Request URL:http://localhost:7474/db/data/
Request Method:GET
Status Code:401 Unauthorized
Request Headersview source
Accept:application/json, text/plain, */*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8,fr;q=0.6,ru;q=0.4,es;q=0.2,sv;q=0.2,nb;q=0.2,et;q=0.2
Authorization:Basic bmVvNGo6bmVvNGo=
Cache-Control:no-cache
Connection:keep-alive
Cookie:languageCodeAdmin=en; PHPSESSID=vcbvfkvj3shajhlh5u2pue9i70; admin_template_phone_client=0; admin_template_touch_client=0; admin_template_model=1
Host:localhost:7474
If-Modified-Since:Wed, 11 Dec 2013 08:00:00 GMT
Pragma:no-cache
Referer:http://localhost:7474/browser/
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.120 Chrome/37.0.2062.120 Safari/537.36
X-stream:true
Response Headersview source
Content-Length:135
Content-Type:application/json; charset=UTF-8
Date:Sat, 19 Sep 2015 09:14:03 GMT
Server:Jetty(9.2.4.v20141103)
WWW-Authenticate:None
{
"errors" : [ {
"message" : "Invalid username or password.",
"code" : "Neo.ClientError.Security.AuthorizationFailed"
} ]
}
So I then tried to change the default password.
To do that, I first disabled the authentication with a dbms.security.auth_enabled=false and a server stop and start.
And I then tried the following curl request:
curl -H "Accept:application/json; charset=UTF-8" -H "Content-Type: application/json" "http://localhost:7474/user/neo4j/password" -X POST -d "{ \"password\" : \"neo4j\" }" -i
But it gives me the response:
HTTP/1.1 404 Not Found
Date: Sat, 19 Sep 2015 09:25:38 GMT
Access-Control-Allow-Origin: *
Content-Length: 0
Server: Jetty(9.2.4.v20141103)
Since you get an authentication error on your browser request which uses the default credentials neo4j:neo4j your database has already a different password configured. To reset it to default, stop neo4j, delete data/dbms/auth and start it again. Now you can use the default pw.
In my case Neo4J windows services was not installed just followed below steps
neo4j.bat install-service
neo4j.bat status
neo4j.bat start
it worked, cheers

RSS parsing error on Heroku

I'm doing some simple RSS parsing and rendering - works perfectly fine on localhost and production at Heroku, but for some reason this particular RSS feed works only on localhost, but not when deployed at Heroku.
Here is the RSS feed:
http://careers.joelonsoftware.com/jobs/feed?tags=network
Here is the error I get on Heroku:
A ActionView::Template::Error occurred in jobs#index:
503 Service Unavailable
/usr/local/lib/ruby/1.9.1/open-uri.rb:346:in `open_http'
Here is my code:
#rss = RSS::Parser.parse(the_rss_feed, false)
render :partial => "layouts/rss_syndicated_jobs", :locals => {:rss => #rss}
I'm requiring:
require 'rss/2.0'
require 'open-uri'
This seems to be a perfectly valid RSS feed - and again, works fine on localhost - but not when deployed at Heroku....any thoughts?
That domain doesn't like heroku's servers making HTTP GET requests.
From Heroku
➜ deefour ✗ heroku run "curl -s -D - careers.joelonsoftware.com/jobs/feed -o /dev/null"
Running `curl -s -D - careers.joelonsoftware.com/jobs/feed -o /dev/null` attached to terminal... up, run.9211
HTTP/1.0 503 Service Unavailable
Cache-Control: no-cache
Connection: close
Content-Type: text/html
From Local Machine
➜ deefour ✗ curl -s -D - careers.joelonsoftware.com/jobs/feed -o /dev/null
HTTP/1.1 200 OK
Cache-Control: private, max-age=1800
Content-Type: application/rss+xml; charset=utf-8
Expires: Tue, 27 Nov 2012 02:46:38 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: x-requested-with
Access-Control-Max-Age: 60
Date: Tue, 27 Nov 2012 02:16:38 GMT
Content-Length: 10982
If you print the response body through Heroku it provides the following info
This IP is only allowed to access our API.
To protect our users, we can't process requests from this IP address.
If you believe you have reached this page in error, contact us.

Resources