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

[0.9.0] Can not recreate a measurement #2955

Closed
indrekj opened this issue Jun 12, 2015 · 10 comments
Closed

[0.9.0] Can not recreate a measurement #2955

indrekj opened this issue Jun 12, 2015 · 10 comments
Assignees

Comments

@indrekj
Copy link

indrekj commented Jun 12, 2015

v0.9.0

Replicate:

#!/bin/sh

echo ">> Recreating the database"
curl -G http://localhost:8086/query --data-urlencode "q=DROP DATABASE foobar"
curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE foobar"

echo
echo ">> Creating a measurement"
curl -XPOST 'http://localhost:8086/write?db=foobar' -d 'cpu,host=serverB,region=us-west value=1.0'

echo
echo ">> Dropping the measurement"
curl -G http://localhost:8086/query --data-urlencode "db=foobar" --data-urlencode "q=DROP MEASUREMENT cpu"

echo
echo ">> Recreating the measurement"
curl -XPOST 'http://localhost:8086/write?db=foobar' -d 'cpu,host=serverA,region=us-west value=1.0'

echo
echo ">> Querying the measurement"
curl -G http://localhost:8086/query --data-urlencode "db=foobar" --data-urlencode "q=SELECT COUNT(value) FROM cpu"

Output:

>> Recreating the database
{"results":[{}]}{"results":[{}]}
>> Creating a measurement

>> Dropping the measurement
{"results":[{"error":"bucket not found"}]}
>> Recreating the measurement
write failed: database not open
>> Querying the measurement
{"results":[{"error":"unknown field or tag name in select clause: value"}]}%

[#2940 might be also related]

@jonaz
Copy link

jonaz commented Jun 12, 2015

I have the exact same issue with 0.9.0!

If i restart the server after i got "unknown field or tag name in select clause: value"
the measurement seems to be restored as is was before i ran DROP measurement

@indrekj indrekj changed the title Can not recreate a measurement [0.9.0] Can not recreate a measurement Jun 12, 2015
@beckettsean
Copy link
Contributor

Thanks for the find! Here's a slightly easier to parse example using the CLI:

> CREATE DATABASE drop_test
> USE drop_test
Using database drop_test
> INSERT cpu,host=serverB,region=us-west value=1.0
> SELECT * FROM cpu
name: cpu
tags: host=serverB, region=us-west
time                value
----                -----
2015-06-12T21:46:13.375960817Z  1

> DROP MEASUREMENT cpu
> INSERT cpu,host=serverB,region=us-west value=1.0
> SELECT * FROM cpu
ERR: select statement must include at least one field or function call
> SHOW MEASUREMENTS
name: measurements
------------------
name
cpu

> SELECT value FROM cpu
ERR: unknown field or tag name in select clause: value
> 

@consense
Copy link

+1
very annoying for integration testing of our influxdb reliant code

@otoolep
Copy link
Contributor

otoolep commented Jun 16, 2015

I'm working on the query code at the moment, I'll take a look at this.

@otoolep
Copy link
Contributor

otoolep commented Jun 16, 2015

Should be fixed in 0.9.1 by #3002

@otoolep
Copy link
Contributor

otoolep commented Jun 16, 2015

An effective workaround is to restart the system after dropping the measurement. Once this change goes in, the restart will no longer be required.

otoolep added a commit that referenced this issue Jun 16, 2015
@otoolep
Copy link
Contributor

otoolep commented Jun 16, 2015

All fixed.

@otoolep otoolep closed this as completed Jun 16, 2015
@otoolep
Copy link
Contributor

otoolep commented Jun 16, 2015

Thanks for the excellent bug report @indrekj

@KrishnaPG
Copy link

Getting the same error in latest version (0.9.3), after dropping a measurement and inserting later.

@beckettsean
Copy link
Contributor

@KrishnaPG can you please provide the steps to reproduce the issue, both the writes and the queries? I am unable to reproduce this error on 0.9.3:

> CREATE DATABASE drop_test1
> USE drop_test1
Using database drop_test1
> INSERT cpu,host=serverB,region=us-west value=1.0
> SELECT * FROM cpu
name: cpu
---------
time                host    region  value
2015-08-31T18:31:58.221415617Z  serverB us-west 1

> DROP MEASUREMENT cpu
> INSERT cpu,host=serverB,region=us-west value=1.0
> SELECT * FROM cpu
name: cpu
---------
time                host    region  value
2015-08-31T18:32:10.046086765Z  serverB us-west 1

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

No branches or pull requests

6 participants