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

Bug: Views not incrementing for shortened URLs #659

Closed
xoryouyou opened this issue Jan 9, 2025 · 6 comments · Fixed by #683
Closed

Bug: Views not incrementing for shortened URLs #659

xoryouyou opened this issue Jan 9, 2025 · 6 comments · Fixed by #683
Labels
bug Something isn't working

Comments

@xoryouyou
Copy link

What happened?

I have a zipline docker container with 3.7.11 running behind a traefik.

When I create a shortened URL and visit it I get forwarded to the target URL.
The log shows the 302 redirect properly.

zipline-1 | 2025-01-09 09:26:13,991 AM info [server::response] GET /go/test -> 302

But the views count stays at 0 no matter what I try.
image

I've tried incognito tabs, different browsers, curl from a different machine etc.

docker compose exec zipline yarn scripts:read-config

yields the default config for urls:

...
urls: { route: '/go', length: 6 },
...

I've read the documentation but I could not find anything regarding missing setup steps or such.

Any help would be appreciated :)

Version

latest (ghcr.io/diced/zipline or ghcr.io/diced/zipline:latest)

What browser(s) are you seeing the problem on?

Firefox, Chromium-based (Chrome, Edge, Brave, Opera, mobile chrome/chromium based, etc)

Zipline Logs

zipline-1   | 2025-01-09 09:26:08,166 AM info  [datasource] using Local(./uploads) datasource
zipline-1   | 2025-01-09 09:26:08,250 AM info  [database::migrations] establishing database connection
zipline-1   | 2025-01-09 09:26:08,250 AM info  [database::migrations] ensuring database exists, if not creating database - may error if no permissions
zipline-1   | 2025-01-09 09:26:08,511 AM info  [database::migrations] exiting migrations engine - database is up to date
zipline-1   | 2025-01-09 09:26:09,407 AM info  [server] listening on 0.0.0.0:3000
zipline-1   | 2025-01-09 09:26:09,407 AM info  [server] started production zipline@3.7.11 server
...
zipline-1   | 2025-01-09 09:26:13,991 AM info  [server::response] GET /go/test -> 302
...
zipline-1   | 2025-01-09 09:28:02,892 AM info  [server::response] GET /go/test -> 302

Browser Logs

No response

Additional Info

{
  core: {
    secret: '...',
    database_url: 'postgres://postgres:postgres@postgres/postgres',
    return_https: false,
    temp_directory: '/tmp/zipline',
    host: '0.0.0.0',
    port: 3000,
    logger: true,
    stats_interval: 1800,
    invites_interval: 1800,
    thumbnails_interval: 600,
    compression: { enabled: false, on_dashboard: false }
  },
  datasource: {
    type: 'local',
    local: { directory: './uploads' },
    s3: { region: 'us-east-1', force_s3_path: false }
  },
  uploader: {
    default_format: 'uuid',
    route: '/u',
    embed_route: '/a',
    length: 6,
    admin_limit: 53687091200,
    user_limit: 104857600,
    disabled_extensions: [],
    format_date: 'YYYY-MM-DD_HH:mm:ss',
    default_expiration: null,
    assume_mimetypes: false,
    random_words_separator: '-'
  },
  urls: { route: '/go', length: 6 },
  ratelimit: { user: 0, admin: 0 },
  website: {
    title: '...',
    show_files_per_user: true,
    show_version: true,
    disable_media_preview: false,
    external_links: [
      { label: 'Zipline', link: 'https://github.com/diced/zipline' },
      { label: 'Documentation', link: 'https://zipline.diced.sh/' }
    ]
  },
  discord: null,
  oauth: null,
  features: {
    invites: false,
    invites_length: 6,
    oauth_registration: false,
    oauth_login_only: false,
    user_registration: false,
    headless: false,
    default_avatar: null,
    robots_txt: false,
    thumbnails: false
  },
  chunks: { max_size: 94371840, chunks_size: 20971520, enabled: true },
  mfa: { totp_issuer: 'Zipline', totp_enabled: true },
  exif: { enabled: false, remove_gps: false },
  ssl: null
}
@xoryouyou xoryouyou added the bug Something isn't working label Jan 9, 2025
@L7NEG
Copy link

L7NEG commented Jan 12, 2025

same

@pcollaog
Copy link

Hi, I added a try/catch in order to see the "error".. but I don't understand why execute a postFile decorator, because should only run postUrl.

zipline-1   | TypeError: Cannot read properties of undefined (reading 'url')
zipline-1   |     at Object.postUrl (/zipline/src/server/decorators/postFile.ts:33:9)
zipline-1   |     at Object.urlsRoute (/zipline/src/server/routes/uploads.ts:5:9)
zipline-1   |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

The lines numbers maybe arent the same as original (because I add new code)

@diced
Copy link
Owner

diced commented Feb 3, 2025

don't know how no one noticed this issue for 2 years but its fixed now lol 1febd5a

@xoryouyou
Copy link
Author

Yeah I saw the commit 5328485?diff=split&w=0 and was like "wtf... 👀"
But makes sense to await the reply.postUrl call which actually triggers the increment on the views counter.

I'll check it out once the new docker image is build. Thanks @TacticalTechJay for hunting down the bug.

@diced
Copy link
Owner

diced commented Feb 3, 2025

yea lol the only defense I have is that I must've been tired after refactoring everything and just did something that clearly doesn't work 😭

@xoryouyou
Copy link
Author

I know that feeling... happens :)

But good news it works! Running ghcr.io/diced/zipline:trunk

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants