Skip to content

本地启动Apollo问题 #5339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Dcein opened this issue Feb 14, 2025 · 5 comments
Closed

本地启动Apollo问题 #5339

Dcein opened this issue Feb 14, 2025 · 5 comments
Labels

Comments

@Dcein
Copy link

Dcein commented Feb 14, 2025

问题描述:
本地启动Apollo服务后,访问protal时直接进入了Apollo界面,没有让输入账号和密码登录,无法创建appId,也无法创建应用,希望大佬帮忙看一下。
Image

一些细节详情:
我从https://github.com/apolloconfig/apollox下载我们Apollo zip包,通过idea打开,导入官网的SQL并在application-github.properties配置数据库,启动服务。注册中心服务都正常注册,如下:
Image

我访问本地protal服务:http://localhost:8070/直接出现如下,而没让通过登录页面进行登录,截图如下:
Image

我强制通过http://localhost:8070/signin访问登录页面,报如下的错:
Image

还有,Protal服务一直在报这个错,我用的M有SQL数据库但是不知道为什么使用h2来查询,如下是报错的详细日志:
2025-02-14 18:00:00.003 ERROR 13688 --- [pool-1-thread-1] o.s.s.s.TaskUtils$LoggingErrorHandler : Unexpected error occurred in scheduled task

org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [DELETE FROM SPRING_SESSION WHERE EXPIRY_TIME < ?]; nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "SPRING_SESSION" not found; SQL statement:
DELETE FROM SPRING_SESSION WHERE EXPIRY_TIME < ? [42102-214]
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1541)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:667)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:960)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:1015)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:1025)
at org.springframework.session.jdbc.JdbcIndexedSessionRepository.lambda$cleanUpExpiredSessions$8(JdbcIndexedSessionRepository.java:587)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.springframework.session.jdbc.JdbcIndexedSessionRepository.cleanUpExpiredSessions(JdbcIndexedSessionRepository.java:587)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:95)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "SPRING_SESSION" not found; SQL statement:
DELETE FROM SPRING_SESSION WHERE EXPIRY_TIME < ? [42102-214]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:502)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:477)
at org.h2.message.DbException.get(DbException.java:223)
at org.h2.message.DbException.get(DbException.java:199)
at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8398)
at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8369)
at org.h2.command.Parser.readTableOrView(Parser.java:8358)
at org.h2.command.Parser.readTableOrView(Parser.java:8328)
at org.h2.command.Parser.readSimpleTableFilter(Parser.java:1160)
at org.h2.command.Parser.parseDelete(Parser.java:1174)
at org.h2.command.Parser.parsePrepared(Parser.java:774)
at org.h2.command.Parser.parse(Parser.java:689)
at org.h2.command.Parser.parse(Parser.java:661)
at org.h2.command.Parser.prepareCommand(Parser.java:569)
at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631)
at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116)
at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:92)
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:288)
at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:337)
at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java)
at org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1645)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:649)
... 16 common frames omitted
其他配置都是系统默认的配置,希望大佬看到问题能帮我看一下,感谢!

Copy link

dosubot bot commented Feb 14, 2025

@Dcein 你好!我是Dosu,一个可以帮助解决问题、回答疑问并成为贡献者的机器人。我会在等待人类维护者的过程中帮助你。

I found a similar discussion that might be relevant to your issue. The discussion titled "apollo源码打包后启动登录时报ttpRequestMethodNotSupportedException: Request method 'POST' not supported" addresses a similar problem where the login page is not functioning as expected. The suggested solution in a related closed issue was to check the portal's profile configuration, as it might have been set incorrectly. You can refer to the documentation to verify and correct the configuration [1][2].

Regarding the error with the H2 database, it seems like the Apollo Portal is attempting to use H2 for session management instead of your intended MySQL database. This could be due to a misconfiguration in your database settings. Ensure that your application-github.properties file is correctly configured to use MySQL for all database connections, including session management. You might need to explicitly set the session store to use MySQL by configuring the appropriate Spring session properties.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@nobodyiam
Copy link
Member

看起来是 idea 启动配置不正确所致,可以仔细看下文档 https://www.apolloconfig.com/#/zh/contribution/apollo-development-guide

@Dcein
Copy link
Author

Dcein commented Feb 17, 2025

看起来是 idea 启动配置不正确所致,可以仔细看下文档 https://www.apolloconfig.com/#/zh/contribution/apollo-development-guide

好的,我再看下,感谢大佬!

Copy link

stale bot commented Mar 19, 2025

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 19, 2025
Copy link

stale bot commented Mar 27, 2025

This issue has been automatically closed because it has not had activity in the last 7 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

@stale stale bot closed this as completed Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants