Skip to content

Instantly share code, notes, and snippets.

View awoods's full-sized avatar

Andrew Woods awoods

  • Harvard University
View GitHub Profile
@awoods
awoods / build-errors.txt
Created June 17, 2020 15:18
FedoraSearchIT Errors
[ERROR] Failures:
[ERROR] FedoraSearchIT.testSearchAllResources:78 results must contain all newly created resources: [http://localhost:36239/02af7084-b2d5-47e1-a2e5-69a592da0d6d, http://localhost:36239/04c6af52-55ed-46c4-8168-1265dd49ff30, http://localhost:36239/061b94dc-91ef-4280-befe-b283b7cc2ffb, http://localhost:36239/078f7233-5c63-4eb3-a460-710757e3fabd, http://localhost:36239/085c2cf3-04fe-40aa-b7c1-4fc1165fe491/x, http://localhost:36239/0867ce4a-310e-4689-86f7-f3b523d49a86, http://localhost:36239/0965b29d-d0b5-4db2-8384-8f7bab5c6e09, http://localhost:36239/0a915b66-1e66-4059-8e70-89c17a3633e8, http://localhost:36239/0d4b40f5-ebed-40a5-a91b-306f464a1155/x, http://localhost:36239/0ec3a8cd-4715-49a9-84ec-68d69d7dac81, http://localhost:36239/13e0254a-0688-4197-a76d-3b365e647bcd, http://localhost:36239/163b171d-a831-4a53-be46-812508bf62e8, http://localhost:36239/16fb6823-f072-4ea2-af7d-325f33ecdd33, http://localhost:36239/16fb6823-f072-4ea2-af7d-325f33ecdd33/ds1, http://localhost:36239/18031472-452d-4232
@awoods
awoods / stacktrace
Created May 11, 2020 14:29
f6-db-error
Caused by: org.springframework.dao.DuplicateKeyException: PreparedStatementCallback; SQL [INSERT INTO resources ( fedoraId, parent ) SELECT fedoraId, parent FROM transactionOperations WHERE transactionId = ? AND operation = 'add'Unique index or primary key violation: "PUBLIC.PRIMARY_KEY_2 ON PUBLIC.RESOURCES(FEDORAID) VALUES 44"; SQL statement:
INSERT INTO resources ( fedoraId, parent ) SELECT fedoraId, parent FROM transactionOperations WHERE transactionId = ? AND operation = 'add' [23505-200]; nested exception is org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Unique index or primary key violation: "PUBLIC.PRIMARY_KEY_2 ON PUBLIC.RESOURCES(FEDORAID) VALUES 44"; SQL statement:
INSERT INTO resources ( fedoraId, parent ) SELECT fedoraId, parent FROM transactionOperations WHERE transactionId = ? AND operation = 'add' [23505-200]
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:242)
at org.springframework.jdbc.support.Abstract
@awoods
awoods / file-length-error.txt
Created March 22, 2020 00:34
OCFL: File name too long
1
r = http://localhost:8080/rest/106c71ac-1588-4887-82c2-4f026c65d5fb
2
r = http://localhost:8080/rest/106c71ac-1588-4887-82c2-4f026c65d5fb/3577b855-09f1-4af4-abae-2032fc2de8b0
3
r = http://localhost:8080/rest/106c71ac-1588-4887-82c2-4f026c65d5fb/3577b855-09f1-4af4-abae-2032fc2de8b0/2198ff05-9d2e-4c76-88ff-55e8c94a73c1
4
r = http://localhost:8080/rest/106c71ac-1588-4887-82c2-4f026c65d5fb/3577b855-09f1-4af4-abae-2032fc2de8b0/2198ff05-9d2e-4c76-88ff-55e8c94a73c1/eb18be22-e652-4aed-a7d1-b69420f4d3a7
5
r = http://localhost:8080/rest/106c71ac-1588-4887-82c2-4f026c65d5fb/3577b855-09f1-4af4-abae-2032fc2de8b0/2198ff05-9d2e-4c76-88ff-55e8c94a73c1/eb18be22-e652-4aed-a7d1-b69420f4d3a7/2f45d862-0c6c-4047-95b4-07637b99347c
@awoods
awoods / issue-190-build.txt
Created March 12, 2020 17:20
scholars-discovery build output
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< edu.tamu.scholars:middleware >--------------------
[INFO] Building middleware 0.9.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ middleware ---
[INFO] Deleting /home/awoods/programming/java/apps/vivo/scholars-discovery/target
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.4:prepare-agent (prepare-agent) @ middleware ---
@awoods
awoods / vivo.all.log
Last active January 23, 2020 05:16
EditRequestDispatchController Log
2020-01-22 21:45:19,393 DEBUG [IsBlacklisted] cannot read blacklist directory /opt/tomcat/apache-tomcat-8.5.50/webapps/vivo/admin/selfEditBlacklist
2020-01-22 21:45:19,394 DEBUG [HasPermissionFactory] user permission sets: [http://vitro.mannlib.cornell.edu/ns/vitro/authorization#SELF_EDITOR]
2020-01-22 21:45:19,394 DEBUG [HasPermissionFactory] Permission URIs: [java:edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission#EditOwnAccount, java:edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission#PageViewablePublic, java:edu.cornell.mannlib.vitro.webapp.auth.permissions.DisplayByRolePermission#Public, java:edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission#PageViewableLoggedIn, java:edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission#UseBasicAjaxControllers, java:edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission#DoFrontEndEditing, java:edu.cornell.mannlib.vitro.webapp.auth.permissions.PublishByRolePermission#Public, java:edu.cornell.mannlib
@awoods
awoods / ocfl-must.txt
Created January 8, 2020 02:49
OCFL MUSTs
<p>
E0XX The <a>OCFL Object Root</a> MUST NOT contain files or directories other than those specified in the
following sections.
--
<p>
E001 The version declaration MUST be formatted according to the [[!NAMASTE]] specification. It MUST be a
file in the base directory of the OCFL Object Root giving the OCFL version in the filename. The filename
MUST conform to the pattern <code>T=dvalue</code>, where <code>T</code> MUST be 0, and <code>dvalue</code>
MUST be <code>ocfl_object_</code>, followed by the OCFL specification version number. The text contents of
E003 the file MUST be the same as <code>dvalue</code>, followed by a newline (<code>\n</code>).
@awoods
awoods / 1 JCR classes used by Fedora
Created February 22, 2019 21:01
Fedora dependencies on JCR and Modeshape
$ find . -name '*.java'|xargs grep 'javax.jcr'|grep import|grep -v Exception|grep -v static|grep -v test|cut -f2 -d:|sort|uniq
import javax.jcr.Binary;
import javax.jcr.Credentials;
import javax.jcr.NamespaceRegistry;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.nodetype.NodeType;
import javax.jcr.nodetype.NodeTypeManager;
import javax.jcr.nodetype.NodeTypeTemplate;
@awoods
awoods / 1 - HEAD OriginalResource
Last active November 18, 2018 23:43
Fedora Memento Interactions
# Request:
HEAD /fcrepo/rest/test HTTP/1.1
Host: 54.160.152.19:8080
User-Agent: curl/7.58.0
Accept: */*
Accept-Datetime: Tue, 20 Mar 2001 20:35:00 GMT
# Response:
HTTP/1.1 302 Found
Server: Apache-Coyote/1.1
@awoods
awoods / 1 - Commands to reproduce error scenario
Last active November 1, 2018 20:03
Indirect and DirectContainer attacks
The following scenario appears to still be a problem:
# Create three resources as admin
curl -i -u fedoraAdmin:fedoraAdmin -XPUT localhost:8080/rest/target
curl -i -u fedoraAdmin:fedoraAdmin -XPUT localhost:8080/rest/resource
curl -i -u fedoraAdmin:fedoraAdmin -XPUT localhost:8080/rest/write
# Make sure the /target resource is readonly
curl -i -u fedoraAdmin:fedoraAdmin -XPUT -H"Content-Type: text/turtle" --data-binary @acl-readonly.ttl localhost:8080/rest/target/fcr:acl
# Create execution dir
> mkdir /tmp/test
> mkdir /tmp/test/authenticators
# Place Junk.java in /tmp/test/authenticators
# Build Junk.java
> javac -sourcepath /your-path-to/Fedora-API-Test-Suite/src/main/java/ -cp /your-path-to/.m2/repository/io/rest-assured/rest-assured/3.1.0/rest-assured-3.1.0.jar Junk.java
# From Fedora-API-Test-Suite
> mvn clean install