Skip to content

Metadata export: unset PUBLIC_API_URL falls back to a non-resolving host (dead download links) #238

Open

Description

@saqibmanan

What: If PUBLIC_API_URL / PUBLIC_SITE_URL aren't set, settings.py:308-309 and metadata_export/adapter.py:24-28 fall back to https://api.civicdataspace.in, a host that doesn't resolve. Neither variable is set on dev.
Why it matters: Every resource download_url in the DCAT/Croissant/DC exports is a dead link, and landing pages point at the prod site even for dev datasets. Prod will have the same problem once #211 is promoted.
Evidence: In dev's DCAT export for dataset 5cd8ca93…, download_url points to api.civicdataspace.in/api/download/resource/8e2e…, which returns 000 (no response). The same path on dev.api returns 200.
Fix: Not fixed yet. Change the fallback in both files to https://api.datakeep.civicdays.in. Dev's .env also needs PUBLIC_API_URL=https://dev.api.civicdataspace.in and PUBLIC_SITE_URL=https://dev.civicdataspace.in. Failing at startup instead was ruled out: the deploy runs migrations before the new containers start, so a missing variable would leave the old image running on the new schema.

Activity

  1. added theissue type on Oct 9, 2026
  2. added a commit that references this issue on Oct 12, 2026
    df34e5a
  3. anantjain341 commented on Oct 12, 2026

    @anantjain341
    Contributor

    Fix: Code part merged into dev in #244. The fallback is now https://api.datakeep.civicdays.in in DataSpace/settings.py and api/services/metadata_export/adapter.py. Also changed in .env.example, which had the same dead host. Dev deploys automatically.
    Still to do: @saqibmanan, please add to dev's .env: PUBLIC_API_URL=https://dev.api.civicdataspace.in and PUBLIC_SITE_URL=https://dev.civicdataspace.in. This is server config, so it couldn't go in the PR.
    Check after deploy: In dev's DCAT export, download_url should point to dev.api.civicdataspace.in/api/download/resource/… and return 200.

    Moving to Ready to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions