GithubHelp home page GithubHelp logo

martin-helmich / go-varnish-client Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 5.0 117 KB

Go library to programmatically access the Varnish administration port

License: MIT License

Go 99.44% Dockerfile 0.56%

go-varnish-client's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

go-varnish-client's Issues

varnish 7.x command compatibility

Dear Martin,
first of all: great project, thanks! I tried lately to use the module talking to varnish 7.3 and stumbled upon this problem

I0525 06:34:18.514868       1 roundtrip_impl.go:124] writing to server: vcl.state
I0525 06:34:18.514878       1 roundtrip_impl.go:19] writing 10 bytes to server: 76636c2e737461746520 ("vcl.state ")
I0525 06:34:18.514904       1 roundtrip_impl.go:19] writing 30 bytes to server: 2272656c6f61645f32303233303532355f3036333431375f343437303022 ("\"reload_20230525_063417_44700\"")
I0525 06:34:18.514921       1 roundtrip_impl.go:19] writing 1 bytes to server: 20 (" ")
I0525 06:34:18.514935       1 roundtrip_impl.go:19] writing 6 bytes to server: 22636f6c6422 ("\"cold\"")
I0525 06:34:18.514942       1 roundtrip_impl.go:19] writing 1 bytes to server: 0a ("\n")
I0525 06:34:18.514947       1 roundtrip_impl.go:156] request written; waiting for response
I0525 06:34:18.515005       1 roundtrip_impl.go:58] read 13 bytes of header
I0525 06:34:18.515014       1 roundtrip_impl.go:59] header: "100 94      \n"
I0525 06:34:18.515017       1 roundtrip_impl.go:71] received message from Varnish server: response code 100, body length 94
I0525 06:34:18.515020       1 roundtrip_impl.go:80] 95 bytes read
I0525 06:34:18.515026       1 roundtrip_impl.go:81] message body: "Unknown request.\nType 'help' for more info.\nSyntax Error: Missing separator between arguments\n\n"
I0525 06:34:18.515036       1 watch.go:195] error while changing state of VCL reload_20230525_063417_44700: error while setting VCL state (code 100): Unknown request.
Type 'help' for more info.
Syntax Error: Missing separator between arguments

This impacts at least the SetVCLState and DefineInlineVCL calls. IMO this is a varnish bug introduced with varnishcache/varnish-cache@a2ab44d#diff-a1503af454177018bb731c118bd8dad34c34d94a93c2605e6a3ee3ab17bfe686R194 because it seems varnish wrongly detects a double quote as separator now instead of the space although go-varnish-client is actually escaping the arguments correctly AFAICS also from the debug log above.

Solutions:

  1. I avoided inline vcl by writing a vcl file into /tmp and then just just LoadVCL
  2. I removed the extra quoting for SetVCLState to avoid the wrong detection of double quote as separator master...gutmensch:go-varnish-client:master

None of both are really a good fix. But at least I wanted to document it here.
Cheers,
Robert

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.