Giter Site home page Giter Site logo

rwth-acis / las2peer Goto Github PK

View Code? Open in Web Editor NEW
51.0 15.0 13.0 51.44 MB

A Java-based decentralized framework for distributing community services in a peer-to-peer infrastructure.

Home Page: https://las2peer.org

License: Other

Shell 0.09% Java 90.79% Batchfile 0.03% HTML 0.14% JavaScript 1.09% TypeScript 7.86%
p2p restful-api encryption java microservices-architecture microservices las2peer

las2peer's Introduction

las2peer

Java CI with Gradle Gitter Javadoc

las2peer is a Java-based server framework for developing and deploying microservices in a distributed Peer-to-Peer (P2P) environment. It is developed by the Advanced Community Information Systems (ACIS) group at the Chair of Computer Science 5 (Information Systems & Databases), RWTH Aachen University, Germany. It's main focus lies on providing developers with a tool to easily develop and test their microservices and deploy them in a P2P network without having to rely on a centralized infrastructure. Communication between nodes is realized using the FreePastry library.

For more information on the core concepts of las2peer, please visit las2peer.org or read the las2peer Primer.

Service Development

This project contains las2peer itself. To develop a service for las2peer, please use the las2peer Template Project and follow the instructions of the project's ReadMe.

If you want to learn more about las2peer, please visit the las2peer Template Project's Wiki Page.

Preparations

Java

las2peer uses Java 17.

Build Dependencies

  • Gradle 7.2
  • Node 14 / npm

Project Structure

Modules

This repository contains three las2peer modules:

  • Core (/core)
  • REST Mapper (/restmapper)
  • Web Connector (/webconnector)

Each of them resides in its own subfolder, containing a build file providing the following tasks:

  • gradle jar will build the respective jar of the submodule. The jars will be stored in /export/jars.
  • gradle test will run the respective JUnit tests. Test reports will be stored in /build/reports.
  • gradle javadoc will create the JavaDocs for the respective submodule. The results will be stored in /export/javadoc.
  • gradle build runs all the tasks from above.
  • gradle publish<submodule>PublicationToMavenLocal publishes the respective submodule to the local maven repository. If you have set up a project to resolve dependencies from the local repository, you can conveniently test your local changes without pushing and publishing them.

Bundle

las2peer has a modular structure and many dependencies. However, most installations use all modules together, this is why we provide a bundle of all submodules and their dependencies in one single jar. The build script for the bundle can be found in /bundle.

The build script provides the following tasks:

  • gradle shadowJar will build the fat jar. The jar will be stored in /export/jars.
  • gradle publishBundlePublicationToMavenLocal publishes the bundle to the local maven repository.

Super Build Script

To make life easier for developers, this repository contains a build script for conveniently building multiple submodules.

  • gradle buildOnly will run publish<submodule>PublicationToMavenLocal on each submodule
  • gradle buildOnlyNoBundle will run publish<submodule>PublicationToMavenLocal on each submodule except for the bundle

Documentation

JavaDocs of the latest release can be found online:

CI

Every commit to the develop branch is built by GitHub actions and will be published as a snapshot to our Archiva. Releases are drafted from the master branch.

Importing

From Version 1.4.0 on, las2peer-bundle is available on Maven Central. To import las2peer into your project, add the following dependency to your build file:

implementation "io.github.rwth-acis.org.las2peer:las2peer-bundle:1.4.0"

As a repository, only Maven Central is required.

las2peer's People

Contributors

alexanderneumann avatar alexruppert avatar aran30 avatar arj-shahid avatar borisjov avatar dependabot[bot] avatar derjasper avatar erdzan12 avatar gordin avatar hojak avatar junpls avatar klamma avatar lakhoune avatar michi03 avatar mohamedalsherif avatar nmaster avatar pedela avatar phihos avatar phil-cd avatar slupczynskim avatar tcuje avatar thorekr avatar tjanson avatar tobasco99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

las2peer's Issues

[BUG] Overwhelming Bandwidth Traffic

  1. Summary - It has been noticed in several namespaces that the las2peer bootstrap deployments are using objectively too much traffic then they should, by several orders of magnitude. Something like 3-30MB/s are used in both receiving and sending, even when there are no services attached. When mobsos-data-processing is connected, then the bandwidth usage jumps even higher, even up to 60MB/s at times.
  2. Bug Details
    1. What? - Something is happening that is generating a lot of unnecessary traffic.
    2. Where? - Unknown.
    3. When?/How often? - Whenever a las2peer bootstrap is used.
    4. How?/Current state - A scenario where just the rwthacis/las2peer:v1.0.1 and rwthacis/monitored-geth-client:latest pods were run. In about one minute, the bandwith achieved about 1 MB/s and soon reached ~3 MB/s. This state lasted some time and after ~10 mins I noticed it was much lower (<1KB/s). When I started the mobsos-data-processing pod, the bandwidth jumped very quickly (<15s) to 30MB/s and after 10mins it fluctuated between 25-45MB/s. The bandwidth was mainly used up by the las2peer-bootstrap pod (>99.99%) while the other mentioned pods were running normally (<2KB/s in general, see image below). After the mobsos pod was shut down, the used bandwidth did not seem to drop at all (remained around 25-30MB/s).

image

  1. Fixed state - An explanation for this behaviour should be found and the excess messages being sent and received should be eliminated.

[BUG] Umlaute in Request Body causes weird symbol

  1. Summary - If the request body string contains any umlaute, these are turned into weird question mark symbols.
  2. Bug Details
    1. What? - Using the mini client to send a request with a stringified JSONObject as the object causes weird symbols to appear if the body contains umlaute.
    2. Where? - Do request with las2peer's Miniclient
      image

[BUG] Node frontend unresponsive after opt-in request

When requesting the first time to opt-in to the reputation system of las2peer or the re-request the faucet payout, the whole website is not accessible until the payout is completed .
This probably comes down that, when the payout process is processing and another user wants to access the node frontend some reputation system implementations are used and thus called, which can not run until the payout process is finished.
The webconnector does not seem to be the bottleneck as it can use multiple threads. https://github.com/rwth-acis/las2peer/blob/master/webconnector/src/main/java/i5/las2peer/connectors/webConnector/WebConnector.java#L126

[BUG] Cant access menu bar on mobile

  1. Summary - If you use the node frontend on your phone, there is no way to acces the menu to switch to other pages like status for example
  2. Bug Details - A detailed explanation of the issue, structured in subsections:
    1. What? - A short statement of the problem.
    2. Where? - las2peer node frontend. You can check las2peer.tech4comp.dbis.rwth-aachen.de on your phone

Check possible Ivy update from 2.4.0 to 2.5.0

las2peer currently uses version 2.4.0 of Ivy (which was released in 2014, see http://ant.apache.org/ivy).
In 2019 version 2.5.0 was released and we should check whether an update is useful and possible.

For switching the Ivy version that is used, most of the build.xml files need to be adjusted, therefore they contain a property:
<property name="ivy.install.version" value="2.5.0"/>

When running the target "get_deps" of lasp2peer/core, we get the following error:
central: bad module name found in https://repo1.maven.org/maven2/com/mockrunner/mockrunner-jdk1.3-j2ee1.3/0.4/mockrunner-jdk1.3-j2ee1.3-0.4.pom: expected='mockrunner-jdk1.3-j2ee1.3 found='mockrunner-j2ee1.3-jdk1.3'

Therefore updating Ivy is not trivial.

Performance for service API calls could be improved

When looking at the network timelines in the chrome developer tools even very simple service calls need 10-20ms to be processed (TTFB waiting time).

The attachment contains a very simple example method I'm using in the template project.
I call the service using normal ajax requests from a web page and both service and web page are running on localhost.

Comparable ajax calls to a file server yield TTFBs lower than 5ms.

So an average of 15ms for adding two numbers seems unreasonable high.
This is not critical, but in a micro-service-environment the waiting-times can add up quickly and become very noticable.

Maybe something can be optimized to make request processing faster?

[LAS-210] created by alexruppert

[BUG] Ethereum transactions fail

  1. Summary - My local las2peer node seems to connect to the Ethereum blockchain, running locally inside a docker container, correctly, but is unable to announce the service I'm trying to deploy. The specific setup is described in more detail below, however it closely follows the setup described here. The only notable difference (I can think of) is that this step of hosting the network configuration is not performed, since only one node is started. After starting the node and web-connector, the service is deployed to the network properly but the blockchain announcement fails with the following error message:
Error while announcing deployment: i5.las2peer.registry.exceptions.EthereumException: Failed to submit service deployment announcement (DEBUG: YouTubeProxy, org.web3j.protocol.exceptions.TransactionException: Transaction has failed with status: 0x0. Gas used: 31683. (not-enough gas?))

Other transactions are executed correctly, it is e.g., possible to create OIDC agents and they are stored correctly in both the las2peer network and on the blockchain, so this seems to be a problem specifically with the service registry.

  1. Bug Details - A detailed explanation of the issue, structured in subsections:
    1. What? - Service announcements of this service fail consistently with status 0x0.
    2. Where? - The problem seems to occur in the communication with the service registry deployed to the blockchain as part of the truffle migration.
    3. When?/How often? - Always, as a response to the following command startService('[email protected]')
    4. How?/Current state -
      1. Clone the las2peer-ethereum-cluster repo and build the ethereum image contained therein
      2. Comment out the command starting the las2peer node in the las2peer docker start script and build this image as well, since we only use this container to deploy the registry contracts. (Yes, this is terribly inefficient, since we are spending a lot of time building las2peer, although we are not using it, so feel free to uncomment more to safe some time)
      3. Start the ethereum container with environment variables "ETHEREUM_DATA_DIR=/root/.ethereum/devchain" and open ports 30303 (tcp+udp), 8545 (tcp), 8546 (tcp) and start the las2peer container with environment variable "LAS2PEER_ETH_HOST=127.0.0.1:8545". (If you want to be able to stop and restart the network, add the ETHEREUM_DATA_DIR and las2peer node-storage as volume mounts.)
      4. Wait for the las2peer container to finish the truffle migration and copy the file inside the las2peer container located at /app/las2peer/etc/i5.las2peer.registry.data.RegistryConfiguration.properties to a local path.
      5. Clone this repository and build the latest las2peer version and copy the registry.properties file into the 'las2peer/etc' directory (either created manually, or upon first launching of the node).
      6. Clone my service repository, build the jar file, and copy it to the las2peer directory under e.g., 'core/lib', also copy the service.properties file into the 'las2peer/etc' directory.
      7. Deploy the consent registry script(s) to the blockchain. I do this by cloning the las2peer-registry-contracts (containing the truffle migration files needed for the las2peer registry), replacing the files inside the migrations directory with my own and running ./node_modules/.bin/truffle migrate 2>&1 | tee migration.log
      8. Copy the address stored in the thusly created migration.log file under the point ConsentRegistry > contract address: into the the service's property file
      9. Launch the las2peer node by executing the following command java --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED -cp "core/src/main/resources/:core/export/jars/*:restmapper/export/jars/*:webconnector/export/jars/*:core/lib/*:restmapper/lib/*:webconnector/lib/*" i5.las2peer.tools.L2pNodeLauncher --port 9080 --service-directory service --node-id-seed 1 --ethereum-mnemonic "differ employ cook sport clinic wedding melody column pave stuff oak price" startWebConnector "node=getNodeAsEthereumNode()" "registry=node.getRegistryClient()" "n=getNodeAsEthereumNode()" "r=n.getRegistryClient()" interactive
      10. Run the command startService('[email protected]')
  2. (Optional) Fixed state - Upon startup, the las2peer node logs the following:
[TX-NONCE@0xb5a66d27457af8be2a09f17add73c2ae46520e69] init to -1
Error creating agent
Cannot invoke "i5.las2peer.persistency.SharedStorage.fetchEnvelope(String, long)" because "this.pastStorage" is null
created smart contract wrapper with credentials:0xb5a66d27457af8be2a09f17add73c2ae46520e69
 contract ID:822232612
Using pastry property file etc/pastry.properties
loading storage...

I am not sure, but maybe the shared storage error relates to this issue somehow. This error does not occur when starting the las2peer node from the docker image. However, since the docker image builds an older version, not supporting the version of my service built with Java 17, I can unfortunately not use this node without first downgrading my build (which is why I uncommented the command in the start script and use a local node outside docker, instead).

I could also imagine that my method of deploying the consent registry contracts might be faulty. However, running the truffle migration from inside my registry contracts directory fails with the following error message:

Transaction: 0x9b3bfe107bd17f505ae6c1b267eadeb123d6868a70481209e817d5faf9dd1d69 exited with an error (status 0) after consuming all gas.
     Please check that the transaction:
     - satisfies all conditions set by Solidity `assert` statements.
     - has enough gas to execute the full transaction.
     - does not trigger an invalid opcode by other means (ex: accessing an array out of bounds).
Truffle v5.4.24 (core: 5.4.24)
Node v10.19.0

Therefore, I copy my scripts to the las2peer-registry-contracts repo and perform the truffle migration from there, which works.

[ENH] Asynchronous Requests

  1. Motivation - Since we have a peer to peer microservice infrastructure, several Web requests stacked together lead into long waiting times.

Request processing on the server works by default in a synchronous processing mode, which means that a client connection of a request is processed in a single I/O container thread

https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/async.html

  1. Specification - I played around with it a little bit and can confirm that requests are handled synchronously. We should enable async functionality at the webconnector. I also tried to use described functions:
@GET
    public void asyncGet(@Suspended final AsyncResponse asyncResponse) {
 
        new Thread(new Runnable() {
            @Override
            public void run() {
                String result = veryExpensiveOperation();
                asyncResponse.resume(result);
            }
 
            private String veryExpensiveOperation() {
                // ... very expensive operation
            }
        }).start();
    }

But they lead to 500 errors with no logs. Although using jersey 2.35 it won't work.
Could be worth exchanging the HTTP Server with a modern solution?
https://github.com/rwth-acis/las2peer/blob/master/webconnector/src/main/java/i5/las2peer/connectors/webConnector/WebConnector.java#L421-L425
and
https://github.com/rwth-acis/las2peer/blob/master/webconnector/src/main/java/i5/las2peer/connectors/webConnector/WebConnector.java#L455-L460

At least it worked when I tried the GrizzlyHttpServerFactory.createHttpServer(...), but this would need some small adjustments

  1. Finalised state - Asynchronous functions as described in 2 should work.

@lakhoune @fxjordan @FBasels @phil-cd does one of you know a better HTTP Server that we should use? At the moment the WebConnector uses JdkHttpServerFactory

[ENH] Overwrite service properties using environment variables

1. Motivation

It's quite common for docker containers to support configuration by environment variables. las2peer uses service specific .properties files for configuration, which is fine. If we want to overwrite the complete configuration, we can use custom Docker volumes and overwrite the whole configuration file.
However, it would be comfortable if we are also able to overwrite only single properties (e.g., a database URL). This could be done using special environment variables.

Example from NGINX config in docker-compose:

web:
  image: nginx
  ports:
   - "8080:80"
  environment:
   - NGINX_HOST=foobar.com
   - NGINX_PORT=80

5. Specification

The environment variables would be derived from the services class name and the field name in the class. Currently, the behavior is as follows:

  • Assume a class com.example.MyService with a field named myProperty.
  • las2peer searches for a file com.example.MyService.properties in certain directories
    private String findPropertyFile() {
  • If it exists, the value of the property myProperty in that file is used to initialize the myProperty field of the service object.

New behavior

First, the field value is resolved as before. Additionally, we check if there is an environment variable for the service property. If the variable exists, we overwrite the field value again.

There are different options for the naming style of the environment variables:

  • Use the full service class name, e.g., com_example_MyService_myProprty
  • Use only the simple class name, e.g, MyService_myProperty
  • Use one of the previous options, but in upper case, which is more common for environment variables, e.g., COM_EXAMPLE_MY_SERVICE_MY_PROPERTY or MY_SERVICE_MY_PROPERTY

7. Finalized state

For example, in the Gamification Framework, I'd be able to overwrite the database URL, which is specified in the file i5.las2peer.services.gamificationGameService.GamificationGameService.properties (property name jdbcUrl). I'd just need to define an environment variable as follows (docker compose syntax):

gamificationFramework:
  image: registry.tech4comp.dbis.rwth-aachen.de/rwthacis/gamification:latest
  ports:
   - "8080:8080"
  environment:
   - GAMIFICATION_GAME_SERVICE_JDBC_URL=jdbc:postgresql://localhost:5432/

[BUG] ResourceNotFoundException when requesting Resource with String[] or List<String> as attribute

  1. Summary - When deploying the Distributed Noracle Application to the developer las2peer network, a ResourceNotFoundException is throwd when calling an API Endpoint with a Object as Response, that has a String[] or List attribut. Locally, this problem does not occur.
  2. Bug Details
    1. Where? - In LoadedJarLibrary.java, when calling getResourceAsUrl(...). Can be reproduced with Noracle (https://noracle.tech4comp.dbis.rwth-aachen.de/). The user only needs to login. After that, the error can be seen in the network tab in the developer tools.
    2. When?/How often? - When requesting an Noracle (https://git.tech4comp.dbis.rwth-aachen.de/distributed-noracle/agents/{agentId}/spacesubscriptions), the Response is an object, that has a String[] attribute as member.

[BUG] Many BindExceptions when starting service

  1. Summary - When I try to start a las2peer service locally on my machine I get a lot of java.net.BindExceptions which ultimately result in an StackOverflowError.
  2. Bug Details
    1. What? - During startup, the application tries to bind to the port that is configured in the start script (9011), whch fails with a BindException. After that, it seems like the application tries to bind to all port numbers from 9012 to 11624 (see stack trace). Then, the application shows multiple times the same error SocketPastryNodeFactory: Could not bind on any ports!java.lang.StackOverflowError and finally crashes with a StackOverflowError.
    2. Where? - When starting the service.
    3. When?/How often? - Initially when I cloned and tried to run the Requirements Bazaar backend, but also reproduced with the unmodified las2peer template project. On macOS 10.15.17 with JAVA_HOME set to a JDK 14.
    4. How?/Current state - Reproduce by:
  3. Fixed state - Even if the problem is caused, e.g., by a firewall misconfiguration, there should be a more developer-friendly error message / exception.

Error logs
Shown after executing ./bin/start_network.sh:

(base) felixjordan@Felixs-MBP las2peer-template-project % ./bin/start_network.sh
:rice.pastry.socket.internet:20211110.171233.587:Warning:  java.net.BindException: Address already in use:Felixs-MBP.fritz.box/192.168.178.74:9011
	at org.mpisws.p2p.transport.wire.UDPLayerImpl.openServerSocket(UDPLayerImpl.java:200)
	at org.mpisws.p2p.transport.wire.UDPLayerImpl.<init>(UDPLayerImpl.java:105)
	at org.mpisws.p2p.transport.wire.WireTransportLayerImpl.<init>(WireTransportLayerImpl.java:133)
	at org.mpisws.p2p.transport.wire.WireTransportLayerImpl.<init>(WireTransportLayerImpl.java:109)
	at org.mpisws.p2p.transport.wire.WireTransportLayerImpl.<init>(WireTransportLayerImpl.java:102)
	at rice.pastry.socket.SocketPastryNodeFactory.getWireTransportLayer(SocketPastryNodeFactory.java:458)
	at rice.pastry.socket.nat.rendezvous.RendezvousSocketPastryNodeFactory.getWireTransportLayer(RendezvousSocketPastryNodeFactory.java:443)
	at rice.pastry.socket.SocketPastryNodeFactory.getBottomLayers(SocketPastryNodeFactory.java:324)
	at rice.pastry.socket.SocketPastryNodeFactory.getNodeHandleAdapter(SocketPastryNodeFactory.java:351)
	at rice.pastry.transport.TransportPastryNodeFactory.nodeHandleHelper(TransportPastryNodeFactory.java:124)
	at rice.pastry.socket.SocketPastryNodeFactory.newNodeSelector(SocketPastryNodeFactory.java:1387)
	at rice.pastry.socket.nat.rendezvous.RendezvousSocketPastryNodeFactory.newNodeSelector(RendezvousSocketPastryNodeFactory.java:218)
	at rice.pastry.socket.nat.rendezvous.RendezvousSocketPastryNodeFactory.newNodeSelector(RendezvousSocketPastryNodeFactory.java:199)
	at rice.pastry.socket.internet.InternetPastryNodeFactory.verifyConnectivityThenMakeNewNode(InternetPastryNodeFactory.java:497)
	at rice.pastry.socket.internet.InternetPastryNodeFactory.newNodeSelector(InternetPastryNodeFactory.java:286)
	at rice.pastry.socket.SocketPastryNodeFactory$11.run(SocketPastryNodeFactory.java:1289)
	at rice.selector.SelectorManager.doInvocations(SelectorManager.java:443)
	at rice.selector.SelectorManager.run(SelectorManager.java:264)
:rice.pastry.socket.internet:20211110.171233.593:Warning:  java.net.BindException: Address already in use:Felixs-MBP.fritz.box/192.168.178.74:9012
	at org.mpisws.p2p.transport.wire.UDPLayerImpl.openServerSocket(UDPLayerImpl.java:200)
	at org.mpisws.p2p.transport.wire.UDPLayerImpl.<init>(UDPLayerImpl.java:105)
	at org.mpisws.p2p.transport.wire.WireTransportLayerImpl.<init>(WireTransportLayerImpl.java:133)
	at org.mpisws.p2p.transport.wire.WireTransportLayerImpl.<init>(WireTransportLayerImpl.java:109)
	at org.mpisws.p2p.transport.wire.WireTransportLayerImpl.<init>(WireTransportLayerImpl.java:102)
	at rice.pastry.socket.SocketPastryNodeFactory.getWireTransportLayer(SocketPastryNodeFactory.java:458)
	at rice.pastry.socket.nat.rendezvous.RendezvousSocketPastryNodeFactory.getWireTransportLayer(RendezvousSocketPastryNodeFactory.java:443)
	at rice.pastry.socket.SocketPastryNodeFactory.getBottomLayers(SocketPastryNodeFactory.java:324)
	at rice.pastry.socket.SocketPastryNodeFactory.getNodeHandleAdapter(SocketPastryNodeFactory.java:351)
	at rice.pastry.transport.TransportPastryNodeFactory.nodeHandleHelper(TransportPastryNodeFactory.java:124)
	at rice.pastry.socket.SocketPastryNodeFactory.newNodeSelector(SocketPastryNodeFactory.java:1387)
	at rice.pastry.socket.nat.rendezvous.RendezvousSocketPastryNodeFactory.newNodeSelector(RendezvousSocketPastryNodeFactory.java:218)
	at rice.pastry.socket.nat.rendezvous.RendezvousSocketPastryNodeFactory.newNodeSelector(RendezvousSocketPastryNodeFactory.java:199)
	at rice.pastry.socket.internet.InternetPastryNodeFactory.verifyConnectivityThenMakeNewNode(InternetPastryNodeFactory.java:497)
	at rice.pastry.socket.internet.InternetPastryNodeFactory.newNodeSelector(InternetPastryNodeFactory.java:286)
	at rice.pastry.socket.SocketPastryNodeFactory$11.run(SocketPastryNodeFactory.java:1289)
	at rice.selector.SelectorManager.doInvocations(SelectorManager.java:443)
	at rice.selector.SelectorManager.run(SelectorManager.java:264)
...
... ### continues until port 11624 ###...
...
:rice.pastry.socket.internet:20211110.171234.440:Warning:  java.net.BindException: Address already in use:Felixs-MBP.fritz.box/192.168.178.74:11624
	at org.mpisws.p2p.transport.wire.UDPLayerImpl.openServerSocket(UDPLayerImpl.java:200)
	at org.mpisws.p2p.transport.wire.UDPLayerImpl.<init>(UDPLayerImpl.java:105)
	at org.mpisws.p2p.transport.wire.WireTransportLayerImpl.<init>(WireTransportLayerImpl.java:133)
	at org.mpisws.p2p.transport.wire.WireTransportLayerImpl.<init>(WireTransportLayerImpl.java:109)
	at org.mpisws.p2p.transport.wire.WireTransportLayerImpl.<init>(WireTransportLayerImpl.java:102)
	at rice.pastry.socket.SocketPastryNodeFactory.getWireTransportLayer(SocketPastryNodeFactory.java:458)
	at rice.pastry.socket.nat.rendezvous.RendezvousSocketPastryNodeFactory.getWireTransportLayer(RendezvousSocketPastryNodeFactory.java:443)
	at rice.pastry.socket.SocketPastryNodeFactory.getBottomLayers(SocketPastryNodeFactory.java:324)
	at rice.pastry.socket.SocketPastryNodeFactory.getNodeHandleAdapter(SocketPastryNodeFactory.java:351)
	at rice.pastry.transport.TransportPastryNodeFactory.nodeHandleHelper(TransportPastryNodeFactory.java:124)
	at rice.pastry.socket.SocketPastryNodeFactory.newNodeSelector(SocketPastryNodeFactory.java:1387)
	at rice.pastry.socket.nat.rendezvous.RendezvousSocketPastryNodeFactory.newNodeSelector(RendezvousSocketPastryNodeFactory.java:218)
	at rice.pastry.socket.nat.rendezvous.RendezvousSocketPastryNodeFactory.newNodeSelector(RendezvousSocketPastryNodeFactory.java:199)
	at rice.pastry.socket.internet.InternetPastryNodeFactory.verifyConnectivityThenMakeNewNode(InternetPastryNodeFactory.java:497)
	at rice.pastry.socket.internet.InternetPastryNodeFactory.newNodeSelector(InternetPastryNodeFactory.java:286)
	at rice.pastry.socket.SocketPastryNodeFactory$11.run(SocketPastryNodeFactory.java:1289)
	at rice.selector.SelectorManager.doInvocations(SelectorManager.java:443)
	at rice.selector.SelectorManager.run(SelectorManager.java:264)
:rice.pastry.socket.internet:20211110.171234.446:SEVERE: SocketPastryNodeFactory: Could not bind on any ports!java.lang.StackOverflowError
:rice.pastry.socket.internet:20211110.171234.447:SEVERE: SocketPastryNodeFactory: Could not bind on any ports!java.lang.StackOverflowError
:rice.pastry.socket.internet:20211110.171234.447:SEVERE: SocketPastryNodeFactory: Could not bind on any ports!java.lang.StackOverflowError
:rice.pastry.socket.internet:20211110.171234.447:SEVERE: SocketPastryNodeFactory: Could not bind on any ports!java.lang.StackOverflowError
...
...
Exception in thread "main" java.lang.StackOverflowError
	at java.base/java.lang.invoke.MethodHandle.<init>(MethodHandle.java:479)
	at java.base/java.lang.invoke.BoundMethodHandle.<init>(BoundMethodHandle.java:56)
	at java.base/java.lang.invoke.BoundMethodHandle$Species_LL.<init>(java/lang/invoke/BoundMethodHandle$Species_LL)
	at java.base/java.lang.invoke.BoundMethodHandle$Species_LL.make(java/lang/invoke/BoundMethodHandle$Species_LL)
	at java.base/java.lang.invoke.BoundMethodHandle$Species_LL.copyWith(java/lang/invoke/BoundMethodHandle$Species_LL)
	at java.base/java.lang.invoke.MethodHandle.viewAsType(MethodHandle.java:1646)
	at java.base/java.lang.invoke.MethodHandleImpl.makePairwiseConvertByEditor(MethodHandleImpl.java:280)
	at java.base/java.lang.invoke.MethodHandleImpl.makePairwiseConvert(MethodHandleImpl.java:259)
	at java.base/java.lang.invoke.MethodHandleImpl.makePairwiseConvert(MethodHandleImpl.java:376)
	at java.base/java.lang.invoke.MethodHandle.asTypeUncached(MethodHandle.java:881)
	at java.base/java.lang.invoke.MethodHandle.asType(MethodHandle.java:865)
	at java.base/java.lang.invoke.StringConcatFactory.doStringConcat(StringConcatFactory.java:688)
	at java.base/java.lang.invoke.StringConcatFactory.makeConcatWithConstants(StringConcatFactory.java:602)
	at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:99)
	at java.base/java.lang.invoke.CallSite.makeSite(CallSite.java:315)
	at java.base/java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:259)
	at java.base/java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:249)
	at rice.pastry.socket.SocketPastryNodeFactory.newNode(SocketPastryNodeFactory.java:1245)
	at rice.pastry.socket.SocketPastryNodeFactory.newNode(SocketPastryNodeFactory.java:1237)
	at rice.pastry.socket.SocketPastryNodeFactory.newNode(SocketPastryNodeFactory.java:1237)
	at rice.pastry.socket.SocketPastryNodeFactory.newNode(SocketPastryNodeFactory.java:1237)
	at rice.pastry.socket.SocketPastryNodeFactory.newNode(SocketPastryNodeFactory.java:1237)
	at rice.pastry.socket.SocketPastryNodeFactory.newNode(SocketPastryNodeFactory.java:1237)
...


[BUG] "Passphrase Invalid" error when logging in

  1. Summary
    When using a service with a webconnector and bootstrapping another service to it with its own webconnector, sometimes the login will work on one service's frontend but not on the other, resulting in the "passphrase invalid" error. Making the user unable to use the service linked to the node.
  2. Bug Details - A detailed explanation of the issue, structured in subsections:
    1. What? - Logging in as a user is sometimes not possible and the error "passphrase invalid" appears.
    2. Where? - Node frontend learning layers login.
    3. When?/How often? - After trying for some time, I did not manage to consecutively reproduce the error. From my perspective it also seemed a bit non-deterministic.
    4. How? - Start a node with a service. Go to the node frontend and log in using learning layers. Start another node which will get bootstrapped to the firstnode but which will have its own webconnector running (Note that when I tested it, both webconnectors were running on 127.0.0.1 but had different ports).

As both nodes were running on 127.0.0.1, I thought that maybe the bug would be linked to the cookies generated from the learning layers login. But, after playing for a while with the cookies as well, I still did not manage to reproduce the bug in a consecutive manner.

As this bug was not noticed before and I myself did not manage to reproduce it after trying for some time, I'd say that it has not the highest priority in terms of issues.

[ENH] Make username claim configureable on a oidc provider basis

Motivation

The authentication manager takes a strong assumption on the preferred_username.
It requires this claim to be present and unique. Which both isn't safe to assume.
Some OIDC providers, such as google, do not provide this claim.

Specification

Extend the configuration options on the oidc providers to allow to specify the claim which should be used for the agents username.

This might be inspired by the parameters requested by synapse.

Finalised state

Login with other identity providers than keycloak should be possible.

[BUG] Service Alias Collision Error

  1. Summary - It sometimes happens that after restarting a service, it won't start anymore due to a service alias collision error. It seems that some metadata envelopes are fetched, but the actual service envelope is not found, and when wanting to upload the new service, it leads to a collision.
  2. Bug Details
    1. What? - Network thinks service is already running and does not let service get started.
    2. Where? - Servicestart in cluster, using ethereum and shared storage.
    3. When?/How often? - Not that often. Suspicion that this happens when one node, which is connected to the network, has no PVC, which then leads to inconsistencies.

[BUG] GroupAgentGenerator not useable anymore

  1. Summary - The las2peer-project-service uses the GroupAgentGenerator. Since las2peer v1.1.2 it cannot be used anymore, because the main method is not defined properly.
  2. Bug Details
    1. What? - Main method of GroupAgentGenerator should only have a String[] parameter. Otherwise it cannot be called.
    2. Where? - https://github.com/rwth-acis/las2peer/blob/40bf6e152f835a13fafcce89b3af53ffc891910f/core/src/main/java/i5/las2peer/tools/GroupAgentGenerator.java
    3. How?/Current state - Running the start_GroupAgentGenerator.sh in project-service (https://github.com/rwth-acis/las2peer-project-service/blob/develop/bin/start_GroupAgentGenerator.sh) is not working anymore.
  3. Fixed state - Either remove groupName parameter fully or put it inside the String[] parameter.

[ENH] Support authentication only via OIDC

Motivation

Services which do not make use of extended agent features, such as the requirements bazaar, currently employ the anti pattern of shared, reused passwords which are known to any service which got an access token from the same identity provider.

Furthermore sending the access token in a separate header could become another thread to the users privacy as http agent mechanisms to strip the auhorization header when following redirects are ineffective.

Ideally, to decrease integration efforts and to encourage the use of standard libraries, authentication should be possible through a regular oidc flow, without the need for additional tweaks and headers.

Problem storing Ethereum agents

Sometimes the Blockchain gets out of sync with the number of transactions for a wallet and new entries fail.
I think it is related to faulty contracts that just fail.. (e.g. service registration of services which are not compatible with the current blockchain implementation).

As a workaround we have different wallets for the contract types (faulty ones like service registrations and user related contracts)
In our setup:

  • 0xb5a66d27457af8be2a09f17add73c2ae46520e69: Is the default wallet
  • 0x547d11bb78efd735f562cfeeb48d28854c98e98d: For service registrations
  • 0x00a0d82533ec22ba23f8b894cda1873def8342e3: For everything else (this one should be working)
> eth.getTransactionCount("0xb5a66d27457af8be2a09f17add73c2ae46520e69")
8
> eth.getTransactionCount("0x547d11bb78efd735f562cfeeb48d28854c98e98d")
30092
> eth.getTransactionCount("0x00a0d82533ec22ba23f8b894cda1873def8342e3")
69

related console log:

Failed to register EthereumAgent; error: i5.las2peer.registry.exceptions.EthereumException: java.util.concurrent.ExecutionException: org.web3j.tx.exceptions.ContractCallException: Empty value (0x) returned from contract
i5.las2peer.api.security.AgentException: Problem storing Ethereum agent
	at i5.las2peer.p2p.EthereumNode.storeAgent(EthereumNode.java:190)
	at i5.las2peer.connectors.webConnector.util.AuthenticationManager.createNewOidcAgent(AuthenticationManager.java:292)
	at i5.las2peer.connectors.webConnector.util.AuthenticationManager.authenticateOIDC(AuthenticationManager.java:152)
	at i5.las2peer.connectors.webConnector.util.AuthenticationManager.authenticateAgent(AuthenticationManager.java:78)
	at i5.las2peer.connectors.webConnector.WebConnector.authenticateAgent(WebConnector.java:658)
	at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.authenticate(WebConnectorRequestHandler.java:173)
	at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.handle(WebConnectorRequestHandler.java:147)
	at i5.las2peer.connectors.webConnector.WebConnectorRequestHandler.handleGET(WebConnectorRequestHandler.java:119)
	at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
	at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
	at org.glassfish.jersey.jdkhttp.JdkHttpHandlerContainer.handle(JdkHttpHandlerContainer.java:161)
	at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
	at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)
	at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82)
	at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675)
	at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
	at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: i5.las2peer.registry.exceptions.EthereumException: java.util.concurrent.ExecutionException: org.web3j.tx.exceptions.ContractCallException: Empty value (0x) returned from contract
	at i5.las2peer.registry.ReadOnlyRegistryClient.usernameIsAvailable(ReadOnlyRegistryClient.java:179)
	at i5.las2peer.p2p.EthereumNode.registerAgentInBlockchain(EthereumNode.java:203)
	at i5.las2peer.p2p.EthereumNode.storeAgent(EthereumNode.java:186)
	... 37 more
Caused by: java.util.concurrent.ExecutionException: org.web3j.tx.exceptions.ContractCallException: Empty value (0x) returned from contract
	at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
	at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
	at i5.las2peer.registry.ReadOnlyRegistryClient.usernameIsAvailable(ReadOnlyRegistryClient.java:177)
	... 39 more
Caused by: org.web3j.tx.exceptions.ContractCallException: Empty value (0x) returned from contract
	at org.web3j.tx.Contract.executeCallSingleValueReturn(Contract.java:246)
	at org.web3j.tx.Contract.lambda$executeRemoteCallSingleValueReturn$1(Contract.java:313)
	at org.web3j.protocol.core.RemoteCall.send(RemoteCall.java:30)
	at org.web3j.utils.Async.lambda$run$26(Async.java:27)
	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626)
	... 3 more
Internal Server Error: OIDC agent creation failed

[BUG] Agent not found in registry

  1. Summary - When I try to login I get a 401 error, because my agent is not found in the ethereum blockchain
  2. Bug Details - A detailed explanation of the issue, structured in subsections:
    1. What? - data in blockchain does not match agent stored in shared storage!
    2. Where? - las2peer core/Ethereum Agent
    3. When?/How often? - Error occurs when the Agent is found in the shared storage but not in the ethereum blockchain
    4. How?/Current state - Well, I honestly don't know how that happened. If you have an existing agent and you would upgrade it to an ethereum agent shouldn't it be stored in the chain? Or should be there some import functionality of ethereum agents?
  3. (Optional) Fixed state - Create missing entry in the chain?
    https://github.com/rwth-acis/las2peer/blob/master/core/src/main/java/i5/las2peer/p2p/EthereumNode.java#L279

las2peer log:

OIDC sub found. Authenticating...
attempting login with id: OIDC_SUB-.... I removed my id :) 
User not found in registry
AgentException when trying to auth agent: User data in blockchain does not match agent stored in shared storage!

[ENH] Use javac from JAVA_HOME in gradle build

  1. Motivation - The gradle build files of the respective las2peer components define their own compile tasks, which call the java compiler (javac). This itself is fine, however depending on the context this can lead to unexpected problems which might be very hard to detect, since we don't use the javac binary from the JAVA_HOME directory, as one would expect. The resulting error looks like this:
> Task :core:compileJava FAILED
error: invalid source release: 17
Usage: javac <options> <source files>
  1. Specification - This should be rather easy to fix by replacing javac in the compile java task (here, here, and here ) with a reference to the JAVA_HOME variable. There are multiple ways to achieve this, discussed in this thread. Just take care that the build also still works if the variable isn't set.
  2. Finalised state - The las2peer build should then use the java compiler pointed to by the JAVA_HOME environment variable, if it is set.

[BUG] authenication request times out

  1. Summary - When trying to authenicate, the request times out
  2. Bug Details
    1. What? - I tried to login in on the dev network in the tech4comp cluster. I noticed that the request on las2peer/auth/login times out. When inspecting the network log of the browser I saw that the request to timed out. While observing the logs of the pod in the cluster, I observed the following:
    Storing envelope [email protected]#1 ...
     <-- received message:i5.las2peer.p2p.pastry.InfoResponseMessage@6ff7586b
     notifying!
     out of wait!
    
    1. Where? - This issue has been observed in the dev network
    2. How? - Login in on https://git.tech4comp.dbis.rwth-aachen.de/
  3. Fixed state - This has been observed after the network had to be restarted ( and nodestorage volume claim deleted)

[BUG] The filter has not been found error

Bug-related issues need to report how, when (how often) and where an issue occurs. To answer these questions, the following sections are defined:

Summary - After some while the error "The filter has not been found. Filter id:" appears. Currently it has to be seen if this error leads to a heap space error.
The error is mentioned on the web3j GitHub but no real solution has been proposed. Only a fix from a contributor who encountered the same problem. The proposed fix did not work for other who encountered the same problem.
image

Memory Leak on large number of incoming messages / RMI calls

java heap analysis shows that it's most likely due to byte[] or String allocations that aren't being garbage collected. byte[] is connected to decrypted/encrypted messages, while strings could be an indication of an unclosed stream in the ExecutionContext.invoke() method.

Needs further investigation. Once I switched mobsos-success-modeling to tini to avoid the zombie reaping problem, I was able to get the java heap and confirm that the app is leaking memory exponentially, but has not reached critical mass in my tests - but that might also be due to not enough time passing for it to have reached the 2GB limit.

Needs further investigation.

[LAS-471] created by mslupczynski

[ENH] Illegal reflective access operation Warning (Java Problem)

After upgrading las2peer's java version to 14, some new warnings popped up about "illegal reflective access operations" being made. These currently pop up 3 times during the build process of the las2peer-bundle and are caused by following classes:

Note that when starting a service, the warning caused by the FreePastry change will also pop up.
The warnings look like the following:

    [junit] WARNING: An illegal reflective access operation has occurred
    [junit] WARNING: Illegal reflective access by rice.p2p.util.XMLObjectOutputStream (file:/home/jenkins/.jenkins/workspace/las2peer%20Core/core/lib/FreePastry-3.0.0.jar) to field java.lang.Number.serialVersionUID
    [junit] WARNING: Please consider reporting this to the maintainers of rice.p2p.util.XMLObjectOutputStream
    [junit] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
    [junit] WARNING: All illegal access operations will be denied in a future release

The problem itself stems from Java 9's introduction of modules. More useful information concerning this warning can be found here:

Currently, these warnings do not break anything, but as mentioned in the warning, the illegal access may be denied in a future java version. Thus, something to keep in mind for a future upgrade of las2peer's java version.

LAS2peer Explanation in README

The README does not explicitly say what LAS2peer really is. Documentation in README should contain a section on that.

[BUG] Spaces in query parameters are discarded

  1. Summary - If you send a GET request to the service containing space (%20 url-encoded), then the service will simply ignore the query
  2. Bug Details
    1. What? - Using the latest las2peer version (currently 1.2.3). My service permits a user to enter a search term to look up surveys on a database. On the server, this parameter should be contained in @QueryParam("q") @DefaultValue("") String query. This works fine, unless a space character is included in the query parameter. The query parameter will in that case resort to the default value "".
    2. How?/Current state - I created a working example on the miniclient-issue branch of the template service . Clone the repo, checkout the branch and build the service. The echo test will fail

[ENH] Decrease the log level for logs from the blockchain to FINE

  1. Motivation - The blockchain observer tends to spam the logs a lot. This hinders debugging services and most messages just cannot be looked up which hinders debugging of services
  2. Specification - If those messages are only logged on FINE then services can set L2pLogger.setGlobalConsoleLevel(Level.INFO); and still see the message info logs

Unable to find IP for ISA

Sometimes las2peer nodes do not start properly:

Waiting for any bootstrap host to become available... Using pastry property file etc/pastry.properties ERROR: Unable to find IP for ISA tech4comp.dbis.rwth-aachen.de:31014 - returning null. Exception in thread "main" java.lang.NullPointerException  at rice.pastry.socket.internet.InternetPastryNodeFactory.(InternetPastryNodeFactory.java:153)  at i5.las2peer.p2p.PastryNodeImpl.launchSub(PastryNodeImpl.java:229)  at i5.las2peer.p2p.Node.launch(Node.java:562)  at i5.las2peer.tools.L2pNodeLauncher.start(L2pNodeLauncher.java:805)  at i5.las2peer.tools.L2pNodeLauncher.launchConfiguration(L2pNodeLauncher.java:967)  at i5.las2peer.tools.L2pNodeLauncher.main(L2pNodeLauncher.java:1123)

[LAS-470] created by neumann

[ENH] Upgrade Swagger Dependencies

The restmapper pulls in a rather dated release of io.swagger:swagger-jersey2-jaxrs (Nov 2017).

There are two potential ways to fix this:

  1. Upgrade to 1.6.2;
    The 1. release has seen a couple of updates (last in June 2020) and seems not to break too many things. This however could already provide a couple of improvements, mostly because jersey pulls in jackson and that version is authoritative fol all other projects. There have been a couple of CVEs, mostly with medium severity and related to potential denial of service attacks.

  2. Upgrade to Swagger Core 2
    This is a larger upgrade with probable impact on other services, as endpoint annotations have to be updated, but would provide the quite noteable milestone of OpenAPI 3.0 support.

Version Rereference. https://github.com/swagger-api/swagger-core#compatibility

Rename 'oidc_provider' Header (remove underscore)

The oidc_provider header contains an underscore. This seems to be allowed in HTTP, but so uncommon that Nginx needs a special configuration flag to allow for headers containing an underscore (https://dev.to/thesameeric/dont-use-underscores-in-your-http-headers-gfp).

In a recent bug, this caused a lot of extra work for me while find out why the OIDC provider was not set correctly. Sometimes, developers may even not know that a Nginx reverse proxy is running in front of their las2peer application and get strange behavior. Also, they might not be able to change the Nginx configuration in some cases.

Therefore, I'm proposing to rename the header to oidc-provider. The old header name can still be parsed for legacy reasons while we introduce the new header name.

public static final String OIDC_PROVIDER_KEY = "oidc_provider";

Review list of issues

Can we have a meeting on open las2peer issues or can someone start reviewing issues, if they are still relevant?

[BUG] Network crashes after a while

  1. Summary - After letting a network run for a while, it will crash with some "Thread-pool-..." error. To make it work again, the whole network needs to be restarted. Services are unusable during that time.
  2. Bug Details
    1. What? - Weird error occurs after a while, making bootstrap node not work anymore.
    2. Where? - In our main network on kubernetes.
    3. When?/How often? - Maybe after 4/5 days.
    4. How?/Current state - A possible for this to occur, is that maybe some threads in las2peer are not closed correctly, leading to an overflow of threads. Another guess would be that some services make too many requests, which leads to las2peer not being to create new threads for the barrage of requests.

image (14)

[BUG] ClassLoader problem with las2peer v1.2-SNAPSHOT

  1. Summary - The bug first encountered in a service that provides a method with a org.json.simple.JSONObject as a parameter. If another service tries to call this method via RMI, an error occurs and the method does not get executed (java.lang.ClassNotFoundException: org.json.simple.JSONObject).
  2. Bug Details
    1. What? - The class loader seems to be unable to load the JSONObject class in this case. However, when using JSONObject in other methods, no problem occurs. The problem is not only limited to the JSONObject class.
    2. Where? - The bug only seems to occur with the latest las2peer v1.2-SNAPSHOT version and Java 17.
    3. When?/How often? - In the case mentioned above: Everytime when the method is called via RMI.
    4. How?/Current state - Bootstrap two services and let one call a method inside the other service that uses a JSONObject parameter.
  3. Fixed state - RMI is working as usual again, i.e., also with JSONObject parameters.

This issue is related to: #100

[BUG] Missing validation of OIDC tokens

  1. Summary - Tokens are not validated in any way during agent authentication. Thus, a service accept access tokens that are issued for another service.

  2. Bug Details - A detailed explanation of the issue, structured in subsections:

    1. What? - Tokens from the OIDC provider are not validated, when authenticating an agent
    2. Where? - AuthenticationManager in the las2peer webconnector
    3. When?/How often? -
    4. How?/Current state - As far as I can see the token is only "validated" during the agent authentication (by requesting the userinfo from the OIDC provider) if the agent does not exist at the moment . However it is never checked if the token was issued to this service and not to a different one.

[BUG] Nonce synchronisation

The issue #70 was in general fixed by requesting the current nonce from the geth network before submitting a transaction.
However, when two user for example are trying to register themselves near simultaneously the same nonce will be used and thus one transaction will fail as only one transaction can be processed with one nonce, and thus that one nonce is "used up".
The other user will receive an error message.
Therefore, in a distributed environment as in the case of las2peer where one account can be used by different services to submit transactions, which can happen simultaneously the nonce in these situations must be synchronised.

Startup deadlocks in network synchronization

Since upgrading to 1.0.0 (from 0.8) the nodes seem to store their previous peers into the launcher-configuration.ini.
The bootstrap section

[bootstrap]
192.168.178.28:9012

seems to be evaluated either way (even when providing -b) and if one of the nodes doesn't exist any more the synchronization doesn't finish. Even worse, when restarting the entire network. the node intended to be the bootsrap node tries to reach its previous peers, which again are trying to reach the bootstrap node resulting in a deadlock until the file ore the config section is manually deleted.

[BUG] las2peer generates a new user agent after each login

  1. Summary - Whenever I log in I get a new user agent.
  2. Bug Details - A detailed explanation of the issue, structured in subsections:
    1. What? - I cannot access encrypted data, because my agent is not valid.
    2. Where? - E.g. Noracle.
    3. When?/How often? - Every time I log in.
    4. How?/Current state - Log into a las2peer service, visit e.g. https://git.tech4comp.dbis.rwth-aachen.de/las2peer/currentagent to check your current agent. Reset your session (or use a private browser session) and log in again and recheck your agent.

RMI invocation exception when authenticated

  1. Summary - Being logged in and then sending a request to a service leads to a RMI invocation exception
  2. Bug Details :
    1. What? - I tried making a request to a (https://las2peer.tech4comp.dbis.rwth-aachen.de/SBFManager/bots) When sending a request while being logged in the request fails with an RMI invocation. I tried deleting the session cookie and then sent the request again. This time no exception occurred. When logging in again and then sending the request again the request fails again. Thus I concluded that the issue only occurs in logged in state
    2. Where? -This seems to be either a webconnector issue, as I have also tested it with other services

[ENH] Use gradle instead of ant

  1. Motivation - We want to switch las2peer from ant to gradle. Even if this is not the main reason for using gradle, as a nice side effect, we then don't have to consider problems with updating ant anymore (see #75). We are currently using https://github.com/rwth-acis/las2peer/tree/gradle as a working branch.
  2. Specification
  • It should be possible to build jar files for all the three components (core, restmapper and webconnector).
    • Jar for core.
    • Jar for restmapper.
    • Jar for webconnector.
    • Check if ant-created jars and gradle-created jars really contain the same content.
  • All tests (also previously used in ant) should be usable with gradle.
    • Tests for core.
    • Tests for restmapper.
    • Tests for webconnector.
  • Building the node frontend needs to be possible with gradle.
  • Building the las2peer bundle (or fat jar) with gradle.
  • Javadoc (also for junitdoc in core)
  • Clean tasks
  • CI with travis.
  • Build and publish to archiva with Jenkins. We decided to do this with GitHub actions from now on.

Feel free to add entries if something is still missing.

  1. Finalised state - Everything that was possible with ant should be possible with gradle and ant should be completely removed from the project. In a later step, the template-project should also be updated.

[BUG] *_token headers being stripped

  1. Summary - Any header with "token" in its name gets stripped from HTTP headers intended for las2peer services.
  2. Bug Details
    1. What? - Not sure if this is a bug or intended, but authorisation headers are being removed from HTTP requests intended for las2peer services. This prevents, for example, a l2p service using OIDC tokens if they want to pass it through one of these headers. You have to use a custom header if you want to implement it.
    2. Where? - I would guess somewhere in las2peer core. Whichever part handles request routing and authentication.
    3. When?/How often? - With every HTTP request to a las2peer service running in the cluster.
    4. How?/Current state - When you send a HTTP request with e.g. "access_token", "some_token", "x_token"... headers, they just get removed and the final service can no longer retrieve them from the context.

[ENH] Allow for oidc usernames starting with a non alphabetic character

Motivation:
Allow for oidc usernames starting with a character that is not a-z or A-Z. This is caused by the "checkLoginNameValidity(String loginName) throws IllegalArgumentException" function in the UserAgentImpl.java class.
This can be easily fixed by not throwing an exception in this case, since the username can be valid.

Random Exception during RMI invocations, even when services are running

In the cluster, services which are running fine cannot be reached over the webconnector. The webconnector will throw a Exception during RMI invocation exception. This happens randomly and the services which we are trying to reach don't show any exceptions.
This issue was observed when making a request from the MobSOS Evaluation Center to the query visualizer over the las2peer webconnector of the bootstrap node

[ENH] Update las2peer node frontend

Motivation

  1. The goal is to update the node frontend of las2peer. On the technical side of point updating means, upgrade to use the new lit components instead of the depreciated polymer components.
  2. Additionally, while updating this, the idea is to use typescript, which in the end, like when using javascript, is similarly bundled into a es6 module bundle. The main advantages, that would be provided using typescript is the possibility to use types, which eases the development and also motivates others to update the frontend when it is clear which kind of data us used in each component. As reflecting on the current state, when trying to update and figuring out which data is used for the different components, it is hard to see what is exactly saved into variables. Typescript would improve on this aspect, considering the fact communities should be involved in this. Furthermore, if one would argue, when one would need to use Typescript, one would have a steep learning curve, it must be mentioned that one can write plain vanilla javascript in a typescript project and it will work. And even, when using typescript the usage of types is also found in other popular and widely used programming languages.
  3. Another update is the publishing of services via a jar file, as in the current state the correct classes and the servicepath have to be provided by the uploader, where if false information was entered the whole release is broken, as when using the decentralised registry, one has not the possibility to correct these information. Therefore, this should removed from the frontend and integrated directly into the las2peer core, to detect that information.
  4. As for the view services section, the published services on a cluster like from the CAE should also be displayed in the node frontend with appropriate visual feedback, displaying the difference between for example CAE applications and las2peer services uploaded from the node frontend.

Node is not started under the Windows 7 (64b)

Using the new versions of start_node.bat and start_java.bat it is not possible to start a node. The error message is following:

C:\workspace\lp>java i5.las2peer.testing.L2pNodeLauncher -s 9003
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
at i5.las2peer.testing.L2pNodeLauncher.launchSingle(L2pNodeLauncher.java
:1514)
at i5.las2peer.testing.L2pNodeLauncher.launchSingle(L2pNodeLauncher.java
:1552)
at i5.las2peer.testing.L2pNodeLauncher.main(L2pNodeLauncher.java:1748)

The same happens as well just by executing java i5.las2peer.testing.L2pNodeLauncher -s 9003

[BUG] Authorization header not set correctly

When looking through the source code of the las2peer node fronten, I stumbled upon the following line

            'Basic ' + btoa(prefixedIdentifier + ':' + credentials.oidcSub),

when setting the Authorization header when logging in (see here )
Isnt this wrong? The way I see it the authorization Header would have the form

 'Basic ' + btoa('OIDC_SUB'+<your sub>+':'+<your sub>),

but shouldn't it be:

 'Basic ' + btoa(<your username>+':'+<your sub>),

@AlexanderNeumann

[ENH] Webconnector Node list improvements

Currently the webconnector frontend only list the service as an unsorted list of known nodes. It would be nice to have also a table of services. This table should be sortable by headers such as service name, or node id.
Furthermore it would be nice to have the option to export the table as csv

[ENH] Java 17

  1. Motivation - Currently we are using Java 14. In the next months Java 17 will be released which is the next LTS version.
  2. Specification - Replace Java 14 with Java 17 when it is possible.
  3. Finalised state - Freepastry and las2peer should run without any errors or deprecation warnings with Java 17

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.