-
Notifications
You must be signed in to change notification settings - Fork 8
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
fail to load searchd response / slice bounds out of range #15
Comments
As I can guess by line numbers, that is code published some revisions ago. |
I just checked my code and the go.mod file, and it is on the right revision https://github.com/x0rzkov/manticore-gosdk-issue/blob/master/go.mod#L11 aka 7d072dc I mean it is still actual |
ok, will check. |
Thanks, my whole website is blocked because of these 2 issues, so yeah if you can sort it out it gonna be awesome :-) ^^ |
Any updates mate ? |
Not yet, need to complete current backlog of C++ tasks first. |
Hi guys, Thanks for the fix, I am testing it right now and will come back with a feedback during the day. But remains the second bug, quiet annoying for my rss feeds based on manticoresearch:
I gave you all the details to reproduce here. Cheers, |
Sounds interesting to look, but right now I am not able to do it fast |
Hi, I tried with the mysql driver it works but not for my search query as I am using multiple facets as arguments. I do not get facets information with the mysql driver. Please check that issue as I have no clue how to debug that more than the repo I gave you. Tell me that you found the issue as my whole website is stuck because of this last bug. ^^ Thanks in advance. Cheers, |
@x0rzkov
https://github.com/go-sql-driver/mysql doesn't support multiple results, but https://stackoverflow.com/a/28577876/591867 works for me: snikolaev@dev:~$ cat test_luc.go
package main
import (
"flag"
"fmt"
"github.com/ziutek/mymysql/autorc"
"github.com/ziutek/mymysql/mysql"
_ "github.com/ziutek/mymysql/thrsafe"
)
type ScanFun func(int, []mysql.Row, mysql.Result) error
func RunSQL(hostport, user, pass, db, cmd string, scan ScanFun) error {
conn := autorc.New("tcp", "", hostport, user, pass, db)
err := conn.Reconnect()
if err != nil {
return err
}
res, err := conn.Raw.Start(cmd)
if err != nil {
return err
}
rows, err := res.GetRows()
if err != nil {
return err
}
RScount := 0
scanErr := error(nil)
for {
if scanErr == nil {
func() {
defer func() {
if x := recover(); x != nil {
scanErr = fmt.Errorf("%v", x)
}
}()
scanErr = scan(RScount, rows, res)
}()
}
if res.MoreResults() {
res, err = res.NextResult()
if err != nil {
return err
}
rows, err = res.GetRows()
if err != nil {
return err
}
} else {
break
}
RScount++
}
return scanErr
}
func main() {
host := flag.String("host", "localhost:9306", "define the host where the db is")
user := flag.String("user", "root", "define the user to connect as")
pass := flag.String("pass", "", "define the pass to use")
db := flag.String("db", "information_schema", "what db to default to")
sql := flag.String("sql", "select * from t where match('abc') facet a", "Query to run")
flag.Parse()
scan := func(rcount int, rows []mysql.Row, res mysql.Result) error {
if res.StatusOnly() {
return nil
}
for idx, row := range rows {
fmt.Print(rcount, "-", idx, ") ")
for i, _ := range row {
fmt.Print(row.Str(i))
fmt.Print(" ")
}
fmt.Println("")
}
return nil
}
fmt.Println("Host - ", *host)
fmt.Println("Db - ", *db)
fmt.Println("User - ", *user)
if err := RunSQL(*host, *user, *pass, *db, *sql, scan); err != nil {
fmt.Println(err)
}
}
snikolaev@dev:~$ go get github.com/ziutek/mymysql/autorc
snikolaev@dev:~$ go run test_luc.go
Host - localhost:9306
Db - information_schema
User - root
0-0) 2810903486202382289 0 1
0-1) 2810903486202382290 1 0
0-2) 2810903486202382291 1 2
1-0) 0 1
1-1) 1 2 |
Hi guys, Updated my code for using your snippets, and it works from the docker container: Sounds like docker is not the cause. Isn't it ? Cheers, |
Well, if you please check one more test: [you app -> go-sdk] -> [daemon_backend] it will became: [your app -> go-sdk -> daemon_proxy] -> [daemon_backend] This way we may determine the thing whether problem is in go-sdk code, or on daemon side (since in second variant proxy daemon will connect to production using the same binary protocol as implemented in go-sdk). If it works, you may even use such schema as temporary solution (proxy daemon doesn't need to have any local indexes) |
Can you do that with the repository I gave you ? I think it is gonna be better and faster if you do that task on your side. |
It might be better, but not sure it will be faster (in terms of the issue resolution) as we (and Alexey in particular) are extremely busy with other tasks, so any help from the community is highly appreciated. |
Can you be more clear about that ? I do not get how I can get the paper2code server and manticoresearch daemon running together in a docker container. Sorry but I do not understand your request |
The thing which is curious to check - whether go-sdk can't connect to the daemon because of the problem in go-sdk, or because of the problem in the daemon. To check this most obvious way is to use not go-sdk, but another daemon as API client (this very binary protocol implemented in this go-sdk is the one used by daemon to connect to agents). Assuming that port forwarding is set up correct (i.e. when you connect to port YYY of node XXX it will route it to legal local process waiting for proper interface and proper port inside the docker, which is trivial when starting dockerized app, but I just clearify it to be explicit), you can use any API client, including copy of the daemon (since it also speaks with same protocol). You need searchd executable in the container (whole 'manticore' package and environment is not necessary, only daemon binary is enough), and short config which has one distributed index containing one agent line which is exactly location of your dockerized real container, like:
configure your app to connect to 'localhost:9312'. Daemon will start in classical daemon way (via double-fork and detach from the session) and will search locally (inside container) port 9306 and 9312 (first for mysql, second for the rest). Querying index 'your_index' on such address will translate any queries to api binary protocol and send to the host defined as agent. In case of queries already in api binary it will works just as a kind of proxy in this simplest case (since it is only one agent, no mirrors, no custom aggretations, just resend query to onther host). For your application in this case - it will connect to localhost:9312 as the host. And proxy will actually connect to remote real.host.address:9312. So, if problem in go-sdk, then such proxying should work well. |
The snippet is not working for this query, it is missing all facets @klirichek I ll try to install a local manticore and test the go version/dockerized version today. |
Mea culpa, still trying to figure out how to recode the website ^^ |
seems you use multiple queries with facet at each of them. That will not work at daemon. You could use only one query with multiple facets at that query or multiple queries without facet . |
Hi guys, Hope you are all well ! I managed to convert my code for mysql queries, and it works fine. Cheers, |
Great, if just pure mysql works for you in Go just use it :) |
I ll check it this week ! Keep you updated |
I also got the error Simply limiting the results or adding a |
Hi guys,
Hope you are all well !
I have 2 major issues with the go-sdk and managed to reproduce them into the following repository.
Ref. https://github.com/x0rzkov/manticore-gosdk-issue
In a nutshell, the two issues are:
To reproduce, please see the README.md of the repository above.
The text was updated successfully, but these errors were encountered: