Closed zspine closed 3 years ago
Are you using the latest version of the Mercure hub? It should fix the problem.
Thank you very much for the quick response :) . It seems I am running the v11 and I just tried to upgrade with docker and I am getting the following error:
FROM caddy:${CADDY_VERSION}-builder-alpine AS api_platform_caddy_builder
RUN xcaddy build \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain/caddy
FROM caddy:${CADDY_VERSION} AS api_platform_caddy
WORKDIR /srv/api
COPY --from=dunglas/mercure:v0.12 /srv/public /srv/mercure-assets/
COPY --from=api_platform_caddy_builder /usr/bin/caddy /usr/bin/caddy
COPY --from=api_platform_php /srv/api/public public/
COPY docker/caddy/Caddyfile /etc/caddy/Caddyfile
ERROR: Service 'caddy' failed to build: COPY failed: stat srv/public: file does not exist
also tried the following:
FROM caddy:${CADDY_VERSION}-builder-alpine AS api_platform_caddy_builder
RUN xcaddy build \
--with github.com/dunglas/mercure \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain \
--with github.com/dunglas/vulcain/caddy
FROM caddy:${CADDY_VERSION} AS api_platform_caddy
WORKDIR /srv/api
COPY --from=dunglas/mercure:v0.12 /srv/public /srv/mercure-assets/
COPY --from=api_platform_caddy_builder /usr/bin/caddy /usr/bin/caddy
COPY --from=api_platform_php /srv/api/public public/
COPY docker/caddy/Caddyfile /etc/caddy/Caddyfile
go: downloading github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7
go: downloading github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897
go: downloading github.com/jmespath/go-jmespath v0.3.0
2021/07/17 20:25:33 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /usr/bin/caddy -ldflags -w -s -trimpath
/go/pkg/mod/github.com/dunglas/mercure@v0.12.0/demo.go:4:2: package embed is not in GOROOT (/usr/local/go/src/embed)
/go/pkg/mod/github.com/dunglas/mercure@v0.12.0/handler.go:7:2: package io/fs is not in GOROOT (/usr/local/go/src/io/fs)
2021/07/17 20:25:38 [INFO] Skipping cleanup as requested; leaving folder intact: /tmp/buildenv_2021-07-17-2023.870195854
2021/07/17 20:25:38 [FATAL] exit status 1
ERROR: Service 'caddy' failed to build: The command '/bin/sh -c xcaddy build --with github.com/dunglas/mercure --with github.com/dunglas/mercure/caddy --with github.com/dunglas/vulcain/caddy' returned a non-zero code: 1
I need to upgrade the Dockerfile of API Platform.
The line COPY --from=api_platform_php /srv/api/public public/
is now useless and must be deleted.
Thank you very much for the quick update.... it seems to be working now, no more 'cannot unmarshal number' error! I am still getting the 'Unauthorized' error but it must be something to do with my configuration.
Cheers
Everything works fine with anonymous mode enabled, with private mode I am getting a strange authorization error from mercure hub. ' cannot unmarshal number 1689617856.599472 into Go struct field claims.exp of type int64 '
Caddy config
Caddy log (api platform docker)