Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Getting error when adding grafana to ambari ?

Highlighted

Getting error when adding grafana to ambari ?

Guru

When we are adding metrics_grafana to ambari then we are getting following error.

Exception [EclipseLink-4011] (Eclipse Persistence Services - 2.6.2.v20151217-774c696): org.eclipse.persistence.exceptions.DatabaseException

Exception Description: Error preallocating sequence numbers. The sequence table information is not complete.

at org.eclipse.persistence.exceptions.DatabaseException.errorPreallocatingSequenceNumbers(DatabaseException.java:150)

at org.eclipse.persistence.sequencing.StandardSequence.getGeneratedVector(StandardSequence.java:73)

at org.eclipse.persistence.sequencing.Sequence.getGeneratedVector(Sequence.java:257)

at org.eclipse.persistence.internal.sequencing.SequencingManager$Preallocation_Transaction_NoAccessor_State.getNextValue(SequencingManager.java:485)

at org.eclipse.persistence.internal.sequencing.SequencingManager.getNextValue(SequencingManager.java:1107)

at org.eclipse.persistence.internal.sequencing.ClientSessionSequencing.getNextValue(ClientSessionSequencing.java:70)

at org.eclipse.persistence.internal.descriptors.ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:362)

at org.eclipse.persistence.internal.descriptors.ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:321)

at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.assignSequenceNumber(UnitOfWorkImpl.java:486)

at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNotRegisteredNewObjectForPersist(UnitOfWorkImpl.java:4288)

at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.registerNotRegisteredNewObjectForPersist(RepeatableWriteUnitOfWork.java:521)

at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:4233)

at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persist(EntityManagerImpl.java:507)

at org.apache.ambari.server.orm.dao.ServiceComponentDesiredStateDAO.create(ServiceComponentDesiredStateDAO.java:110)

at org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor.invoke(AmbariJpaLocalTxnInterceptor.java:118)

at org.apache.ambari.server.state.ServiceComponentImpl.persistEntities(ServiceComponentImpl.java:628)

at org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor.invoke(AmbariJpaLocalTxnInterceptor.java:128)

at org.apache.ambari.server.state.ServiceComponentImpl.persist(ServiceComponentImpl.java:596)

at org.apache.ambari.server.controller.internal.ComponentResourceProvider.createComponents(ComponentResourceProvider.java:382)

at org.apache.ambari.server.controller.internal.ComponentResourceProvider$1.invoke(ComponentResourceProvider.java:144)

at org.apache.ambari.server.controller.internal.ComponentResourceProvider$1.invoke(ComponentResourceProvider.java:141)

at org.apache.ambari.server.controller.internal.AbstractResourceProvider.invokeWithRetry(AbstractResourceProvider.java:455)

at org.apache.ambari.server.controller.internal.AbstractResourceProvider.createResources(AbstractResourceProvider.java:278)

at org.apache.ambari.server.controller.internal.ComponentResourceProvider.createResourcesAuthorized(ComponentResourceProvider.java:141)

at org.apache.ambari.server.controller.internal.AbstractAuthorizedResourceProvider.createResources(AbstractAuthorizedResourceProvider.java:220)

at org.apache.ambari.server.controller.internal.ClusterControllerImpl.createResources(ClusterControllerImpl.java:298)

at org.apache.ambari.server.api.services.persistence.PersistenceManagerImpl.create(PersistenceManagerImpl.java:97)

at org.apache.ambari.server.api.handlers.CreateHandler.persist(CreateHandler.java:37)

5 REPLIES 5
Highlighted

Re: Getting error when adding grafana to ambari ?

Expert Contributor

This exception means the ambari_sequences table is out of date with what auto-generated id provided by JPA which should never happen. Do you accidentally have same database shared among 2 different Ambari servers?

1. Can you restart ambari server and try to add again?

2. If 1, fails with same error, need to look at ambari_sequences table and match with clusterservice table, you can bump up the ambari_sequences table value by 100 + current value for service_id to get past this. Make sure to backup the database.

Highlighted

Re: Getting error when adding grafana to ambari ?

Guru

@swagle I checked and this db is not shared by any other databases. I don't see clusterservice table in ambari db. I have clusterservices and I checked it as well but I could not find it relevant.

mysql> select * from clusterservices;

+----------------+------------+-----------------+

| service_name | cluster_id | service_enabled |

+----------------+------------+-----------------+

| AMBARI_METRICS | 2 | 0 |

| ATLAS | 2 | 0 |

| FALCON | 2 | 0 |

| FLUME | 2 | 0 |

| HBASE | 2 | 0 |

| HDFS | 2 | 0 |

| HIVE | 2 | 0 |

| KAFKA | 2 | 0 |

| KNOX | 2 | 0 |

| MAPREDUCE2 | 2 | 0 |

| OOZIE | 2 | 0 |

| PIG | 2 | 0 |

| RANGER | 2 | 0 |

| RANGER_KMS | 2 | 0 |

| SLIDER | 2 | 0 |

| SMARTSENSE | 2 | 0 |

| SPARK | 2 | 0 |

| SQOOP | 2 | 0 |

| STORM | 2 | 0 |

| TEZ | 2 | 0 |

| YARN | 2 | 0 |

| ZOOKEEPER | 2 | 0 |

+----------------+------------+-----------------+

And do you want me to change sequence_value with 100+ for all service. I have following value in my tables.

mysql> select * from ambari_sequences;

+---------------------------------+----------------+

| sequence_name | sequence_value |

+---------------------------------+----------------+

| alert_current_id_seq | 400 |

| alert_definition_id_seq | 400 |

| alert_group_id_seq | 300 |

| alert_history_id_seq | 4450 |

| alert_notice_id_seq | 6650 |

| alert_target_id_seq | 100 |

| blueprint_setting_id_seq | 0 |

| cluster_id_seq | 2 |

| cluster_version_id_seq | 50 |

| configgroup_id_seq | 51 |

| config_id_seq | 1189 |

| extension_id_seq | 0 |

| group_id_seq | 1 |

| hostcomponentstate_id_seq | 475 |

| host_id_seq | 5 |

| host_role_command_id_seq | 4951 |

| host_version_id_seq | 50 |

| link_id_seq | 0 |

| member_id_seq | 1 |

| operation_level_id_seq | 1048 |

| permission_id_seq | 55 |

| principal_id_seq | 4502 |

| principal_type_id_seq | 53 |

| privilege_id_seq | 357 |

| remote_cluster_id_seq | 1 |

| remote_cluster_service_id_seq | 1 |

| repo_version_id_seq | 50 |

| requestschedule_id_seq | 252 |

| resourcefilter_id_seq | 1936 |

| resource_id_seq | 354 |

| resource_type_id_seq | 157 |

| servicecomponent_history_id_seq | 0 |

| service_config_id_seq | 1001 |

| setting_id_seq | 0 |

| stack_id_seq | 100 |

| topology_host_group_id_seq | 0 |

| topology_host_info_id_seq | 0 |

| topology_host_request_id_seq | 0 |

| topology_host_task_id_seq | 0 |

| topology_logical_request_id_seq | 0 |

| topology_logical_task_id_seq | 0 |

| topology_request_id_seq | 0 |

| upgrade_group_id_seq | 50 |

| upgrade_id_seq | 50 |

| upgrade_item_id_seq | 150 |

| user_id_seq | 4002 |

| viewentity_id_seq | 150 |

| viewurl_id_seq | 1 |

| view_instance_id_seq | 352 |

| widget_id_seq | 150 |

| widget_layout_id_seq | 600 |

+---------------------------------+----------------+

51 rows in set (0.00 sec)

Highlighted

Re: Getting error when adding grafana to ambari ?

Expert Contributor

On second thought the exception trace is trying to add to servicecomponentdesiredstate table which does not even use a sequence id so ignore the previous advice regarding checking on ids for a service. Since you are trying to add Grafana I presume you are on Ambari version 2.2.2

What is the version of MySQL and the mysql connector that you are using?

Highlighted

Re: Getting error when adding grafana to ambari ?

I have received this same error multiple times as well over the past few months, on varying levels of Ambari up to and including 2.4.2.0. And it has been for a variety of services I've tried to add - such as HAWQ and Falcon. I'm running MySQL as well.

mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1

Tried restart Ambari Server, agents, MySQL - can't really find a solid workaround as of yet. In a couple cases I was able to retry the operation and it went through, but that is rare. This one is a really frustrating issue.

Re: Getting error when adding grafana to ambari ?

Expert Contributor

@Tom Stewart This could be an issue with default mysql-connector version available with centos repos: 5.17. We have seen other problems with this version and c3p0 connection pool. Although the connection pool issue is unrelated to the sequence number generation, it is the definitely worthwhile upgrading the connector to a newer version and see if this repros.

Don't have an account?
Coming from Hortonworks? Activate your account here