Unable to Debug Remote Event Receiver using Ngrok reverse proxy. ClientContext will be null + Error “iisexpress.exe has exited with code -1”

I want to test and debug a remote event receiver for my custom list inside sharepoint online. So i did these steps:-

  1. Inside our sharepoint online i created a new developer site collection.

  2. using Visual Studio pro 2015 >> i create a new Visual Studio project of type SP Add-in.

  3. The type = provider-hosted, as follow:- enter image description here

  4. after that i changed the Handle Add-in installed/uninstalled to True:- enter image description here

  5. then i open the Ngrok command line, i enter the following:-

ngrok http –host-header=rewrite 50452// where this port is our RER port inside visual studio

where 50452 is the port for the VS project:- enter image description here

i got the following:- enter image description here

so i updated the AappManifest.xml with the forwarding url:- enter image description here

  1. I update the app permission as follow:- enter image description here

  2. then i run the project >> i got this popup >> i select the custom list named “projects”:- enter image description here

  3. where i got to the break-point inside my code >> but the client content inside my code will be empty:- enter image description here

  4. after that the VS stop running and i got this error:- enter image description here

Here is the full code inside my “AppEventReceiver.svc”

public class AppEventReceiver : IRemoteEventService     {         private const string ReceiverName = "ItemAddedEvent";         private const string ListName = "projects";         /// <summary>         /// Handles app events that occur after the app is installed or upgraded, or when app is being uninstalled.         /// </summary>         /// <param name="properties">Holds information about the app event.</param>         /// <returns>Holds information returned from the app event.</returns>         public SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties)         {             SPRemoteEventResult result = new SPRemoteEventResult();              switch (properties.EventType)             {                 case SPRemoteEventType.AppInstalled:                     HandleAppInstalled(properties);                     break;                 case SPRemoteEventType.AppUninstalling:                     HandleAppUninstalling(properties);                     break;                 case SPRemoteEventType.ItemAdded:                     HandleItemAdded(properties);                     break;             }               return result;         }         private void HandleAppUninstalling(SPRemoteEventProperties properties)          {              using (ClientContext clientContext =                TokenHelper.CreateAppEventClientContext(properties, false))              {                  if (clientContext != null)                  {                      List myList = clientContext.Web.Lists.GetByTitle(ListName);                      clientContext.Load(myList, p => p.EventReceivers);                      clientContext.ExecuteQuery();                        var rer = myList.EventReceivers.Where(                          e => e.ReceiverName == ReceiverName).FirstOrDefault();                        try                      {                          System.Diagnostics.Trace.WriteLine("Removing ItemAdded receiver at "                                 + rer.ReceiverUrl);                            //This will fail when deploying via F5, but works                          //when deployed to production                          rer.DeleteObject();                          clientContext.ExecuteQuery();                        }                      catch (Exception oops)                      {                          System.Diagnostics.Trace.WriteLine(oops.Message);                      }                    }              }          }         private void HandleAppInstalled(SPRemoteEventProperties properties)          {              using (ClientContext clientContext =                   TokenHelper.CreateAppEventClientContext(properties, false))              {                  if (clientContext != null)                  {                      List myList = clientContext.Web.Lists.GetByTitle(ListName);                      clientContext.Load(myList, p => p.EventReceivers);                      clientContext.ExecuteQuery();                        bool rerExists = false;                        foreach (var rer in myList.EventReceivers)                      {                          if (rer.ReceiverName == ReceiverName)                         {                              rerExists = true;                              System.Diagnostics.Trace.WriteLine("Found existing ItemAdded receiver at "                                  + rer.ReceiverUrl);                          }                      }                        if (!rerExists)                      {                          EventReceiverDefinitionCreationInformation receiver =                               new EventReceiverDefinitionCreationInformation();                          receiver.EventType = EventReceiverType.ItemAdded;                           //Get WCF URL where this message was handled                          OperationContext op = OperationContext.Current;                         Message msg = op.RequestContext.RequestMessage;                            receiver.ReceiverUrl = msg.Headers.To.ToString();                            receiver.ReceiverName = ReceiverName;                          receiver.Synchronization = EventReceiverSynchronization.Synchronous;                         myList.EventReceivers.Add(receiver);                            clientContext.ExecuteQuery();                            System.Diagnostics.Trace.WriteLine("Added ItemAdded receiver at "                                  + msg.Headers.To.ToString());                      }                  }              }          }         private void HandleItemAdded(SPRemoteEventProperties properties)          {              using (ClientContext clientContext =                   TokenHelper.CreateRemoteEventReceiverClientContext(properties))              {                  if (clientContext != null)                  {                      try                      {                          List photos = clientContext.Web.Lists.GetById(                                properties.ItemEventProperties.ListId);                          ListItem item = photos.GetItemById(                               properties.ItemEventProperties.ListItemId);                          clientContext.Load(item);                          clientContext.ExecuteQuery();                            item["Title"] += "\nUpdated by RER " +                                 System.DateTime.Now.ToLongTimeString();                          item.Update();                          clientContext.ExecuteQuery();                      }                      catch (Exception oops)                      {                          System.Diagnostics.Trace.WriteLine(oops.Message);                      }                  }                }            }          /// <summary>         /// This method is a required placeholder, but is not used by app events.         /// </summary>         /// <param name="properties">Unused.</param>         public void ProcessOneWayEvent(SPRemoteEventProperties properties)         {             throw new NotImplementedException();         }      } 

So can anyone advice why i am getting Null for the ClientContext ? and why the project will stop running?

ZAP Proxy unable to launch browser invalid argument: can’t kill an exited process

  • Using OWSAP ZAP 2.8.0
  • On Ubuntu 19.04
  • With openjdk version 11.0.3 installed

When clicking the “Launch Browser” button on ZAP to launch the HUD enabled browser for ZAP no browser is launched and an error is printed in the terminal (full output below).

I have already tried Chromium and Firefox, both have the same issue.

Another issue I’ve been experiencing, although potentially unrelated, is that when trying to use ZAP in Firefox I am unable to visit HTTPS sites due to the certificate not working correctly (even though it’s installed on Firefox).

I have also tried launching it with sudo zaproxy (as apposed to just zaproxy)

While writing this I restarted ZAP and now the “Enable HUD” checkbox unchecked and is disabled (greyed out), clicking “Launch Browser” does nothing and prints the same error.

1564053694462   mozrunner::runner   INFO    Running command: "/usr/lib/firefox/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.RrRH7dDl2ZK7" 1564053694915   addons.webextension.screenshots@mozilla.org WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons 1564053694915   addons.webextension.screenshots@mozilla.org WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: telemetry 1564053694915   addons.webextension.screenshots@mozilla.org WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/ 1564053694915   addons.webextension.screenshots@mozilla.org WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader* ExceptionHandler::GenerateDump cloned child 4758 ExceptionHandler::SendContinueSignalToChild sent continue signal to child ExceptionHandler::WaitForContinueSignal waiting for continue signal... 59660 [ZAP-BrowserLauncher] ERROR org.zaproxy.zap.extension.quickstart.launch.ExtensionQuickStartLaunch  - invalid argument: can't kill an exited process Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'my-ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.0.0-21-generic', java.version: '11.0.3' Driver info: driver.version: FirefoxDriver remote stacktrace:  org.openqa.selenium.WebDriverException: invalid argument: can't kill an exited process Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'my-ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.0.0-21-generic', java.version: '11.0.3' Driver info: driver.version: FirefoxDriver remote stacktrace:      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)     at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)     at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)     at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$  new$  0(W3CHandshakeResponse.java:57)     at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$  getResponseFunction$  2(W3CHandshakeResponse.java:104)     at org.openqa.selenium.remote.ProtocolHandshake.lambda$  createSession$  0(ProtocolHandshake.java:123)     at java.base/java.util.stream.ReferencePipeline$  3$  1.accept(ReferencePipeline.java:195)     at java.base/java.util.Spliterators$  ArraySpliterator.tryAdvance(Spliterators.java:958)     at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)     at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)     at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)     at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)     at java.base/java.util.stream.FindOps$  FindOp.evaluateSequential(FindOps.java:150)     at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)     at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)     at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)     at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)     at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)     at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)     at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:600)     at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)     at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)     at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getWebDriverImpl(ExtensionSelenium.java:777)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getWebDriver(ExtensionSelenium.java:700)     at org.zaproxy.zap.extension.selenium.internal.BuiltInSingleWebDriverProvider.getWebDriver(BuiltInSingleWebDriverProvider.java:62)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getWebDriverImpl(ExtensionSelenium.java:639)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getWebDriver(ExtensionSelenium.java:509)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getProxiedBrowser(ExtensionSelenium.java:602)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getProxiedBrowserByName(ExtensionSelenium.java:566)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getProxiedBrowserByName(ExtensionSelenium.java:552)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getProxiedBrowserByName(ExtensionSelenium.java:542)     at org.zaproxy.zap.extension.quickstart.launch.ExtensionQuickStartLaunch$  2.run(ExtensionQuickStartLaunch.java:227)     at java.base/java.lang.Thread.run(Thread.java:834)  

Getting Active: active (exited) status on code deploy agent aws

I installed Code Deploy agent on my ubuntu server.

Ouput of sudo service codedeploy-agent status :

   Active: active (exited) since Sat 2019-07-20 18:16:37 UTC; 4s ago      Docs: man:systemd-sysv-generator(8)   Process: 4968 ExecStart=/etc/init.d/codedeploy-agent start (code=exited, status=0/SUCCESS)  

How to make active(exited) to active(running) ?

Homebrew dnsmasq “Service exited with abnormal code: 2” (Mac OS X Sierra 10.12.6)

I installed dnsmasq through Homebrew. Unfortunately it constantly crash and is resumed by launchd through brew services launch script.

This is the log:

Jun 11 10:45:33 MacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.dnsmasq[48386]): Service exited with abnormal code: 2 Jun 11 10:45:33 MacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.dnsmasq): Service only ran for 0 seconds. Pushing respawn out by 10 seconds. 

I set it up following some tutorials, this is my settings.

#/private/etc/Hosts  127.0.0.1       localhost 255.255.255.255 broadcasthost ::1             localhost  fe80::1%lo0     localhost  # [...]  127.0.0.1               local.web 0:0:0:0:0:ffff:7f00:1   local.web fe80::1%lo0             local.web 127.0.0.1               fullpipeumbrella.loc 0:0:0:0:0:ffff:7f00:1   fullpipeumbrella.loc fe80::1%lo0             fullpipeumbrella.loc  # [...]  127.0.0.1               localhost.demo1.com 0:0:0:0:0:ffff:7f00:1   localhost.demo1.com fe80::1%lo0             localhost.demo1.com  #/usr/local/etc/dnsmasq.conf  domain-needed bogus-priv no-resolv server=8.8.8.8 server=208.67.220.220 

This is the output of brew services list:

$   brew services list Name    Status  User     Plist dnsmasq started root     /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist httpd   stopped           php     started username /Users/username/Library/LaunchAgents/homebrew.mxcl.php.plist php@7.1 stopped           php@7.2 stopped           

And the output of ps, $ ps -e | grep -v grep | grep dnsmasq:

   65 ??         0:02.31 /usr/local/opt/dnsmasq/sbin/dnsmasq --keep-in-foreground -C /usr/local/etc/dnsmasq.conf 

Finally I made a test with dscacheutil:

$   dscacheutil -q host -a name fullpipeumbrella.loc name: fullpipeumbrella.loc ipv6_address: ::ffff:127.0.0.1 ipv6_address: fe80:1::1  name: fullpipeumbrella.loc ip_address: 127.0.0.1 

Thanks in advance… 🙂

openshift 3.11 containers with status ‘exited’

This is regarding OCP 3.11.

I have a lot of containers with status ‘Exited’ piling up and as a result of that I’m seeing disk pressure on the worker nodes.

I was looking for ways of removing these containers and came across the garbage collection mechanism, however as per Kubernetes’ documentation the flags that OpenShift doc suggests to use are deprecated.

Here is the OpenShift doc on garbage collection: https://access.redhat.com/documentation/en-us/openshift_container_platform/3.11/html/cluster_administration/admin-guide-garbage-collection

Here is the doc where it says those options are deprecated: https://v1-11.docs.kubernetes.io/docs/tasks/administer-cluster/out-of-resource/

That got me confused. Does the maximum-dead-containers option still work under OpenShift or am I supposed to use the eviction policy?

I was also thinking of using this docker command via either crontab or Prometheus executor: docker ps -aq –no-trunc -f status=exited | xargs docker rm”

Unfortunately, I don’t have a test environment to test this. I’d be grateful for any suggestions.

Tor service not working every time I restart, saying active (exited) [on hold]

I am trying to run the tor service on a Debian Stretch machine, and it works intermittently. However, after every successful start, upon the time I try to start it again, it doesn’t work. When I run “systemctl status tor” it says “active (exited)”. I’d post the entire error log, but sadly it is on a virtual machine. What is causing this, and how can I fix it so that every time I start the service it works as it should?

Tor service says “active (exited)”

I am trying to run the tor service on a Debian Stretch machine, and it works intermittently. However, after every successful start, upon the time I try to start it again, it doesn’t work. When I run “systemctl status tor” it says “active (exited)”. I’d post the entire error log, but sadly it is on a virtual machine. I don’t know how relevant this is, but I’m also running Nginx, and Tor is being run for the purpose of hidden service hosting. What is causing this, and how can I fix it so that every time I start the service it works as it should?

docker-compose up exited with code 1 because of few InnoDB errors

I have cat orthomcl/Dockerfile:

FROM debian:stretch-backports  RUN apt-get update  && apt-get install -y --no-install-recommends \         wget \         cpanminus \         build-essential \         default-libmysqlclient-dev \         python \         ca-certificates \         && rm -rf /var/lib/apt/lists/*  RUN mkdir diamond \         && cd diamond \         && wget -c https://github.com/bbuchfink/diamond/releases/download/v0.9.14/diamond-linux64.tar.gz \         && tar xvf diamond-linux64.tar.gz \         && rm *.tar.gz  RUN cpanm DBI DBD::mysql RUN wget -c https://www.micans.org/mcl/src/mcl-latest.tar.gz RUN tar xvf mcl-latest.tar.gz RUN cd mcl-* && ./configure && make && make install RUN wget -c https://orthomcl.org/common/downloads/software/v2.0/orthomclSoftware-v2.0.9.tar.gz RUN tar xvf orthomclSoftware-v2.0.9.tar.gz  ENV PATH="/diamond:/orthomclSoftware-v2.0.9/bin:$  {PATH}" 

This is my docker-compose.yml:

orthomcl:     tty: true     build: orthomcl     restart: always     links:         - db     volumes:         - ./output_dir/:/output_dir  db:   image: mysql   restart: always   environment:     - MYSQL_ROOT_PASSWORD=PAssw0rd   ports:     - "3306:3306"   volumes:     - ./mysql/:/docker-entrypoint-initdb.d 

Next, I used docker-compose up which caused:

db_1        | 2019-05-02T23:59:03.981494Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release. db_1        | 2019-05-02T23:59:03.981697Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.16) starting as process 1 db_1        | 2019-05-02T23:59:04.113140Z 1 [System] [MY-011012] [Server] Starting upgrade of data directory. db_1        | 2019-05-02T23:59:04.354244Z 1 [ERROR] [MY-012530] [InnoDB] Unknown redo log format (103). Please follow the instructions at http://dev.mysql.com/doc/refman/8.0/en/ upgrading-downgrading.html. db_1        | 2019-05-02T23:59:04.354289Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. db_1        | 2019-05-02T23:59:04.862813Z 1 [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine. db_1        | 2019-05-02T23:59:04.863115Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. db_1        | 2019-05-02T23:59:04.863285Z 0 [ERROR] [MY-010119] [Server] Aborting db_1        | 2019-05-02T23:59:04.868499Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.16)  MySQL Community Server - GPL. db_1        | 2019-05-02T23:59:07.188586Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release. db_1        | 2019-05-02T23:59:07.188730Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.16) starting as process 1 db_1        | 2019-05-02T23:59:07.198834Z 1 [System] [MY-011012] [Server] Starting upgrade of data directory. db_1        | 2019-05-02T23:59:07.310233Z 1 [ERROR] [MY-012530] [InnoDB] Unknown redo log format (103). Please follow the instructions at http://dev.mysql.com/doc/refman/8.0/en/ upgrading-downgrading.html. db_1        | 2019-05-02T23:59:07.310273Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. db_1        | 2019-05-02T23:59:07.826041Z 1 [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine. db_1        | 2019-05-02T23:59:07.826837Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. db_1        | 2019-05-02T23:59:07.829033Z 0 [ERROR] [MY-010119] [Server] Aborting db_1        | 2019-05-02T23:59:07.835484Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.16)  MySQL Community Server - GPL. orthomcl_db_1 exited with code 1 

How is it possible to solve the above InnoDB errors?

Thank you in advance.

Dual Citizen. Exited the US on Italian passport recently

I have a quick question. I’m a dual US/Italian citizen and before my most recent trip to the US I had always used my US passport to enter and exit the US when going there. This year I decided to also get an Italian passport as proof of my EU citizenship since I live in the EU (only had an ID card before). Now not being familiar with how to travel with two passports, when I checked-in at the self-service kiosks at the airport in the US on my date of departure I used my Italian passport instead of my US one (which made sense to me at the time). I did use my US one to get in the country, but I’ve read that one must use their US passport to both enter and leave the country. Are there consequence I am going to face for this? Is there any way to correct my departure information from the US with the authorities? Any help is appreciated, thank you.

Failed to build iOS project. We ran “xcodebuild” command but it exited with error code 65

Por segunda vez en 24 horas me he encontrado con este problema a la hora de ejecutar el comando react-native run-ios.

Failed to build iOS project. We ran “xcodebuild” command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening LaXtoreApp.xcodeproj

Por más que he buscado información no hay forma de encontrar una solución. He probado a borrar la carpeta node_modules y ejecutar sudo react-native run-ios o actualizar XCode de forma manual descargando el fichero desde el site de desarrolladores de Apple.

Lo único que me ha funcionado es volver a empezar de 0 el proyecto. Lo que no considero una solución porque el problema persiste.