HalosGhost / pbpst

A command-line libcurl C client for pb deployments
GNU General Public License v2.0
44 stars 9 forks source link

Behaviour when re-creating a paste with sunset after manually removing it #90

Closed BurhanDanger closed 6 years ago

BurhanDanger commented 6 years ago

Similar to https://github.com/ptpb/pb/issues/217#issue-324746250

Steps To reproduce:

$ cat tstfile
ThIs iS GoIng To be A
                TeSt File.

 $ pbpst -S -# -x 30d -f tstfile
[#########################################################################] 100%
https://ptpb.pw/aklx

$ curl https://ptpb.pw/aklx
ThIs iS GoIng To be A
                TeSt File.

$ pbpst -Dq tstfile
e6e69a8d-b8aa-4994-916f-a60652fbac98    https://ptpb.pw/AC-uylMV7MWpySR0G_Zv2BdXaklx    tstfile 1536992040

$ pbpst -Ru e6e69a8d-b8aa-4994-916f-a60652fbac98
pbpst: Paste deleted

$curl https://ptpb.pw/aklx
status: not found

$ pbpst -S -f tstfile
https://ptpb.pw/aklx

$ curl https://ptpb.pw/aklx
status: not found

$ pbpst -Dq tstfile
1b54c548-6549-4e43-b8e7-f97ce759f145    https://ptpb.pw/AC-uylMV7MWpySR0G_Zv2BdXaklx    tstfile N/A
buhman commented 6 years ago

This is actually an upstream deployment bug (and possibly a regression).

[tw-mbp-zbuhman ~]$ curl -D- https://ptpb.pw/KT9s
HTTP/1.1 404 NOT FOUND
Server: openresty/1.13.6.2
Date: Thu, 16 Aug 2018 17:17:41 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 18
Connection: keep-alive
Vary: Accept
ETag: "paste-5afca108921db93306efb8ad002ffbf42ec867b6"
Cache-Control: max-age=43200, public
X-Varnish: 6661816
Age: 0
Via: 1.1 varnish-v4

status: not found

The problem here is pb told varnish that the response is cacheable, and varnish caches the 404 accordingly. sunset and/or pbpst's involvement in this is a red herring.

I had thought this was being handled correctly as of years ago, but clearly it is not.

BurhanDanger commented 6 years ago

I mostly use pbpst with sunset and almost never with curl and pb which is why I made misleading conclusion. Since it's pb deployment problem , I'm going to close it now.