Exception with registerDataFileAll service

36 views
Skip to first unread message

Thanh Thanh Le

unread,
Sep 13, 2018, 9:08:16 AM9/13/18
to Dataverse Users Community


Hi all,

I've just migrated from dataverse 4.8.6 to 4.9.1.

When I want to register all file PID endpoint in calling the admin registerDataFileAll service, I have 0 file registered, with the following error in the glassfish logs :


[2018-09-13T14:16:38.677+0200] [glassfish 4.1] [WARNING] [AS-EJB-00056] [javax.enterprise.ejb.container] [tid: _ThreadID=32 _ThreadName=http-listener-1(5)] [timeMillis: 1536840998677] [levelValue: 900] [[
  A system exception occurred during an invocation on EJB PrivateUrlServiceBean, method: public edu.harvard.iq.dataverse.authorization.users.PrivateUrlUser edu.harvard.iq.dataverse.privateurl.PrivateUrlServiceBean.getPrivateUrlUserFromToken(java.lang.String)]]

[2018-09-13T14:16:38.677+0200] [glassfish 4.1] [WARNING] [] [javax.enterprise.ejb.container] [tid: _ThreadID=32 _ThreadName=http-listener-1(5)] [timeMillis: 1536840998677] [levelValue: 900] [[

javax.ejb.TransactionRolledbackLocalException: Client's transaction aborted
        at com.sun.ejb.containers.EJBContainerTransactionManager.useClientTx(EJBContainerTransactionManager.java:357)
        at com.sun.ejb.containers.EJBContainerTransactionManager.preInvokeTx(EJBContainerTransactionManager.java:251)
        at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:4524)
        at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1986)
        at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:210)
        at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
        at com.sun.proxy.$Proxy202.getPrivateUrlUserFromToken(Unknown Source)
        at edu.harvard.iq.dataverse.privateurl.__EJB31_Generated__PrivateUrlServiceBean__Intf____Bean__.getPrivateUrlUserFromToken(Unknown Source)
        at edu.harvard.iq.dataverse.api.AbstractApiBean.findUserOrDie(AbstractApiBean.java:348)
        at edu.harvard.iq.dataverse.api.Admin.registerDataFileAll(Admin.java:1049)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at.....

I've check in the database, in the RoleAssignment table, there is no entry with the api token. 
I've missed something before calling this service ?

Thanks in advance,
Thanh Thanh

Philip Durbin

unread,
Sep 14, 2018, 8:44:11 AM9/14/18
to dataverse...@googlegroups.com
This a strange problem. I'm not sure what registering PIDs for files has to do with Private URLs but let say a couple things.

First, the column on the "roleassignment"[1] table is called "privateurltoken", which is different than an API token but can be passed to an API endpoint as if it's a API token. API tokens have their own table called "apitoken". I'm not sure if this detail matters at all.

The other thing I'd like to mention is that instead of "registerDataFileAll" it's possible to register a single data file. This doesn't seem to be documented but the code for "registerDataFile" for 4.9.1 (which you said you're running) can be found at https://github.com/IQSS/dataverse/blob/v4.9.1/src/main/java/edu/harvard/iq/dataverse/api/Admin.java#L1017

I should note, however, that this code was revisited at https://github.com/IQSS/dataverse/issues/4778

Honestly, it might be best for you to email sup...@dataverse.org so someone can help you work through this. The solution could be summarized for the list.

I hope this helps,

Phil


--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-commu...@googlegroups.com.
To post to this group, send email to dataverse...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/19aeb0eb-330a-4569-be13-084e72f169df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Jim Myers

unread,
Sep 14, 2018, 9:04:34 AM9/14/18
to Dataverse Users Community
Phil,
The findUserOrDie() call used in this method first checks for a PrivateUrl before testing the incoming key as  user API key (via findAuthenticatedUserOrDie()). Hopefully sup...@dataverse.org can figure out the specific issue here, but it probably makes sense for calls that work on multiple objects (where a PrivateUrl can't work since it is tied to one object) to just call findAuthenticatedUserOrDie() directly.

-- Jim
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.

Philip Durbin

unread,
Sep 14, 2018, 9:13:35 AM9/14/18
to dataverse...@googlegroups.com
Yes, excellent point. findAuthenticatedUserOrDie would be better in this case.

To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-commu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-commu...@googlegroups.com.

To post to this group, send email to dataverse...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Thanh Thanh Le

unread,
Sep 14, 2018, 9:43:21 AM9/14/18
to Dataverse Users Community
Hi,

Thanks for your suggestion, Phillip and Jim.

I'll contact dataverse support directly to ask for help ...

Best regards,

Thanh Thanh
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages