Support Questions

Find answers, ask questions, and share your expertise

Register failed

avatar
Explorer

i deployed the ambari i got this:

==========================
Creating target directory...
==========================

Command start time 2017-05-26 15:58:41

Connection to slave1.xdata-b4.com closed.
SSH command execution finished
host=slave1.xdata-b4.com, exitcode=0
Command end time 2017-05-26 15:58:41

==========================
Copying common functions script...
==========================

Command start time 2017-05-26 15:58:41

scp /usr/lib/python2.6/site-packages/ambari_commons
host=slave1.xdata-b4.com, exitcode=0
Command end time 2017-05-26 15:58:41

==========================
Copying OS type check script...
==========================

Command start time 2017-05-26 15:58:41

scp /usr/lib/python2.6/site-packages/ambari_server/os_check_type.py
host=slave1.xdata-b4.com, exitcode=0
Command end time 2017-05-26 15:58:41

==========================
Running OS type check...
==========================

Command start time 2017-05-26 15:58:41
Cluster primary/cluster OS family is ubuntu14 and local/current OS family is ubuntu14

Connection to slave1.xdata-b4.com closed.
SSH command execution finished
host=slave1.xdata-b4.com, exitcode=0
Command end time 2017-05-26 15:58:41

==========================
Checking 'sudo' package on remote host...
==========================

Command start time 2017-05-26 15:58:41
sudo						install

Connection to slave1.xdata-b4.com closed.
SSH command execution finished
host=slave1.xdata-b4.com, exitcode=0
Command end time 2017-05-26 15:58:41

==========================
Copying repo file to 'tmp' folder...
==========================

Command start time 2017-05-26 15:58:41

scp /etc/apt/sources.list.d/ambari.list
host=slave1.xdata-b4.com, exitcode=0
Command end time 2017-05-26 15:58:41

==========================
Moving file to repo dir...
==========================

Command start time 2017-05-26 15:58:41

Connection to slave1.xdata-b4.com closed.
SSH command execution finished
host=slave1.xdata-b4.com, exitcode=0
Command end time 2017-05-26 15:58:41

==========================
Changing permissions for ambari.repo...
==========================

Command start time 2017-05-26 15:58:41

Connection to slave1.xdata-b4.com closed.
SSH command execution finished
host=slave1.xdata-b4.com, exitcode=0
Command end time 2017-05-26 15:58:41

==========================
Update apt cache of repository...
==========================

Command start time 2017-05-26 15:58:41
0% [Working]
            
Get:1 http://10.90.2.36 Ambari InRelease [3,187 B]

            
100% [1 InRelease 3,187 B/3,187 B 100%]
                                       
100% [Working]
              
100% [1 InRelease gpgv 3,187 B]
                               
Ign http://10.90.2.36 Ambari InRelease

                               
100% [Working]
              
Ign http://10.90.2.36 Ambari/main amd64 Packages/DiffIndex

100% [Working]
              
Hit http://10.90.2.36 Ambari/main amd64 Packages

100% [Working]
              
Ign http://10.90.2.36 Ambari/main Translation-en_US

100% [Working]
              
100% [Packages 1,927 B] [Waiting for headers]
                                             
Ign http://10.90.2.36 Ambari/main Translation-en

                                             
100% [Packages 1,927 B]
                       
100% [Working]
              
Fetched 3,187 B in 0s (28.4 kB/s)

Reading package lists... 0%

Reading package lists... 0%

Reading package lists... 0%

Reading package lists... 0%

Reading package lists... 40%

Reading package lists... Done

W: GPG error: http://10.90.2.36 Ambari InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B9733A7A07513CAD
W: Duplicate sources.list entry http://10.90.2.36/ambari-2.2.0.0/ubuntu14/2.2.0.0-1310/ Ambari/main amd64 Packages (/var/lib/apt/lists/10.90.2.36_ambari-2.2.0.0_ubuntu14_2.2.0.0-1310_dists_Ambari_main_binary-amd64_Packages)

Connection to slave1.xdata-b4.com closed.
SSH command execution finished
host=slave1.xdata-b4.com, exitcode=0
Command end time 2017-05-26 15:58:42

==========================
Copying setup script file...
==========================

Command start time 2017-05-26 15:58:42

scp /usr/lib/python2.6/site-packages/ambari_server/setupAgent.py
host=slave1.xdata-b4.com, exitcode=0
Command end time 2017-05-26 15:58:42

==========================
Running setup agent script...
==========================

Command start time 2017-05-26 15:58:42
('                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
</body>
</html>

WARNING 2017-05-26 07:58:51,415 Controller.py:198 -  Sleeping for 16 seconds and then trying again 
', None)
('                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
</body>
</html>

WARNING 2017-05-26 07:58:51,415 Controller.py:198 -  Sleeping for 16 seconds and then trying again 
', None)

Connection to slave1.xdata-b4.com closed.
SSH command execution finished
host=slave1.xdata-b4.com, exitcode=0
Command end time 2017-05-26 15:58:53

Registering with the server...

and the ambari-server log shows:

26 May 2017 16:44:30,474 WARN [qtp-ambari-agent-94] ServletHandler:563 - /agent/v1/register/slave1.xdata-b4.com javax.persistence.RollbackException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(255) Error Code: 0 Call: INSERT INTO hosts (host_id, cpu_count, cpu_info, discovery_status, host_attributes, host_name, ipv4, ipv6, last_registration_time, os_arch, os_info, os_type, ph_cpu_count, public_host_name, rack_info, total_mem) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) bind => [16 parameters bound] Query: InsertObjectQuery(org.apache.ambari.server.orm.entities.HostStateEntity@f0d2dee5) at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:157) at

Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(255) Error Code: 0 Call: INSERT INTO hosts (host_id, cpu_count, cpu_info, discovery_status, host_attributes, host_name, ipv4, ipv6, last_registration_time, os_arch, os_info, os_type, ph_cpu_count, public_host_name, rack_info, total_mem) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) bind => [16 parameters bound] Query: InsertObjectQuery(org.apache.ambari.server.orm.entities.HostStateEntity@f0d2dee5) at \

Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(255) at \

1 ACCEPTED SOLUTION

avatar
Master Mentor

@white wartih

We can try finding out which data is becoming unexpectedly large by running the ambari agent in debug mode. For that we can edit the following file "/etc/ambari-agent/conf/ambari-agent.ini" and edit the following line to DEBUG:

loglevel=INFO

Change it as following:

loglevel=DEBUG

.

Then when we try to restart ambari agent then it should show the agent registration request (JSON Data).

We can grep the following entry:

# ambari-agent stop
# ambari-agent start
# grep 'Registering with' /var/log/ambari-agent/ambari-agent.log.*

.

View solution in original post

4 REPLIES 4

avatar
Master Mentor

@white wartih

hosts table of ambari DB has 255 column size for different columns which is OK in most scenarios. However in your case looks like some host specific data is too large.

In an other thread one user reported similar issue when the MAC address was being generated in junk (too large) , Can you please check:

https://community.hortonworks.com/questions/58142/postgres-error-value-too-long-for-type-character-v...

.

avatar
Master Mentor

@white wartih

We can try finding out which data is becoming unexpectedly large by running the ambari agent in debug mode. For that we can edit the following file "/etc/ambari-agent/conf/ambari-agent.ini" and edit the following line to DEBUG:

loglevel=INFO

Change it as following:

loglevel=DEBUG

.

Then when we try to restart ambari agent then it should show the agent registration request (JSON Data).

We can grep the following entry:

# ambari-agent stop
# ambari-agent start
# grep 'Registering with' /var/log/ambari-agent/ambari-agent.log.*

.

avatar
Explorer

thank you very much ! it turns out that our company's network is running in a wrong way.and we can reach "169.254.****", and we get a public_host_name which is a strange html,this html is too long for the var "public_host_name". In the situation we speculate,this address could not be reached.and it throws an exception to make the var getting the local host.too strange to understand T T

the file's location:

/usr/lib/python2.6/site-packages/ambari_agent/hostname.py

method name: public_name

avatar
Master Mentor