jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.51k stars 4.02k forks source link

translation-not-found[error.url.not.found] in gateway on every page #7843

Closed binakot closed 6 years ago

binakot commented 6 years ago

Just generated JHipster 5.0.0 gateway application and run with docker-compose. On every page I get translation-not-found[error.url.not.found], but translations seems working. I have 2 langs: en and ru.

2018-06-23 13 31 08

yo-rc.json:

{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "io.tiketer.gateway",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "5.0.0",
    "applicationType": "gateway",
    "baseName": "gateway",
    "packageName": "io.tiketer.gateway",
    "packageFolder": "io/tiketer/gateway",
    "serverPort": "8080",
    "authenticationType": "uaa",
    "uaaBaseName": "uaa",
    "cacheProvider": "hazelcast",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Memory",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": "eureka",
    "buildTool": "gradle",
    "enableSwaggerCodegen": false,
    "clientFramework": "react",
    "useSass": false,
    "clientPackageManager": "yarn",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
      "en",
      "ru"
    ]
  }
}
deepu105 commented 6 years ago

May be translation is missing for those keys, can you check if the keys are present in the json files

binakot commented 6 years ago

@deepu105 Nope, its here

2018-06-23 15 36 38 2018-06-23 15 38 01
deepu105 commented 6 years ago

That's for the backend. Not sure which error this is as you dindt provide any stack trace. Also check the front end i18n files, it should be in error.json can you check if the files have the keys

Thanks & Regards, Deepu

On Sat, Jun 23, 2018 at 2:37 PM Ivan Muratov notifications@github.com wrote:

@deepu105 https://github.com/deepu105 Nope, its here

[image: 2018-06-23 15 36 38] https://user-images.githubusercontent.com/1783893/41809743-4e618370-76fb-11e8-8d2b-235de459ccac.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/7843#issuecomment-399674888, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDlF--Z1tLr35OMkm6q2txADBi-i5r3ks5t_jaHgaJpZM4U0vTl .

binakot commented 6 years ago

I got this errors only when I run with docker-compose -f src/main/docker/app.yml up -d. I just run app on localhost with ./gradlew and problem gone. I will try to find the reason...

binakot commented 6 years ago

How to reproduce:

There are no any logs about translation problem. Only about public key expired, because I didn't run UAA server:

2018-06-23 13:09:41.911  WARN 1 --- [ XNIO-2 task-10] i.t.g.s.o.UaaSignatureVerifierClient     : could not contact UAA to get public key
2018-06-23 13:09:41.911  WARN 1 --- [ XNIO-2 task-10] i.t.g.web.filter.RefreshTokenFilter      : Security exception: could not refresh tokens

org.springframework.security.oauth2.common.exceptions.InvalidTokenException: public key expired
    at io.tiketer.gateway.config.oauth2.OAuth2JwtAccessTokenConverter.decode(OAuth2JwtAccessTokenConverter.java:47)
    at org.springframework.security.oauth2.provider.token.store.JwtTokenStore.convertAccessToken(JwtTokenStore.java:88)
    at org.springframework.security.oauth2.provider.token.store.JwtTokenStore.readAccessToken(JwtTokenStore.java:80)
    at io.tiketer.gateway.web.filter.RefreshTokenFilter.mustRefreshToken(RefreshTokenFilter.java:111)
    at io.tiketer.gateway.web.filter.RefreshTokenFilter.refreshTokensIfExpiring(RefreshTokenFilter.java:80)
    at io.tiketer.gateway.web.filter.RefreshTokenFilter.doFilter(RefreshTokenFilter.java:57)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
...
deepu105 commented 6 years ago

@binakot you have 2 issues.

  1. There is something going wrong which throws an error(You need to figure this out by examing the stack trace at the backend as well in the browser console, maybe an API request failed)
  2. When the error is thrown the translation mechanism tries to translate the key error.url.not.found, which means it expects a file named error.json in your src/main/webapp/i18n/en and src/main/webapp/i18n/ru directory with value for key error.url.not.found

So please try to figure out what is missing here and report back

binakot commented 6 years ago

@deepu105 about second point:

This is content of i18n files:

en-error.json:

{
    "error": {
        "title": "Error page!",
        "http": {
            "400": "Bad request.",
            "403": "You are not authorized to access this page.",
            "405": "The HTTP verb you used is not supported for this URL.",
            "500": "Internal server error."
        },
        "concurrencyFailure": "Another user modified this data at the same time as you. Your changes were rejected.",
        "validation": "Validation error on the server."
    }
}

ru-error.json:

{
    "error": {
        "title": "Ошибка!",
        "http": {
            "400": "Bad request.",
            "403": "Вы не авторизованы для доступа к странице",
            "405": "The HTTP verb you used is not supported for this URL.",
            "500": "Internal server error."
        },
        "concurrencyFailure": "Another user modified this data at the same time as you. Your changes were rejected.",
        "validation": "Validation error on the server."
    }
}

There is no error.url.not.found key.

I found the code that use this key in file src/main/webapp/app/config/notification-middleware.ts line 86:

case 404:
    addErrorAlert('Not found', 'error.url.not.found');
    break;
deepu105 commented 6 years ago

ok so seems like missing translation

deepu105 commented 6 years ago

Ok actually this key is in global.json and they are present and hence not sure whats wrong here. @binakot could you investigate a bit more

binakot commented 6 years ago

Sorry for late response, now I'm here. Let's see. Now I lost all translations 🙉

My env:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.13.5
BuildVersion:   17F77

$ gradle --version
4.8.1

$ node --version
v10.5.0

$ npm --version
6.1.0

$ yarn --version
1.7.0

$ yo --version
2.0.2

$ jhipster --version
v5.0.1

This is my yo-rc.json

{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "io.binakot.gateway",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "5.0.1",
    "applicationType": "gateway",
    "baseName": "gateway",
    "packageName": "io.binakot.gateway",
    "packageFolder": "io/binakot/gateway",
    "serverPort": "8080",
    "authenticationType": "oauth2",
    "cacheProvider": "hazelcast",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Memory",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": "eureka",
    "buildTool": "gradle",
    "enableSwaggerCodegen": false,
    "clientFramework": "react",
    "useSass": false,
    "clientPackageManager": "yarn",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
      "en",
      "ru"
    ]
  }
}

After generation I just run gradle and yarn:

./gradlew
yarn start

Gradle output (with removed eureka client's stack traces):

Starting a Gradle Daemon (subsequent builds will be faster)

> Task :compileJava
Note: Hibernate JPA 2 Static-Metamodel Generator 5.2.17.Final
Note: /Users/binakot/Projects/test-gateway/src/main/java/io/binakot/gateway/security/oauth2/SimpleAuthoritiesExtractor.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :bootRun
The Class-Path manifest attribute in /Users/binakot/.gradle/caches/modules-2/files-2.1/org.liquibase/liquibase-core/3.5.5/c65051f327382018bd09c30380f25eac96f210da/liquibase-core-3.5.5.jar referenced one or more files that do not exist: file:/Users/binakot/.gradle/caches/modules-2/files-2.1/org.liquibase/liquibase-core/3.5.5/c65051f327382018bd09c30380f25eac96f210da/lib/snakeyaml-1.13.jar
18:38:16.988 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Included patterns for restart : []
18:38:16.993 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Excluded patterns for restart : [/spring-boot-actuator/target/classes/, /spring-boot-devtools/target/classes/, /spring-boot/target/classes/, /spring-boot-starter-[\w-]+/, /spring-boot-autoconfigure/target/classes/, /spring-boot-starter/target/classes/]
18:38:16.993 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/Users/binakot/Projects/test-gateway/build/classes/java/main/, file:/Users/binakot/Projects/test-gateway/build/resources/main/]

        ██╗ ██╗   ██╗ ████████╗ ███████╗   ██████╗ ████████╗ ████████╗ ███████╗
        ██║ ██║   ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
        ██║ ████████║    ██║    ███████╔╝ ╚█████╗     ██║    ██████╗   ███████╔╝
  ██╗   ██║ ██╔═══██║    ██║    ██╔════╝   ╚═══██╗    ██║    ██╔═══╝   ██╔══██║
  ╚██████╔╝ ██║   ██║ ████████╗ ██║       ██████╔╝    ██║    ████████╗ ██║  ╚██╗
   ╚═════╝  ╚═╝   ╚═╝ ╚═══════╝ ╚═╝       ╚═════╝     ╚═╝    ╚═══════╝ ╚═╝   ╚═╝

:: JHipster 🤓  :: Running Spring Boot 2.0.3.RELEASE ::
:: https://www.jhipster.tech ::

2018-06-27 18:38:19.457  WARN 45668 --- [  restartedMain] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8761/config/gateway/dev/master": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
2018-06-27 18:38:19.460  INFO 45668 --- [  restartedMain] io.binakot.gateway.GatewayApp            : The following profiles are active: dev,swagger
2018-06-27 18:38:21.791 DEBUG 45668 --- [  restartedMain] i.b.gateway.config.AsyncConfiguration    : Creating Async Task Executor
2018-06-27 18:38:22.530 DEBUG 45668 --- [  restartedMain] i.b.gateway.config.MetricsConfiguration  : Registering JVM gauges
2018-06-27 18:38:22.580 DEBUG 45668 --- [  restartedMain] i.b.gateway.config.MetricsConfiguration  : Monitoring the datasource
2018-06-27 18:38:22.587 DEBUG 45668 --- [  restartedMain] i.b.gateway.config.MetricsConfiguration  : Initializing Metrics JMX reporting
2018-06-27 18:38:23.796 DEBUG 45668 --- [  restartedMain] i.b.gateway.config.CacheConfiguration    : Configuring Hazelcast
2018-06-27 18:38:23.821 DEBUG 45668 --- [  restartedMain] i.b.gateway.config.CacheConfiguration    : Configuring Hazelcast clustering for instanceId: gateway
2018-06-27 18:38:23.823 DEBUG 45668 --- [  restartedMain] i.b.gateway.config.CacheConfiguration    : Application is running with the "dev" profile, Hazelcast cluster will only work with localhost instances
2018-06-27 18:38:23.938  INFO 45668 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Initializing Eureka in region us-east-1
2018-06-27 18:38:24.112  INFO 45668 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON encoding codec LegacyJacksonJson
2018-06-27 18:38:24.112  INFO 45668 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON decoding codec LegacyJacksonJson
2018-06-27 18:38:24.286  INFO 45668 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using XML encoding codec XStreamXml
2018-06-27 18:38:24.287  INFO 45668 --- [  restartedMain] c.n.d.provider.DiscoveryJerseyProvider   : Using XML decoding codec XStreamXml
2018-06-27 18:38:24.528  INFO 45668 --- [  restartedMain] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2018-06-27 18:38:24.552  INFO 45668 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Disable delta property : false
2018-06-27 18:38:24.553  INFO 45668 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Single vip registry refresh property : null
2018-06-27 18:38:24.553  INFO 45668 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Force full registry fetch : false
2018-06-27 18:38:24.553  INFO 45668 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Application is null : false
2018-06-27 18:38:24.553  INFO 45668 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Registered Applications size is zero : true
2018-06-27 18:38:24.553  INFO 45668 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Application version is -1: true
2018-06-27 18:38:24.553  INFO 45668 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Getting all instance registry info from the eureka server
2018-06-27 18:38:24.634 ERROR 45668 --- [  restartedMain] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error
2018-06-27 18:38:24.637  WARN 45668 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Using default backup registry implementation which does not do anything.
2018-06-27 18:38:24.639  INFO 45668 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Starting heartbeat executor: renew interval is: 5
2018-06-27 18:38:24.651  INFO 45668 --- [  restartedMain] c.n.discovery.InstanceInfoReplicator     : InstanceInfoReplicator onDemand update allowed rate per min is 12
2018-06-27 18:38:24.654  INFO 45668 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Discovery Client initialized at timestamp 1530113904653 with initial instances count: 0
2018-06-27 18:38:24.710  INFO 45668 --- [  restartedMain] com.hazelcast.instance.AddressPicker     : [LOCAL] [dev] [3.9.4] Picked [127.0.0.1]:13781, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=13781], bind any local is true
2018-06-27 18:38:24.724  INFO 45668 --- [  restartedMain] com.hazelcast.system                     : [127.0.0.1]:13781 [dev] [3.9.4] Hazelcast 3.9.4 (20180420 - b8001d5) starting at [127.0.0.1]:13781
2018-06-27 18:38:24.724  INFO 45668 --- [  restartedMain] com.hazelcast.system                     : [127.0.0.1]:13781 [dev] [3.9.4] Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
2018-06-27 18:38:24.724  INFO 45668 --- [  restartedMain] com.hazelcast.system                     : [127.0.0.1]:13781 [dev] [3.9.4] Configured Hazelcast Serialization version: 1
2018-06-27 18:38:25.138  INFO 45668 --- [  restartedMain] c.h.s.i.o.impl.BackpressureRegulator     : [127.0.0.1]:13781 [dev] [3.9.4] Backpressure is disabled
2018-06-27 18:38:25.604  INFO 45668 --- [  restartedMain] com.hazelcast.instance.Node              : [127.0.0.1]:13781 [dev] [3.9.4] Creating TcpIpJoiner
2018-06-27 18:38:25.756  INFO 45668 --- [  restartedMain] c.h.s.i.o.impl.OperationExecutorImpl     : [127.0.0.1]:13781 [dev] [3.9.4] Starting 4 partition threads and 3 generic threads (1 dedicated for priority tasks)
2018-06-27 18:38:25.757  INFO 45668 --- [  restartedMain] c.h.internal.diagnostics.Diagnostics     : [127.0.0.1]:13781 [dev] [3.9.4] Diagnostics disabled. To enable add -Dhazelcast.diagnostics.enabled=true to the JVM arguments.
2018-06-27 18:38:25.763  INFO 45668 --- [  restartedMain] com.hazelcast.core.LifecycleService      : [127.0.0.1]:13781 [dev] [3.9.4] [127.0.0.1]:13781 is STARTING
2018-06-27 18:38:25.775  INFO 45668 --- [  restartedMain] com.hazelcast.system                     : [127.0.0.1]:13781 [dev] [3.9.4] Cluster version set to 3.9
2018-06-27 18:38:25.776  INFO 45668 --- [  restartedMain] c.h.internal.cluster.ClusterService      : [127.0.0.1]:13781 [dev] [3.9.4]

Members {size:1, ver:1} [
        Member [127.0.0.1]:13781 - 1b2f39cc-ca05-432e-b108-8a7204db8299 this
]

2018-06-27 18:38:25.802  INFO 45668 --- [  restartedMain] com.hazelcast.core.LifecycleService      : [127.0.0.1]:13781 [dev] [3.9.4] [127.0.0.1]:13781 is STARTED
2018-06-27 18:38:25.817 DEBUG 45668 --- [  restartedMain] i.b.gateway.config.CacheConfiguration    : Starting HazelcastCacheManager
2018-06-27 18:38:25.951 DEBUG 45668 --- [  restartedMain] i.b.g.config.DatabaseConfiguration       : Configuring Liquibase
2018-06-27 18:38:26.132  WARN 45668 --- [eway-Executor-1] i.g.j.c.liquibase.AsyncSpringLiquibase   : Starting Liquibase asynchronously, your database might not be ready at startup!
2018-06-27 18:38:27.117  INFO 45668 --- [  restartedMain] c.h.h.HazelcastCacheRegionFactory        : Starting up HazelcastCacheRegionFactory
2018-06-27 18:38:27.119  INFO 45668 --- [  restartedMain] c.h.h.i.IHazelcastInstanceFactory        : Using existing HazelcastInstance [gateway].
2018-06-27 18:38:27.200 DEBUG 45668 --- [eway-Executor-1] i.g.j.c.liquibase.AsyncSpringLiquibase   : Liquibase has updated your database in 1068 ms
2018-06-27 18:38:28.585  WARN 45668 --- [  restartedMain] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2018-06-27 18:38:28.642 DEBUG 45668 --- [  restartedMain] io.binakot.gateway.config.WebConfigurer  : Registering CORS filter
2018-06-27 18:38:28.735  INFO 45668 --- [  restartedMain] io.binakot.gateway.config.WebConfigurer  : Web application configuration, using profiles: dev
2018-06-27 18:38:28.735 DEBUG 45668 --- [  restartedMain] io.binakot.gateway.config.WebConfigurer  : Initializing Metrics registries
2018-06-27 18:38:28.739 DEBUG 45668 --- [  restartedMain] io.binakot.gateway.config.WebConfigurer  : Registering Metrics Filter
2018-06-27 18:38:28.739 DEBUG 45668 --- [  restartedMain] io.binakot.gateway.config.WebConfigurer  : Registering Metrics Servlet
2018-06-27 18:38:28.742 DEBUG 45668 --- [  restartedMain] io.binakot.gateway.config.WebConfigurer  : Initialize H2 console
2018-06-27 18:38:28.743  INFO 45668 --- [  restartedMain] io.binakot.gateway.config.WebConfigurer  : Web application fully configured
2018-06-27 18:38:29.647 ERROR 45668 --- [tbeatExecutor-0] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error
2018-06-27 18:38:30.425  WARN 45668 --- [  restartedMain] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2018-06-27 18:38:31.244 DEBUG 45668 --- [  restartedMain] i.g.j.c.apidoc.SwaggerAutoConfiguration  : Starting Swagger
2018-06-27 18:38:31.256 DEBUG 45668 --- [  restartedMain] i.g.j.c.apidoc.SwaggerAutoConfiguration  : Started Swagger in 12 ms
2018-06-27 18:38:31.633  INFO 45668 --- [  restartedMain] c.h.i.p.impl.PartitionStateManager       : [127.0.0.1]:13781 [dev] [3.9.4] Initializing cluster partition table arrangement...
2018-06-27 18:38:32.541  INFO 45668 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Saw local status change event StatusChangeEvent [timestamp=1530113912541, current=UP, previous=STARTING]
2018-06-27 18:38:32.542  INFO 45668 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_GATEWAY/gateway:6885bda79227129ebffdc842a01bf2f9: registering service...
2018-06-27 18:38:32.547 ERROR 45668 --- [nfoReplicator-0] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error
2018-06-27 18:38:32.847 DEBUG 45668 --- [  restartedMain] i.b.g.config.OAuth2Configuration$1       : Initializing filter 'oncePerRequestFilter'
2018-06-27 18:38:32.847 DEBUG 45668 --- [  restartedMain] i.b.g.config.OAuth2Configuration$1       : Filter 'oncePerRequestFilter' configured successfully
2018-06-27 18:38:32.896  INFO 45668 --- [  restartedMain] io.binakot.gateway.GatewayApp            : Started GatewayApp in 15.884 seconds (JVM running for 16.538)
2018-06-27 18:38:32.904  INFO 45668 --- [  restartedMain] io.binakot.gateway.GatewayApp            :
----------------------------------------------------------
        Application 'gateway' is running! Access URLs:
        Local:          http://localhost:8080
        External:       http://192.168.0.114:8080
        Profile(s):     [dev, swagger]
----------------------------------------------------------
2018-06-27 18:38:32.904  INFO 45668 --- [  restartedMain] io.binakot.gateway.GatewayApp            :
----------------------------------------------------------
        Config Server:  Not found or not setup for this application
----------------------------------------------------------
2018-06-27 18:38:34.642  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Disable delta property : false
2018-06-27 18:38:34.642  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Single vip registry refresh property : null
2018-06-27 18:38:34.642  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Force full registry fetch : false
2018-06-27 18:38:34.642  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Application is null : false
2018-06-27 18:38:34.642  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Registered Applications size is zero : true
2018-06-27 18:38:34.642  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Application version is -1: true
2018-06-27 18:38:34.642  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Getting all instance registry info from the eureka server
2018-06-27 18:38:34.644 ERROR 45668 --- [freshExecutor-0] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error
2018-06-27 18:38:44.648  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Disable delta property : false
2018-06-27 18:38:44.649  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Single vip registry refresh property : null
2018-06-27 18:38:44.649  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Force full registry fetch : false
2018-06-27 18:38:44.649  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Application is null : false
2018-06-27 18:38:44.649  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Registered Applications size is zero : true
2018-06-27 18:38:44.649  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Application version is -1: true
2018-06-27 18:38:44.649  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Getting all instance registry info from the eureka server
2018-06-27 18:38:44.650 ERROR 45668 --- [freshExecutor-0] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error
2018-06-27 18:38:53.038 DEBUG 45668 --- [  XNIO-2 task-1] i.b.gateway.aop.logging.LoggingAspect    : Enter: io.binakot.gateway.repository.CustomAuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=2018-06-27T15:38:53.023Z, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null, type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2018-06-27 18:38:53.039 DEBUG 45668 --- [  XNIO-2 task-2] i.b.gateway.aop.logging.LoggingAspect    : Enter: io.binakot.gateway.repository.CustomAuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=2018-06-27T15:38:53.025Z, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null, type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2018-06-27 18:38:53.047 DEBUG 45668 --- [  XNIO-2 task-1] i.b.gateway.aop.logging.LoggingAspect    : Exit: io.binakot.gateway.repository.CustomAuditEventRepository.add() with result = null
2018-06-27 18:38:53.047 DEBUG 45668 --- [  XNIO-2 task-2] i.b.gateway.aop.logging.LoggingAspect    : Exit: io.binakot.gateway.repository.CustomAuditEventRepository.add() with result = null
2018-06-27 18:38:53.166 DEBUG 45668 --- [  XNIO-2 task-3] i.b.gateway.aop.logging.LoggingAspect    : Enter: io.binakot.gateway.repository.CustomAuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=2018-06-27T15:38:53.166Z, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null, type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2018-06-27 18:38:53.166 DEBUG 45668 --- [  XNIO-2 task-3] i.b.gateway.aop.logging.LoggingAspect    : Exit: io.binakot.gateway.repository.CustomAuditEventRepository.add() with result = null
2018-06-27 18:38:54.654  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Disable delta property : false
2018-06-27 18:38:54.655  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Single vip registry refresh property : null
2018-06-27 18:38:54.655  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Force full registry fetch : false
2018-06-27 18:38:54.655  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Application is null : false
2018-06-27 18:38:54.655  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Registered Applications size is zero : true
2018-06-27 18:38:54.655  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Application version is -1: true
2018-06-27 18:38:54.655  INFO 45668 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Getting all instance registry info from the eureka server
2018-06-27 18:38:57.449 DEBUG 45668 --- [  XNIO-2 task-5] i.b.gateway.aop.logging.LoggingAspect    : Enter: io.binakot.gateway.repository.CustomAuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=2018-06-27T15:38:57.449Z, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null, type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2018-06-27 18:38:57.449 DEBUG 45668 --- [  XNIO-2 task-4] i.b.gateway.aop.logging.LoggingAspect    : Enter: io.binakot.gateway.repository.CustomAuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=2018-06-27T15:38:57.449Z, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null, type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2018-06-27 18:38:57.449 DEBUG 45668 --- [  XNIO-2 task-5] i.b.gateway.aop.logging.LoggingAspect    : Exit: io.binakot.gateway.repository.CustomAuditEventRepository.add() with result = null
2018-06-27 18:38:57.449 DEBUG 45668 --- [  XNIO-2 task-4] i.b.gateway.aop.logging.LoggingAspect    : Exit: io.binakot.gateway.repository.CustomAuditEventRepository.add() with result = null
2018-06-27 18:38:57.457 DEBUG 45668 --- [  XNIO-2 task-6] i.b.gateway.aop.logging.LoggingAspect    : Enter: io.binakot.gateway.repository.CustomAuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=2018-06-27T15:38:57.456Z, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null, type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2018-06-27 18:38:57.457 DEBUG 45668 --- [  XNIO-2 task-6] i.b.gateway.aop.logging.LoggingAspect    : Exit: io.binakot.gateway.repository.CustomAuditEventRepository.add() with result = null

Yarn output:

yarn run v1.7.0
$ yarn run webpack:dev
$ yarn run webpack-dev-server --config webpack/webpack.dev.js --progress --inline --profile --port=9060
$ node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack/webpack.dev.js --progress --inline --profile --port=9060
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
 10% building modules 1/1 modules 0 active[HPM] Proxy created: [ '/api',
  '/management',
  '/swagger-resources',
  '/v2/api-docs',
  '/h2-console',
  '/auth' ]  ->  http://127.0.0.1:8080
(node:45673) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
ℹ 「wds」: Project is running at http://localhost:9060/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from ./build/www
3573ms building modules
8ms finish module graph
1ms sealing
0ms basic dependencies optimization
0ms dependencies optimization
0ms advanced dependencies optimization
12ms after dependencies optimization
0ms optimizing
0ms basic module optimization
0ms module optimization
0ms advanced module optimization
1ms after module optimization
0ms basic chunk optimization
0ms chunk optimization
14ms advanced chunk optimization
1ms after chunk optimization
0ms module and chunk tree optimization
0ms after module and chunk tree optimization
0ms basic chunk modules optimization
0ms chunk modules optimization
0ms advanced chunk modules optimization
0ms after chunk modules optimization
0ms module reviving
0ms module order optimization
1ms advanced module order optimization
4ms before module ids
1ms module ids
4ms module id optimization
1ms chunk reviving
0ms chunk order optimization
0ms before chunk ids
0ms chunk id optimization
4ms after chunk id optimization
2ms record modules
0ms record chunks
33ms hashing
0ms after hashing
0ms record hash
1ms module assets processing
54ms chunk assets processing
4ms additional chunk assets processing
33ms recording
0ms additional asset processing
1ms chunk asset optimization
248ms after chunk asset optimization
0ms asset optimization
0ms after asset optimization
0ms after seal
 95% emitting unnamed compat pluginType checking and linting in progress...
418ms emitting
ℹ 「wdm」: Hash: 36fd9109fb226c2c2dc2
Version: webpack 4.4.1
Time: 4274ms
Built at: 27.06.2018 18:38:50
                                               Asset       Size  Chunks             Chunk Names
                     static/images/logo-jhipster.png   4.35 KiB          [emitted]
        content/4d7a941186721ef8150a081fa7cfa010.svg   36.5 KiB          [emitted]
                              app/main.bundle.js.map   5.41 MiB    main  [emitted]  main
               static/images/logo-jhipster-react.svg   36.5 KiB          [emitted]
                                         favicon.ico    5.3 KiB          [emitted]
                                     manifest.webapp  727 bytes          [emitted]
                                          robots.txt  168 bytes          [emitted]
swagger-ui/dist/lib/highlight.9.1.0.pack_extended.js  310 bytes          [emitted]
            swagger-ui/dist/lib/jquery.ba-bbq.min.js   3.44 KiB          [emitted]
           swagger-ui/dist/lib/jquery.slideto.min.js  365 bytes          [emitted]
            swagger-ui/dist/lib/jquery.wiggle.min.js  536 bytes          [emitted]
                swagger-ui/dist/lib/swagger-oauth.js   6.88 KiB          [emitted]
                       swagger-ui/dist/css/reset.css  773 bytes          [emitted]
      swagger-ui/dist/lib/object-assign-pollyfill.js  349 bytes          [emitted]
         swagger-ui/dist/lib/highlight.9.1.0.pack.js   10.7 KiB          [emitted]
                       swagger-ui/dist/lib/marked.js   15.4 KiB          [emitted]
                 swagger-ui/dist/lib/backbone-min.js   18.9 KiB          [emitted]
                     swagger-ui/dist/lib/es5-shim.js   22.2 KiB          [emitted]
                  swagger-ui/dist/css/typography.css    0 bytes          [emitted]
                       swagger-ui/dist/css/style.css   3.41 KiB          [emitted]
                                  app/main.bundle.js   5.41 MiB    main  [emitted]  main
                           static/images/hipster.png   9.28 KiB          [emitted]
                               swagger-ui/index.html   7.49 KiB          [emitted]
                         static/images/hipster2x.png   18.4 KiB          [emitted]
                  swagger-ui/dist/lib/js-yaml.min.js   42.5 KiB          [emitted]
                 swagger-ui/dist/images/throbber.gif   9.04 KiB          [emitted]
                       swagger-ui/dist/css/print.css   40.7 KiB          [emitted]
                      swagger-ui/dist/css/screen.css   42.6 KiB          [emitted]
                   swagger-ui/dist/lib/lodash.min.js   50.7 KiB          [emitted]
             swagger-ui/dist/lib/handlebars-4.0.5.js   69.8 KiB          [emitted]
             swagger-ui/dist/lib/jquery-1.8.0.min.js   89.9 KiB          [emitted]
                        static/images/hipster384.png   58.5 KiB          [emitted]
                        static/images/hipster512.png   81.3 KiB          [emitted]
                        static/images/hipster192.png   27.3 KiB          [emitted]
               swagger-ui/dist/lib/jsoneditor.min.js    127 KiB          [emitted]
                        static/images/hipster256.png   40.2 KiB          [emitted]
            swagger-ui/dist/lib/sanitize-html.min.js    127 KiB          [emitted]
                   swagger-ui/dist/swagger-ui.min.js    442 KiB          [emitted]
                                          index.html   1.85 KiB          [emitted]
                                      ./i18n/en.json   11.6 KiB          [emitted]
                                      ./i18n/ru.json   11.4 KiB          [emitted]
Entrypoint main = app/main.bundle.js app/main.bundle.js.map
[./node_modules/loglevel/lib/loglevel.js] 7.68 KiB {main} [built]
       [0] 2ms -> [./node_modules/webpack-dev-server/client/index.js?http://localhost:9060] 180ms -> factory:176ms building:17ms dependencies:0ms = 375ms
[./node_modules/react-dom/index.js] 1.33 KiB {main} [built]
       [0] 2ms -> [./src/main/webapp/app/index.tsx] 180ms -> factory:168ms building:30ms dependencies:185ms = 565ms
[./node_modules/react-hot-loader/index.js] 40 bytes {main} [built]
       [0] 2ms -> [./src/main/webapp/app/index.tsx] 180ms -> factory:168ms building:30ms dependencies:185ms = 565ms
[./node_modules/react-hot-loader/patch.js] 40 bytes {main} [built]
       [0] 2ms -> factory:113ms building:67ms dependencies:89ms = 271ms
[./node_modules/react/index.js] 190 bytes {main} [built]
       [0] 2ms -> [./src/main/webapp/app/index.tsx] 180ms -> factory:168ms building:30ms dependencies:185ms = 565ms
[./node_modules/webpack-dev-server/client/index.js?http://localhost:9060] (webpack)-dev-server/client?http://localhost:9060 7.75 KiB {main} [built]
       [0] 2ms -> factory:113ms building:67ms dependencies:89ms = 271ms
[./node_modules/webpack/hot/dev-server.js] (webpack)/hot/dev-server.js 1.66 KiB {main} [built]
       [0] 2ms -> factory:113ms building:67ms dependencies:89ms = 271ms
[./src/main/webapp/app/config/axios-interceptor.ts] 2.13 KiB {main} [built]
       [0] 2ms -> [./src/main/webapp/app/index.tsx] 180ms -> factory:168ms building:30ms dependencies:185ms = 565ms
[./src/main/webapp/app/config/devtools.tsx] 1.61 KiB {main} [built]
       [0] 2ms -> [./src/main/webapp/app/index.tsx] 180ms -> factory:168ms building:30ms dependencies:185ms = 565ms
[./src/main/webapp/app/config/icon-loader.ts] 2.12 KiB {main} [built]
       [0] 2ms -> [./src/main/webapp/app/index.tsx] 180ms -> factory:168ms building:30ms dependencies:185ms = 565ms
[./src/main/webapp/app/config/store.ts] 2.32 KiB {main} [built]
       [0] 2ms -> [./src/main/webapp/app/index.tsx] 180ms -> factory:168ms building:30ms dependencies:185ms = 565ms
[./src/main/webapp/app/config/translation.ts] 2.1 KiB {main} [built]
       [0] 2ms -> [./src/main/webapp/app/index.tsx] 180ms -> factory:168ms building:30ms dependencies:185ms = 565ms
[./src/main/webapp/app/index.tsx] 2.71 KiB {main} [built]
       [0] 2ms -> factory:113ms building:67ms dependencies:89ms = 271ms
[./src/main/webapp/app/shared/reducers/authentication.ts] 3.83 KiB {main} [built]
       [0] 2ms -> [./src/main/webapp/app/index.tsx] 180ms -> factory:168ms building:30ms dependencies:185ms = 565ms
   [0] multi (webpack)-dev-server/client?http://localhost:9060 webpack/hot/dev-server react-hot-loader/patch ./src/main/webapp/app/index 64 bytes {main} [built]
       factory:0ms building:2ms = 2ms
    + 1081 hidden modules
ℹ 「wdm」: Compiled successfully.
[Browsersync] Proxying: http://localhost:9060
[Browsersync] Access URLs:
 --------------------------------------
       Local: http://localhost:9000
    External: http://192.168.0.114:9000
 --------------------------------------
          UI: http://localhost:3001
 UI External: http://192.168.0.114:3001
 --------------------------------------
No type errors found
No lint errors found
Version: typescript 2.8.1, tslint 5.9.1
Time: 7444ms

Chrome page + console:

2018-06-27 18 54 31

And network:

2018-06-27 18 57 28
binakot commented 6 years ago

I'm pretty sure that the problem in React. If I generate same project, but only with Angular 6, everything works fine!

2018-06-27 19 16 14 2018-06-27 19 16 28
vishal423 commented 6 years ago

I also hit into same issue on react. Easy way to reproduce is to deploy only frontend code using yarn. However, if you switch across menu, then, this should go away.

deepu105 commented 6 years ago

Hi there has been some i18n related fixes merged to master. Can you guys try the master branch and let us know if the problem still exists?

https://github.com/jhipster/generator-jhipster/pull/7835#pullrequestreview-132710142

deepu105 commented 6 years ago

@agaspardcilia since you already did some i18n fix can you check bif that fixed this as well?

vishal423 commented 6 years ago

I think the problem is in error-middleware while reading error response.

vishal423 commented 6 years ago

some more debugging and the issue is with the way we do translations when the key is not found (scenario I described above would result into error message text to be treated as key and there wouldn't be any translations and it returns complete bundle of that locale)

vishal423 commented 6 years ago
createError.js:16 Uncaught (in promise) Error: Request failed with status code 504
    at createError (createError.js:16)
    at settle (settle.js:18)
    at XMLHttpRequest.handleLoad (xhr.js:77)
createError @ createError.js:16
settle @ settle.js:18
handleLoad @ xhr.js:77
ToastContainer.js:201 Uncaught Error: The element you provided cannot be rendered. You provided an element of type object
    at ToastContainer.show (ToastContainer.js:201)
    at Object.<anonymous> (ToastContainer.js:140)
    at EventManager.js:39
deepu105 commented 6 years ago

If you found the root cause can you do a PR?

Thanks & Regards, Deepu

On Thu, Jun 28, 2018 at 9:45 AM vishal423 notifications@github.com wrote:

createError.js:16 Uncaught (in promise) Error: Request failed with status code 504 at createError (createError.js:16) at settle (settle.js:18) at XMLHttpRequest.handleLoad (xhr.js:77) createError @ createError.js:16 settle @ settle.js:18 handleLoad @ xhr.js:77 ToastContainer.js:201 Uncaught Error: The element you provided cannot be rendered. You provided an element of type object at ToastContainer.show (ToastContainer.js:201) at Object. (ToastContainer.js:140) at EventManager.js:39

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/7843#issuecomment-400943721, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDlF9IKsNOpC1OR4B5Sb9U7g-wZvATTks5uBImKgaJpZM4U0vTl .

vishal423 commented 6 years ago

The issue that I identified is slightly different than the one initially reported here. In my case, error message was passed to fetch corresponding translation, whereas the issue reported here doesn't hit into that scenario. Later evening will try to do the PR for the one that I identified.

deepu105 commented 6 years ago

@binakot can you try with latest master if this is fixed?

binakot commented 6 years ago

@deepu105 I confirm, everything worked. Just generated gateway with React via JHipster from master branch, there is no translation errors.

deepu105 commented 6 years ago

Great thanks. More improvements are on the way :)

shakib04 commented 2 years ago

found this problem with Angular. I have added a key and message in global.json. but it shows translation-not-found

how can solve this?

gmarziou commented 2 years ago

@shakib04 Please don't comment on a 3 years old closed issue. If you have a problem with current version open a new issue with all requested details.