Skip to content

Couldn't save the Shopify Access Token in the .env file. No .env file exists at /srv/app/tortu/htdocs/.env #204

@srosenbrand

Description

@srosenbrand

Description

When authorizing the Shopify app on production i get a 'Your Shopify app has been successfully authorized' notification.

All settings are working in development (with a second Shopify 'local' app) trough ngrok tunnel.

But in the debugbar there is an error '
craft\shopify\services\Api::getAccessToken | Couldn't save the Shopify Access Token in the .env file. No .env file exists at /srv/app/xxx/htdocs/.env'

This seems to be an issue with Fortrabbit, where the website is hosted and .env vars are stored separately and not in an .env file in the root.

Result is that the webhooks option is not shown after authentication. On reload of the succes page i get an 'Error authorizing app. Invalid OAuth callback.'

EDIT: fixed by creating an empty .env file in the root of production. After authentication copy the generated SHOPIFY_API_ACCESS_TOKEN to the env vars section. Now working!

Additional info

  • Craft version: 5.19.17
  • PHP version: 8.4
  • Plugins & versions: Shopify 7.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions