Support Questions

Find answers, ask questions, and share your expertise

Exception in Main Thread - Atlas Service Exception

avatar
Rising Star

I am following the tutorial: http://atlas.incubator.apache.org/InstallationSteps.html for installing an embedded hbase and solr configuration for atlas. I have built and installed as the steps suggest in the tutorial above and when I start the server using command bin/atlas-start.py I get the following:

hduser@ubuntu:~/atlas/distro/target/apache-atlas-0.8-incubating-SNAPSHOT-bin/apache-atlas-0.8-incubating-SNAPSHOT$ bin/atlas_start.py

configured for local hbase.

hbase started.

configured for local solr.

solr started. setting up solr collections...

Apache Atlas Server started!!!

When I try to run the command bin/quick_start.py to add sample model and data I am getting the following error:

hduser@ubuntu:~/atlas/distro/target/apache-atlas-0.8-incubating-SNAPSHOT-bin/apache-atlas-0.8-incubating-SNAPSHOT$ bin/quick_start.py

Enter username for atlas :- bilal

Enter password for atlas :- bilal

Creating sample types:

Exception in thread "main" org.apache.atlas.AtlasServiceException: Metadata service API org.apache.atlas.AtlasBaseClient$APIInfo@35612e7c failed with status 401 (Unauthorized) Response Body (<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>Error 401 Username not found.bilal</title>

</head>

<body><h2>HTTP ERROR 401</h2>

<p>Problem accessing /api/atlas/v2/types/typedefs/. Reason:

<pre> Username not found.bilal</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>

</html>

)

at org.apache.atlas.AtlasBaseClient.callAPIWithResource(AtlasBaseClient.java:327) at

org.apache.atlas.AtlasBaseClient.callAPI(AtlasBaseClient.java:419) at

org.apache.atlas.AtlasTypedefClientV2.createAtlasTypeDefs(AtlasTypedefClientV2.java:147) at

org.apache.atlas.examples.QuickStartV2.createTypes(QuickStartV2.java:206) at

org.apache.atlas.examples.QuickStartV2.runQuickstart(QuickStartV2.java:153) at

org.apache.atlas.examples.QuickStartV2.main(QuickStartV2.java:138)

No sample data added to Apache Atlas Server.

Can anyone kindly suggest what is the way around? Any help will be highly appreciated! Kindly find the logs here: atlas-logs-exception-in-main-thread.txt

1 ACCEPTED SOLUTION

avatar

@Bilal Arshad

This error is due to username:bilal not recognized by Atlas. If you want to use the default username that comes with atlas bits then please use username as admin and password as admin.

If you want to create a user for atlas then please add the username and password details to user-credentails.properties file. Please refer below.

https://github.com/apache/incubator-atlas/blob/master/distro/src/conf/users-credentials.properties

#username=group::sha256-password
admin=ADMIN::8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
rangertagsync=RANGER_TAG_SYNC::e3f67240f5117d1753c940dae9eea772d36ed5fe9bd9c94a300e40413f1afb9d

The default users that comes with atlas distro is admin and rangertagsync.

The same information can be found in this wiki: http://atlas.incubator.apache.org/Authentication-Authorization.html

Please dont forget to restart atlas after adding new user to the properties file.

View solution in original post

5 REPLIES 5

avatar

@Bilal Arshad

This error is due to username:bilal not recognized by Atlas. If you want to use the default username that comes with atlas bits then please use username as admin and password as admin.

If you want to create a user for atlas then please add the username and password details to user-credentails.properties file. Please refer below.

https://github.com/apache/incubator-atlas/blob/master/distro/src/conf/users-credentials.properties

#username=group::sha256-password
admin=ADMIN::8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
rangertagsync=RANGER_TAG_SYNC::e3f67240f5117d1753c940dae9eea772d36ed5fe9bd9c94a300e40413f1afb9d

The default users that comes with atlas distro is admin and rangertagsync.

The same information can be found in this wiki: http://atlas.incubator.apache.org/Authentication-Authorization.html

Please dont forget to restart atlas after adding new user to the properties file.

avatar
Rising Star

Yes it did work and added the sample data and entities to the server! Thank you so much for the suggestions!

Using username admin and password admin did work! 🙂

avatar
Rising Star

Also when I try to run the following command

curl -v <a href="http://localhost:21000/api/atlas/admin/version">http://localhost:21000/api/atlas/admin/version</a>

to check that the server is running and its version it is giving me the following error:

* Hostname was NOT found in DNS cache

* Trying 127.0.0.1...

* Connected to localhost (127.0.0.1) port 21000 (#0)

> GET /api/atlas/admin/version HTTP/1.1

> User-Agent: curl/7.35.0

> Host: localhost:21000

> Accept: */*

>

< HTTP/1.1 401 Full authentication is required to access this resource

< Date: Wed, 08 Feb 2017 11:14:58 GMT < Set-Cookie: ATLASSESSIONID=154eke7lzmtrf1vhnfhxd5ivml;Path=/;HttpOnly

< X-Frame-Options: DENY

< WWW-Authenticate: Basic realm="atlas.com" < Content-Type: text/html; charset=ISO-8859-1

< Cache-Control: must-revalidate,no-cache,no-store < Content-Length: 399 * Server Jetty(9.2.12.v20150709) is not blacklisted

< Server: Jetty(9.2.12.v20150709)

<

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

<title>Error 401 Full authentication is required to access this resource</title>

</head>

<body><h2>HTTP ERROR 401</h2>

<p>Problem accessing /api/atlas/admin/version. Reason:

<pre> Full authentication is required to access this resource</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>

</html>

* Connection #0 to host localhost left intact

avatar

@Bilal Arshad

To access any API through command line you need authenticate with the Atlas.

For example: Since atlas comes with default users you can use the below command to get the version.

curl -v -u admin:admin http://localhost:21000/api/atlas/admin/version

In the above command username is admin and password is admin

avatar
Rising Star

The command mentioned above is showing the correct version, so thank you so much! 🙂