[ 
https://issues.apache.org/jira/browse/AMBARI-22938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16356617#comment-16356617
 ] 

Swapan Shridhar edited comment on AMBARI-22938 at 2/8/18 8:03 AM:
------------------------------------------------------------------

*Analysis:*
Comparing the "*_id_seq" number variables used in *Entity.java files and 
*CREATE.sql files:

- *Entity.java files: grep and sort of "_id_seq" in all *Entity.java files give 
the following sequence variables created:

{code}
alert_current_id_seq
alert_definition_id_seq
alert_group_id_seq
alert_history_id_seq
alert_notice_id_seq
alert_target_id_seq
blueprint_mpack_instance_id_seq
blueprint_service_id_seq
blueprint_setting_id_seq
cluster_id_seq
cluster_setting_id_seq
configgroup_id_seq
config_id_seq
extension_id_seq
group_id_seq
hostcomponentdesiredstate_id_seq
hostcomponentstate_id_seq
hostgroup_component_id_seq
host_id_seq
host_role_command_id_seq
host_version_id_seq
kkp_id_seq
link_id_seq
member_id_seq
mpack_id_seq
operation_level_id_seq
permission_id_seq
principal_id_seq
principal_type_id_seq
privilege_id_seq
registry_id_seq
remote_cluster_id_seq
remote_cluster_service_id_seq
repo_version_id_seq
requestschedule_id_seq
resourcefilter_id_seq
resource_id_seq
resource_type_id_seq
servicecomponentdesiredstate_id_seq
servicecomponent_version_id_seq
service_config_id_seq
service_dependency_id_seq
service_group_dependency_id_seq
service_group_id_seq
service_id_seq
setting_id_seq
stack_id_seq
topology_host_group_id_seq
topology_host_info_id_seq
topology_host_task_id_seq
topology_logical_task_id_seq
topology_request_id_seq
upgrade_group_id_seq
upgrade_history_id_seq
upgrade_id_seq
upgrade_item_id_seq
user_authentication_id_seq
user_id_seq
viewentity_id_seq
view_instance_id_seq
viewurl_id_seq
widget_id_seq
widget_layout_id_seq
{code}

*Total count :* 63


- *CREATE.sql_ files: Sort of *"_id_seq"* in *CREATE.sql_ file gives the 
following sequence variables created:

{code}
alert_current_id_seq
alert_definition_id_seq
alert_group_id_seq
alert_history_id_seq
alert_notice_id_seq
alert_target_id_seq
ambari_operation_history_id_seq
blueprint_mpack_instance_id_seq
blueprint_service_id_seq
blueprint_setting_id_seq
cluster_id_seq
cluster_setting_id_seq
configgroup_id_seq
config_id_seq
extension_id_seq
group_id_seq
hostcomponentdesiredstate_id_seq
hostcomponentstate_id_seq
hostgroup_component_id_seq
host_id_seq
host_role_command_id_seq
host_version_id_seq
kkp_id_seq
link_id_seq
member_id_seq
mpack_id_seq
operation_level_id_seq
permission_id_seq
principal_id_seq
principal_type_id_seq
privilege_id_seq
registry_id_seq
remote_cluster_id_seq
remote_cluster_service_id_seq
repo_version_id_seq
requestschedule_id_seq
resourcefilter_id_seq
resource_id_seq
resource_type_id_seq
servicecomponentdesiredstate_id_seq
servicecomponent_version_id_seq
service_config_id_seq
service_dependency_id_seq
service_group_dependency_id_seq
service_group_id_seq
service_id_seq
setting_id_seq
stack_id_seq
topology_host_group_id_seq
topology_host_info_id_seq
topology_host_request_id_seq
topology_host_task_id_seq
topology_logical_request_id_seq
topology_logical_task_id_seq
topology_request_id_seq
upgrade_group_id_seq
upgrade_history_id_seq
upgrade_id_seq
upgrade_item_id_seq
user_authentication_id_seq
user_id_seq
viewentity_id_seq
view_instance_id_seq
widget_id_seq
widget_layout_id_seq
{code}

*Total count :* 65

Sequence variable *viewurl_id_seq* defined in *ViewURLEntity.java* is one such 
entry not defined in Ambari-DDL-Postgres-CREATE.sql file's *ambari_sequences* 
table.

*Fix:* Adding the 

{code}
('viewurl_id_seq', '0')
{code}

in CREATE.sql enables the ambari server to come up fine.

CC [~jluniya] | [~mradhakrishnan]


was (Author: swapanshridhar):
*Analysis:*
Comparing the *"*_id_seq"* number variables used in _**Entity.java_ files and 
_**CREATE.sql_ files:

- *Entity.java files: grep and sort of *"_id_seq"* in all *Entity.java files 
give the following sequence variables created:

{code}
alert_current_id_seq
alert_definition_id_seq
alert_group_id_seq
alert_history_id_seq
alert_notice_id_seq
alert_target_id_seq
blueprint_mpack_instance_id_seq
blueprint_service_id_seq
blueprint_setting_id_seq
cluster_id_seq
cluster_setting_id_seq
configgroup_id_seq
config_id_seq
extension_id_seq
group_id_seq
hostcomponentdesiredstate_id_seq
hostcomponentstate_id_seq
hostgroup_component_id_seq
host_id_seq
host_role_command_id_seq
host_version_id_seq
kkp_id_seq
link_id_seq
member_id_seq
mpack_id_seq
operation_level_id_seq
permission_id_seq
principal_id_seq
principal_type_id_seq
privilege_id_seq
registry_id_seq
remote_cluster_id_seq
remote_cluster_service_id_seq
repo_version_id_seq
requestschedule_id_seq
resourcefilter_id_seq
resource_id_seq
resource_type_id_seq
servicecomponentdesiredstate_id_seq
servicecomponent_version_id_seq
service_config_id_seq
service_dependency_id_seq
service_group_dependency_id_seq
service_group_id_seq
service_id_seq
setting_id_seq
stack_id_seq
topology_host_group_id_seq
topology_host_info_id_seq
topology_host_task_id_seq
topology_logical_task_id_seq
topology_request_id_seq
upgrade_group_id_seq
upgrade_history_id_seq
upgrade_id_seq
upgrade_item_id_seq
user_authentication_id_seq
user_id_seq
viewentity_id_seq
view_instance_id_seq
viewurl_id_seq
widget_id_seq
widget_layout_id_seq
{code}

*Total count :* 63


- *CREATE.sql_ files: Sort of *"_id_seq"* in *CREATE.sql_ file gives the 
following sequence variables created:

{code}
alert_current_id_seq
alert_definition_id_seq
alert_group_id_seq
alert_history_id_seq
alert_notice_id_seq
alert_target_id_seq
ambari_operation_history_id_seq
blueprint_mpack_instance_id_seq
blueprint_service_id_seq
blueprint_setting_id_seq
cluster_id_seq
cluster_setting_id_seq
configgroup_id_seq
config_id_seq
extension_id_seq
group_id_seq
hostcomponentdesiredstate_id_seq
hostcomponentstate_id_seq
hostgroup_component_id_seq
host_id_seq
host_role_command_id_seq
host_version_id_seq
kkp_id_seq
link_id_seq
member_id_seq
mpack_id_seq
operation_level_id_seq
permission_id_seq
principal_id_seq
principal_type_id_seq
privilege_id_seq
registry_id_seq
remote_cluster_id_seq
remote_cluster_service_id_seq
repo_version_id_seq
requestschedule_id_seq
resourcefilter_id_seq
resource_id_seq
resource_type_id_seq
servicecomponentdesiredstate_id_seq
servicecomponent_version_id_seq
service_config_id_seq
service_dependency_id_seq
service_group_dependency_id_seq
service_group_id_seq
service_id_seq
setting_id_seq
stack_id_seq
topology_host_group_id_seq
topology_host_info_id_seq
topology_host_request_id_seq
topology_host_task_id_seq
topology_logical_request_id_seq
topology_logical_task_id_seq
topology_request_id_seq
upgrade_group_id_seq
upgrade_history_id_seq
upgrade_id_seq
upgrade_item_id_seq
user_authentication_id_seq
user_id_seq
viewentity_id_seq
view_instance_id_seq
widget_id_seq
widget_layout_id_seq
{code}

*Total count :* 65

Sequence variable *viewurl_id_seq* defined in *ViewURLEntity.java* is one such 
entry not defined in Ambari-DDL-Postgres-CREATE.sql file's *ambari_sequences* 
table.

*Fix:* Adding the 

{code}
('viewurl_id_seq', '0')
{code}

in CREATE.sql enables the ambari server to come up fine.

CC [~jluniya] | [~mradhakrishnan]

> Ambari server start fails with fresh Ambari installation
> --------------------------------------------------------
>
>                 Key: AMBARI-22938
>                 URL: https://issues.apache.org/jira/browse/AMBARI-22938
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server
>    Affects Versions: 3.0.0
>            Reporter: Swapan Shridhar
>            Assignee: Swapan Shridhar
>            Priority: Blocker
>             Fix For: trunk, 3.0.0
>
>
> On branch *branch-feature-AMBARI-14714*, after installation, Ambari server 
> starts fails as following :
> {code:title=/var/log/ambari-server/ambari-server.out}
> An unexpected error occured during starting Ambari Server.
> Exception in thread "main" 
> com.google.inject.internal.util.$ComputationException: 
> java.lang.ArrayIndexOutOfBoundsException: 7786
>  at 
> com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:553)
>  at 
> com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:419)
>  at 
> com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
>  at 
> com.google.inject.internal.util.$StackTraceElements.forMember(StackTraceElements.java:53)
>  at com.google.inject.internal.Errors.formatSource(Errors.java:690)
>  at com.google.inject.internal.Errors.formatInjectionPoint(Errors.java:720)
>  at com.google.inject.internal.Errors.formatSource(Errors.java:684)
>  at com.google.inject.internal.Errors.format(Errors.java:555)
>  at 
> com.google.inject.ProvisionException.getMessage(ProvisionException.java:59)
>  at java.lang.Throwable.getLocalizedMessage(Throwable.java:391)
>  at java.lang.Throwable.toString(Throwable.java:480)
>  at java.lang.String.valueOf(String.java:2994)
>  at java.io.PrintStream.println(PrintStream.java:821)
>  at java.lang.Throwable$WrappedPrintStream.println(Throwable.java:748)
>  at java.lang.Throwable.printStackTrace(Throwable.java:655)
>  at java.lang.Throwable.printStackTrace(Throwable.java:643)
>  at java.lang.Throwable.printStackTrace(Throwable.java:634)
>  at 
> org.apache.ambari.server.controller.AmbariServer.main(AmbariServer.java:1118)
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 7786
>  at com.google.inject.internal.asm.$ClassReader.readClass(Unknown Source)
>  at com.google.inject.internal.asm.$ClassReader.accept(Unknown Source)
>  at com.google.inject.internal.asm.$ClassReader.accept(Unknown Source)
>  at com.google.inject.internal.util.$LineNumbers.<init>(LineNumbers.java:62)
>  at 
> com.google.inject.internal.util.$StackTraceElements$1.apply(StackTraceElements.java:36)
>  at 
> com.google.inject.internal.util.$StackTraceElements$1.apply(StackTraceElements.java:33)
>  at 
> com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:549)
>  ... 17 more
> {code}
>  
>  
> Stack trace while debugging gives the following:
>  
> {code:java}
> Error preallocating sequence numbers. The sequence table information is not 
> complete.
> {code}
> CC [~jluniya] | [~mradhakrishnan]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to