Comments (10)
This is a result of the environment variables being missing, so will be fixed with populating PLATFORM_*
environment variables.
PLATFORM_APPLICATION_NAME
PLATFORM_ENVIRONMENT
PLATFORM_PROJECT
PLATFORM_ROUTES (not sure what its value could be)
PLATFORM_VARIABLES
USER
from ddev-platformsh.
Not sure the immediate OP is solvable though,
Platformsh\ConfigReader\NotValidPlatformException: No routes are defined. Are you sure you are running on Platform.sh? in /var/www/html/vendor/platformsh/config-reader/src/Config.php on line 299
No, I'm definitely not running on Platform.sh :)
from ddev-platformsh.
Mmm it's from the ConfigReader which is used in the Drupal template...
from ddev-platformsh.
Re $PLATFORM_ROUTES
, here's what I have in my Symfony app on a PSH environment:
{
"https://workshop-5ziq2gq-6j4ypl5iendqc.eu-3.platformsh.site/": {
"primary": true,
"id": null,
"production_url": "https://workshop-5ziq2gq-6j4ypl5iendqc.eu-3.platformsh.site/",
"attributes": {},
"type": "upstream",
"upstream": "app",
"original_url": "https://{default}/"
},
"https://www.workshop-5ziq2gq-6j4ypl5iendqc.eu-3.platformsh.site/": {
"primary": false,
"id": null,
"production_url": "https://www.workshop-5ziq2gq-6j4ypl5iendqc.eu-3.platformsh.site/",
"attributes": {},
"type": "redirect",
"to": "https://workshop-5ziq2gq-6j4ypl5iendqc.eu-3.platformsh.site/",
"original_url": "https://www.{default}/"
},
"http://workshop-5ziq2gq-6j4ypl5iendqc.eu-3.platformsh.site/": {
"original_url": "http://{default}/",
"id": null,
"primary": false,
"type": "redirect",
"to": "https://workshop-5ziq2gq-6j4ypl5iendqc.eu-3.platformsh.site/",
"production_url": "http://workshop-5ziq2gq-6j4ypl5iendqc.eu-3.platformsh.site/"
},
"http://www.workshop-5ziq2gq-6j4ypl5iendqc.eu-3.platformsh.site/": {
"original_url": "http://www.{default}/",
"id": null,
"primary": false,
"type": "redirect",
"to": "https://www.workshop-5ziq2gq-6j4ypl5iendqc.eu-3.platformsh.site/",
"production_url": "http://www.workshop-5ziq2gq-6j4ypl5iendqc.eu-3.platformsh.site/"
}
}
from ddev-platformsh.
I guess it should be easy to populate this $PLATFORM_ROUTES
env var based on the URL generated by DDEV:
{
"https://bigfoot-symfony.ddev.site/": {
"primary": true,
"id": null,
"production_url": "https://bigfoot-symfony.ddev.site/",
"attributes": {},
"type": "upstream",
"upstream": "app",
"original_url": "https://{default}/"
}
}
This value would then be base64 encoded and assigned to $PLATFORM_ROUTES
Here is what I have in my .platform/routes.yaml
:
# The routes of the project.
#
# Each route describes how an incoming URL is going
# to be processed by Platform.sh.
"https://{default}/":
type: upstream
upstream: "app:http"
"https://www.{default}/":
type: redirect
to: "https://{default}/"
from ddev-platformsh.
Remind me where you instructed me about all the oddball base64-encoded environment variables. I don't see it in the issues. Is it in google docs? Or just https://docs.platform.sh/development/variables/use-variables.html#use-platformsh-provided-variables I guess?
from ddev-platformsh.
PSH docs only explains that some variables like PLATFORM_ROUTES
are base64-encoded JSON objects.
So assuming that you have the JSON example above in a routes.json
file, you can obtain the base64 blob by doing:
cat routes.json | base64
from ddev-platformsh.
Of course... we can't assume that the base64 tool is available on the host, so there will be some issues here.
from ddev-platformsh.
Could this be done using Go somehow?
from ddev-platformsh.
Of course, but the go code doesn't know we're doing platformsh stuff. Will have to think how it could be informed or triggered.
This whole class of things is going to turn out to be fragile and not completely solvable.
from ddev-platformsh.
Related Issues (20)
- shasum is also required and must be handled
- Support redis 7.0 + 6.2 HOT 3
- How to override platform.sh environment variables set in `.ddev/config.platformsh.yaml` ? HOT 5
- ddev get ddev/ddev-platformsh ends with Syntax Error (Ibexa) HOT 9
- Problem on MacOs with base64 option HOT 2
- Python-based app fails to start HOT 2
- Support `composer_version: 2.5.x` or warn if it is not supported HOT 1
- There are no commands defined in the "self" namespace. HOT 1
- upstream value in `PLATFORM_ROUTES` is incorrect HOT 2
- Move ddev-platformsh to drud org and make official HOT 3
- Consider `settings_management_disabled: true` for platform.sh projects
- Remove PLATFORM_MOUNTS and PLATFORM_DIR
- Environment variables must be set much earlier for php-fpm HOT 7
- Tests aren't valid if they don't get to content-checking point HOT 1
- config files and config mismatches HOT 1
- Support multi-app configuration (.platform.app.yaml isn't always in the root (and applications.yaml is a thing too)) HOT 10
- Homebrew base64 does not support `base64 -w` HOT 18
- interface conversion: interface {} is bool, not string HOT 6
- Magento2 doesn't work with add-on: "Cannot find the main route for Magento. Please add `id: magento_route` to your routes.yaml" HOT 6
- [docs] README should explain that `ddev get` is when config translation happens, and you need to repeat if changing Platform config
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ddev-platformsh.