NEO4J Unrecognized setting. No declared setting with name: URI.
baobab-kernel
HOBBYOP

20 days ago

Unrecognized setting. No declared setting with name: URI.

Cleanup the config or disable 'server.config.strict_validation.enabled' to continue.

This message appears immediately after Railway installs the APOC plugin, and the container restarts in a loop.

From what I understand, the Neo4j template seems to inject an invalid configuration key into neo4j.conf (likely derived from an environment variable such as URI or NEO4J_URI). Neo4j refuses to start because this key is not part of the allowed configuration settings.

Could you please:

Confirm whether the Neo4j template is incorrectly mapping environment variables into neo4j.conf?

Remove or correct the invalid URI entry in the generated configuration?

Clarify which environment variables are safe to use for Neo4j on Railway (e.g., NEO4J_URI, DB_PASSWORD, NEO4J_USERNAME) so I can configure my services properly?

Thank you for your help — the service cannot start until this configuration issue is resolved.

Best regards,

Philippe

Solved$10 Bounty

1 Replies

Railway
BOT

20 days ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway 20 days ago


adeptlogixindia
FREE

20 days ago

the railway template mechanism is well documented, and that'll tell us exactly where to look.

How Neo4j's Docker image turns env vars into config: the official Neo4j Docker image takes any environment variable prefixed NEO4J_ and auto-translates it into a neo4j.conf line, where underscores become dots and double-underscores become single underscores (e.g. NEO4J_dbms_memory_heap_max__size → dbms.memory.heap.max_size). Critically, this means any NEO4J_-prefixed variable gets written into neo4j.conf as a setting line, whether or not it's a real Neo4j setting. Neo4j 5.x then enforces server.config.strict_validation.enabled=true by default, which makes it hard-fail on any key it doesn't recognize — that's exactly the Unrecognized setting. No declared setting with name: URI you're seeing, and it matches the same failure pattern in the GitHub/community threads above, just with a different bogus key (apoc.export.file.enabled there, URI for you).

This isn't really "the APOC plugin breaking Neo4j," it's that installing the APOC plugin through Railway's UI likely set or exposed an environment variable named (or containing) NEO4J_URI — and the Docker entrypoint script stripped the NEO4J_ prefix, lowercased nothing (it preserves case), and tried to write it as a config key called URI, which doesn't exist as a real Neo4j setting, so strict validation rejects it.

To actually fix this, here's what to check and change on your end:

In your Railway project's Neo4j service, go to the Variables tab and look for anything literally named NEO4J_URI (not just URI). If it's there — possibly auto-added when you installed the APOC plugin, or carried over from a template default — that's almost certainly your culprit, since the entrypoint script would translate NEO4J_URI into the conf key URI (it strips the leading NEO4J_ segment and converts the rest). Delete or rename that variable. NEO4J_URI is not a real Neo4j server setting; it's a convention used by client libraries/apps to know how to connect to Neo4j, not something Neo4j itself reads from its own config. It should live in variables for the apps connecting to the database, not in the Neo4j service's own environment.

If removing it isn't straightforward (e.g. Railway's template regenerates it), the more surgical fix is to add this environment variable to the Neo4j service to relax strict validation as a stopgap:

NEO4J_server_config_strict__validation_enabled=false

That maps to server.config.strict_validation.enabled=false, which is literally what the error message tells you to do. This will let Neo4j boot even with the bogus URI key present (it'll just warn and ignore it), unblocking your restart loop while you sort out where the variable is coming from.

As for which variables are safe to set directly on the Neo4j service itself in Railway: stick to ones the official Neo4j Docker image actually expects, namely NEO4J_AUTH (format neo4j/yourpassword, or none to disable auth), NEO4J_PLUGINS (a JSON array string like ["apoc"], which is the standard way to install APOC rather than whatever Railway's UI button does under the hood), and any real config key reproduced as NEO4J_dbms_.. or NEO4J_server_.. style variables matching actual neo4j.conf settings. NEO4J_URI, NEO4J_USERNAME, DB_PASSWORD, etc. are conventions for your application's connection config, not for the database service — they belong as variables on your app/service that connects to Neo4j (often via Railway's variable references like ${{Neo4j.NEO4J_URI}} if the template exposes one), not duplicated onto the Neo4j service's own variable list.

If you check the Neo4j service's variables and confirm there's a stray NEO4J_URI (or similarly malformed key) sitting there, that's the smoking gun — removing it should resolve this cleanly without needing to disable strict validation at all.


Status changed to Solved medim 15 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...