I've been trying to integrate a DJANGO-REST WS into apache using MOD_WSGI, but after some long hours of trying to apply all debugging techniques and different wsgi scripts, I would appreciate some help.
Server version: Apache/2.2.22 (Ubuntu)
Python 2.7.3 (default, Feb 27 2014, 19:58:35)
MOD_WSGI Version: 3.3
Currently my WSGI file is the following:
"""
WSGI config for zighome_rest project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os, sys
sys.path.append('/usr/local/ZigHomeWS')
sys.path.append('/usr/local/ZigHomeWS/zighome_rest')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "zighome_rest.settings")
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
and my virtual host is configured as below:
<VirtualHost *:80>
ServerAdmin my.email#gmail.com
ServerName my.server.name
DocumentRoot /usr/local/DummyApp
WSGIDaemonProcess ZigHomeWS python-path=/usr/local/ZigHomeWS/zighome_rest:/usr/lib/python2.7:/usr/local/lib/python2.7/site-packages/django
WSGIProcessGroup ZigHomeWS
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias /ZigHomeWS /usr/local/ZigHomeWS/zighome_rest/zighome_rest/WSGI/django.wsgi
WSGIPassAuthorization On
<Directory /usr/local/ZigHomeWS/zighome_rest>
<Files django.wsgi>
Order deny,allow
Allow from all
</Files>
</Directory>
<Directory /usr/local/DummyApp>
Order deny,allow
Allow from all
</Directory>
ErrorLog /var/log/apache2/error_ZigHomeWS.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel info
</VirtualHost>
The current settings.py file has the following configuration:
"""
Django settings for zighome_rest project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '6h34&#m=1t4!(axkhz1+%6%u8^o(7^ao500pl#*+=$sk(a846#'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'configuration',
'execution',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'zighome_rest.urls'
WSGI_APPLICATION = 'zighome_rest.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/usr/local/ZigHomeWS/zighome_rest/zighome.db',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_URL = '/static/'
As soon as I call one of the services, with curl, like so:
curl -X POST http://my.server.name/ZigHomeWS/execution/start/ -u user:passwd
I get the following error logged:
[Sat Sep 27 19:15:28 2014] [info] mod_wsgi (pid=13351): Adding '/usr/local/ZigHomeWS/zighome_rest' to path.
[Sat Sep 27 19:15:28 2014] [info] mod_wsgi (pid=13351): Adding '/usr/lib/python2.7' to path.
[Sat Sep 27 19:15:28 2014] [info] mod_wsgi (pid=13351): Adding '/usr/local/lib/python2.7/site-packages/django' to path.
[Sat Sep 27 19:15:32 2014] [info] [client 46.189.221.224] mod_wsgi (pid=13351, process='ZigHomeWS', application=''): Loading WSGI script '/usr/local/ZigHomeWS/zighome_rest/zighome_rest/WSGI/django.wsgi'.
[Sat Sep 27 18:15:33 2014] [error] No handlers could be found for logger "django.request"
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] mod_wsgi (pid=13351): Exception occurred processing WSGI script '/usr/local/ZigHomeWS/zighome_rest/zighome_rest/WSGI/django.wsgi'.
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] Traceback (most recent call last):
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 187, in __call__
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] response = self.get_response(request)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 199, in get_response
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 236, in handle_uncaught_exception
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] return debug.technical_500_response(request, *exc_info)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 91, in technical_500_response
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] html = reporter.get_traceback_html()
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 350, in get_traceback_html
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] return t.render(c)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 148, in render
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] return self._render(context)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 142, in _render
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] return self.nodelist.render(context)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 844, in render
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] bit = self.render_node(node, context)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 80, in render_node
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] return node.render(context)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 90, in render
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] output = self.filter_expression.resolve(context)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 624, in resolve
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] new_obj = func(obj, *arg_vals)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/template/defaultfilters.py", line 769, in date
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] return format(value, arg)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 343, in format
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] return df.format(format_string)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 35, in format
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] pieces.append(force_text(getattr(self, piece)()))
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 268, in r
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] return self.format('D, j M Y H:i:s O')
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 35, in format
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] pieces.append(force_text(getattr(self, piece)()))
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/utils/encoding.py", line 85, in force_text
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] s = six.text_type(s)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 144, in __text_cast
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] return func(*self.__args, **self.__kw)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py", line 83, in ugettext
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] return _trans.ugettext(message)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 325, in ugettext
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] return do_translate(message, 'ugettext')
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 306, in do_translate
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] _default = translation(settings.LANGUAGE_CODE)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 209, in translation
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] default_translation = _fetch(settings.LANGUAGE_CODE)
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 189, in _fetch
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] "The translation infrastructure cannot be initialized before the "
[Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.
I must confess that adding "/usr/local/lib/python2.7/site-packages/django" was just a measure of desperation, which end-up by resulting on nothing.
One thing I should probably mention, although it shouldn't make any difference to the solution, is that the core system is actually a C++ system which I wrapped up with SWIG.
Needless to say, it's working on the Django-REST development environment.
Last but not least, if in the WSGI script file I change these two lines:
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
by these:
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
It will crash instead of providing the stack trace in the log file:
[Sat Sep 27 19:44:10 2014] [error] [client X.X.X.X] Premature end of script headers: django.wsgi
I end up applying the recommended debugging techniques but unfortunately it wasn't very helpful, since the stack-trace of gdb just gave me:
(gdb) cont
Continuing.
[New Thread 0x7fc6d4de9700 (LWP 9312)]
[New Thread 0x7fc6d45e8700 (LWP 9313)]
[Thread 0x7fc6dde3a700 (LWP 9242) exited]
[Thread 0x7fc6d45e8700 (LWP 9313) exited]
[Thread 0x7fc6d4de9700 (LWP 9312) exited]
[Thread 0x7fc6dd639700 (LWP 9245) exited]
[Thread 0x7fc6e364a740 (LWP 9216) exited]
[Inferior 1 (process 9216) exited with code 01]
Investigation:
So... I've just realized something.
From what I read from several sites on the web, I should be really using this call:
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
on the WSGI script. Since I was getting nowhere fast with these two lines of code, which were crashing all the time, I remembered to call any other web-service that I have created and VOILA!! It works. (Don't know why I haven't try this before...stubbornness I guess)
Now, one of the major differences between the two web-services, is that one, only parses some XML file and adds data to the sqlite3 database and the other one (the one that crashes), starts the whole system, which implies the creation of multiple threads and so forth.
Thus, I'm now looking for any threads related documented issue I can find with modwsgi.
I hope you can provide me with some help
Thank you
I've updated my wsgi.py file from:
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()
To:
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Related
The Question
How do I best execute memory-intensive pipelines in Apache Beam?
Background
I've written a pipeline that takes the Naemura Bird dataset and converts the images and annotations to TF Records with TF Examples of the required format for the TF object detection API.
I tested the pipeline using DirectRunner with a small subset of images (4 or 5) and it worked fine.
The Problem
When running the pipeline with a bigger data set (day 1 of 3, ~21GB) it crashes after a while with a non-descriptive SIGKILL.
I do see a memory peak before the crash and assume that the process is killed because of a too high memory load.
I ran the pipeline through strace. These are the last lines in the trace:
[pid 53702] 10:00:09.105069 poll([{fd=10, events=POLLIN}, {fd=11, events=POLLIN}, {fd=12, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}, {fd=15, events=POLLIN}, {fd=16, events=POLLIN}, {fd=17, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}, {fd=20, events=POLLIN}], 11, 100) = 0 (Timeout)
[pid 53702] 10:00:09.205826 poll([{fd=10, events=POLLIN}, {fd=11, events=POLLIN}, {fd=12, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}, {fd=15, events=POLLIN}, {fd=16, events=POLLIN}, {fd=17, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}, {fd=20, events=POLLIN}], 11, 100 <unfinished ...>
[pid 53534] 10:00:09.259806 mmap(NULL, 63082496, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3aa43d7000
[pid 53694] 10:00:09.297140 <... clock_nanosleep resumed>NULL) = 0
[pid 53694] 10:00:09.297273 clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=200000000}, <unfinished ...>
[pid 53702] 10:00:09.306409 <... poll resumed>) = 0 (Timeout)
[pid 53702] 10:00:09.306478 poll([{fd=10, events=POLLIN}, {fd=11, events=POLLIN}, {fd=12, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}, {fd=15, events=POLLIN}, {fd=16, events=POLLIN}, {fd=17, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}, {fd=20, events=POLLIN}], 11, 100) = 0 (Timeout)
[pid 53702] 10:00:09.406866 poll([{fd=10, events=POLLIN}, {fd=11, events=POLLIN}, {fd=12, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}, {fd=15, events=POLLIN}, {fd=16, events=POLLIN}, {fd=17, events=POLLIN}, {fd=18, events=POLLIN}, {fd=19, events=POLLIN}, {fd=20, events=POLLIN}], 11, 100 <unfinished ...>
[pid 53710] 10:03:55.844910 <... futex resumed>) = ?
[pid 53709] 10:03:57.797618 <... futex resumed>) = ?
[pid 53708] 10:03:57.797737 <... futex resumed>) = ?
[pid 53707] 10:03:57.797793 <... futex resumed>) = ?
[pid 53706] 10:03:57.797847 <... futex resumed>) = ?
[pid 53705] 10:03:57.797896 <... futex resumed>) = ?
[pid 53704] 10:03:57.797983 <... futex resumed>) = ?
[pid 53703] 10:03:57.798035 <... futex resumed>) = ?
[pid 53702] 10:03:57.798085 +++ killed by SIGKILL +++
[pid 53701] 10:03:57.798124 <... futex resumed>) = ?
[pid 53700] 10:03:57.798173 <... futex resumed>) = ?
[pid 53699] 10:03:57.798224 <... futex resumed>) = ?
[pid 53698] 10:03:57.798272 <... futex resumed>) = ?
[pid 53697] 10:03:57.798321 <... accept4 resumed> <unfinished ...>) = ?
[pid 53694] 10:03:57.798372 <... clock_nanosleep resumed> <unfinished ...>) = ?
[pid 53693] 10:03:57.798426 <... futex resumed>) = ?
[pid 53660] 10:03:57.798475 <... futex resumed>) = ?
[pid 53641] 10:03:57.798523 <... futex resumed>) = ?
[pid 53640] 10:03:57.798572 <... futex resumed>) = ?
[pid 53639] 10:03:57.798620 <... futex resumed>) = ?
[pid 53710] 10:03:57.798755 +++ killed by SIGKILL +++
[pid 53709] 10:03:57.798792 +++ killed by SIGKILL +++
[pid 53708] 10:03:57.798828 +++ killed by SIGKILL +++
[pid 53707] 10:03:57.798864 +++ killed by SIGKILL +++
[pid 53706] 10:03:57.798900 +++ killed by SIGKILL +++
[pid 53705] 10:03:57.798937 +++ killed by SIGKILL +++
[pid 53704] 10:03:57.798973 +++ killed by SIGKILL +++
[pid 53703] 10:03:57.799008 +++ killed by SIGKILL +++
[pid 53701] 10:03:57.799044 +++ killed by SIGKILL +++
[pid 53700] 10:03:57.799079 +++ killed by SIGKILL +++
[pid 53699] 10:03:57.799116 +++ killed by SIGKILL +++
[pid 53698] 10:03:57.799152 +++ killed by SIGKILL +++
[pid 53697] 10:03:57.799187 +++ killed by SIGKILL +++
[pid 53694] 10:03:57.799245 +++ killed by SIGKILL +++
[pid 53693] 10:03:57.799282 +++ killed by SIGKILL +++
[pid 53660] 10:03:57.799318 +++ killed by SIGKILL +++
[pid 53641] 10:03:57.799354 +++ killed by SIGKILL +++
[pid 53640] 10:03:57.799390 +++ killed by SIGKILL +++
[pid 53639] 10:03:57.910349 +++ killed by SIGKILL +++
10:03:57.910381 +++ killed by SIGKILL +++
Multiple things could cause this behaviour, because the pipeline runs fine with less Data, analysing what has changed could lead us to a resolution.
Option 1 : clean your input data
The third line of the logs you provide might indicate that you're processing unclean data in your bigger pipeline mmap(NULL, could mean that | "Get Content" >> beam.Map(lambda x: x.read_utf8()) is trying to read a null value.
Is there an empty file somewhere ? Are your files utf8 encoded ?
Option 2 : use smaller files as input
I'm guessing using the fileio.ReadMatches() will try to load into memory the whole file, if your file is bigger than your memory, this could lead to errors. Can you split your data into smaller files ?
Option 3 : use a bigger infrastructure
If files are too big for your current machine with a DirectRunner you could try to use an on-demand infrastructure using another runner on the Cloud such as DataflowRunner
My application is based on Micronaut and GraalVM (java 11) and does a simple call to http://httpbin.org/get:
#Controller("/api")
class HelloWorld(
#Client("http://httpbin.org")
private val httpClient: RxHttpClient
) {
private val logger = LoggerFactory.getLogger(javaClass)
#Get("/hello")
fun hello(): String {
return "Hello World!"
}
#Get("/fb")
fun fb(): Flowable<String> {
logger.info("Trying to call FB")
logger.info("Using url http://httpbin.org/get")
try {
return httpClient.retrieve("/get")
.doOnError { logger.error("Error calling fb api flowable", it) }
.doFinally { logger.info("Finished calling FB api flowable") }
} catch (ex: Exception) {
logger.error("Error calling fb api", ex)
throw ex
} finally {
logger.info("Finished calling fb api")
}
}
}
When I build a docker image of the app using this Dockerfile:
FROM maven:3.6.3-jdk-11 as maven
COPY . /home/app
WORKDIR /home/app
RUN mvn package
FROM oracle/graalvm-ce:19.3.1-java11 as graalvm
COPY --from=maven /home/app/target/app-*.jar /home/app/
WORKDIR /home/app
RUN gu install native-image
RUN native-image --no-server --enable-http --enable-https -cp app-*.jar
FROM debian:stretch
EXPOSE 8080
COPY --from=graalvm /home/app/app .
#RUN apt-get update && apt-get -y install strace
ENTRYPOINT ["./app"]
Everything works in my local environment.
But when I push the image to Google Cloud Repository, deploy it to Cloud Run and try to access the endpoint /api/fb, it crashes the container with 503 Service Unavailable.
The error in the logs is "The request failed because the HTTP connection to the instance had an error.". When I enable strace, these are the logs:
A 2020-02-07T12:04:27.443115Z [pid 18] <... futex resumed> ) = -1 ETIMEDOUT (Connection timed out)
A 2020-02-07T12:04:27.443125Z [pid 18] futex(0x3e61dc018a80, FUTEX_WAKE_PRIVATE, 1) = 0
A 2020-02-07T12:04:27.443357Z [pid 18] futex(0x3e62040009c4, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x3e6204000990, 234) = 1
A 2020-02-07T12:04:27.443369Z [pid 15] <... futex resumed> ) = 0
A 2020-02-07T12:04:27.443440Z [pid 18] futex(0x3e61dc018ab4, FUTEX_WAIT_BITSET_PRIVATE, 157, {tv_sec=3624, tv_nsec=391761056}, 0xffffffff <unfinished ...>
A 2020-02-07T12:04:27.443478Z [pid 15] futex(0x3e6204000990, FUTEX_WAKE_PRIVATE, 1) = 0
A 2020-02-07T12:04:27.959629Z [pid 20] epoll_wait(17, <unfinished ...>
A 2020-02-07T12:04:27.959658Z [pid 8] <... epoll_wait resumed> [{EPOLLIN, {u32=53, u64=53}}], 1024, -1) = 1
A 2020-02-07T12:04:27.959865Z [pid 8] accept(53, {sa_family=AF_INET6, sin6_port=htons(36294), inet_pton(AF_INET6, "::ffff:169.254.8.129", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, [28]) = 4
A 2020-02-07T12:04:27.959884Z [pid 8] fcntl(4, F_GETFL) = 0x2 (flags O_RDWR)
A 2020-02-07T12:04:27.959945Z [pid 8] getsockname(4, {sa_family=AF_INET6, sin6_port=htons(8080), inet_pton(AF_INET6, "::ffff:169.254.8.130", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, [28]) = 0
A 2020-02-07T12:04:27.960036Z [pid 8] getsockname(4, {sa_family=AF_INET6, sin6_port=htons(8080), inet_pton(AF_INET6, "::ffff:169.254.8.130", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, [28]) = 0
A 2020-02-07T12:04:27.960085Z [pid 8] fcntl(4, F_GETFL) = 0x2 (flags O_RDWR)
A 2020-02-07T12:04:27.960128Z [pid 8] fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
A 2020-02-07T12:04:27.960211Z [pid 8] setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0
A 2020-02-07T12:04:27.960322Z [pid 8] getsockopt(4, SOL_SOCKET, SO_SNDBUF, [1048576], [4]) = 0
A 2020-02-07T12:04:27.960440Z [pid 8] mmap(NULL, 8392704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x3e60f0e00000
A 2020-02-07T12:04:27.960564Z [pid 8] mprotect(0x3e60f0e00000, 4096, PROT_NONE) = 0
A 2020-02-07T12:04:27.960793Z [pid 8] clone(/usr/bin/strace: Process 22 attached
A 2020-02-07T12:04:27.960875Z <unfinished ...>
A 2020-02-07T12:04:27.965711Z [pid 22] set_robust_list(0x3e60f16009e0, 24 <unfinished ...>
A 2020-02-07T12:04:27.965738Z [pid 8] <... clone resumed> child_stack=0x3e60f15fffb0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x3e60f16009d0, tls=0x3e60f1600700, child_tidptr=0x3e60f16009d0) = 22
A 2020-02-07T12:04:27.965753Z [pid 22] <... set_robust_list resumed> ) = -1 ENOSYS (Function not implemented)
A 2020-02-07T12:04:27.965761Z [pid 8] epoll_wait(29, <unfinished ...>
A 2020-02-07T12:04:27.965770Z [pid 22] sched_getaffinity(22, 32, [0, 1]) = 8
A 2020-02-07T12:04:27.965783Z [pid 22] futex(0x3b4c0c4, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x3b4c068, 30) = 1
A 2020-02-07T12:04:27.965790Z [pid 3] <... futex resumed> ) = 0
A 2020-02-07T12:04:27.965799Z [pid 3] futex(0x3b4c068, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
A 2020-02-07T12:04:27.965807Z [pid 22] futex(0x3b4c068, FUTEX_WAKE_PRIVATE, 1) = 1
A 2020-02-07T12:04:27.965816Z [pid 22] mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 <unfinished ...>
A 2020-02-07T12:04:27.965824Z [pid 3] <... futex resumed> ) = 0
A 2020-02-07T12:04:27.965833Z [pid 3] futex(0x3b4c068, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
A 2020-02-07T12:04:27.965842Z [pid 22] <... mmap resumed> ) = 0x3e60f0c00000
A 2020-02-07T12:04:27.965850Z [pid 3] <... futex resumed> ) = 0
A 2020-02-07T12:04:27.965858Z [pid 3] futex(0x3b4c0c4, FUTEX_WAIT_PRIVATE, 31, NULL <unfinished ...>
A 2020-02-07T12:04:27.965866Z [pid 22] munmap(0x3e60f0d00000, 1048576) = 0
A 2020-02-07T12:04:27.965874Z [pid 22] prctl(PR_SET_NAME, "ntLoopGroup-1-7"...) = 0
A 2020-02-07T12:04:27.965882Z [pid 22] epoll_wait(20, [], 1024, 0) = 0
A 2020-02-07T12:04:27.965891Z [pid 22] mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3e60f0a00000
A 2020-02-07T12:04:27.965903Z [pid 22] munmap(0x3e60f0b00000, 1048576) = 0
A 2020-02-07T12:04:27.966731Z [pid 22] epoll_ctl(20, EPOLL_CTL_ADD, 4, {EPOLLIN, {u32=4, u64=4}}) = 0
A 2020-02-07T12:04:27.966836Z [pid 22] epoll_wait(20, [{EPOLLIN, {u32=4, u64=4}}], 1024, 299996) = 1
A 2020-02-07T12:04:27.967306Z [pid 22] mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3e60f0800000
A 2020-02-07T12:04:27.967325Z [pid 22] munmap(0x3e60f0900000, 1048576) = 0
A 2020-02-07T12:04:27.967493Z [pid 22] mmap(NULL, 16781312, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3e60ef600000
A 2020-02-07T12:04:27.984977Z [pid 22] read(4, "GET /api/fb HTTP/1.1\r\nhost: app"..., 1024) = 864
A 2020-02-07T12:04:27.985474Z [36m12:04:27.985[0;39m [1;30m[nioEventLoopGroup-1-7][0;39m [34mINFO [0;39m [35mcom.roihunter.app.HelloWorld[0;39m - Trying to call FB
A 2020-02-07T12:04:27.985581Z [36m12:04:27.985[0;39m [1;30m[nioEventLoopGroup-1-7][0;39m [34mINFO [0;39m [35mcom.roihunter.app.HelloWorld[0;39m - Using url /act_984750788289990/insights
A 2020-02-07T12:04:27.985645Z [pid 22] write(1, "\33[36m12:04:27.985\33[0;39m \33[1;30m"..., 143) = 143
A 2020-02-07T12:04:27.985666Z [pid 22] write(1, "\33[36m12:04:27.985\33[0;39m \33[1;30m"..., 165) = 165
A 2020-02-07T12:04:27.985766Z [36m12:04:27.985[0;39m [1;30m[nioEventLoopGroup-1-7][0;39m [34mINFO [0;39m [35mcom.roihunter.app.HelloWorld[0;39m - Finished calling fb api
A 2020-02-07T12:04:27.985836Z [pid 22] write(1, "\33[36m12:04:27.985\33[0;39m \33[1;30m"..., 149) = 149
A 2020-02-07T12:04:27.986363Z [pid 22] write(4, "HTTP/1.1 200 OK\r\ntransfer-encodi"..., 143) = 143
E 2020-02-07T12:04:27.988626Z GET 503 546 B 31 ms curl/7.66.0 https://app-5phkf6s3jq-ez.a.run.app/api/fb GET 503 546 B 31 ms curl/7.66.0
A 2020-02-07T12:04:27.989104Z [pid 22] writev(4, [{iov_base="1\r\n", iov_len=3}, {iov_base="[", iov_len=1}, {iov_base="\r\n", iov_len=2}], 3) = 6
A 2020-02-07T12:04:27.989513Z [pid 22] mmap(NULL, 8392704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x3e60eec00000
A 2020-02-07T12:04:27.989534Z [pid 22] mprotect(0x3e60eec00000, 4096, PROT_NONE) = 0
A 2020-02-07T12:04:27.989732Z [pid 22] clone(/usr/bin/strace: Process 23 attached
A 2020-02-07T12:04:27.989753Z <unfinished ...>
A 2020-02-07T12:04:27.989873Z [pid 23] set_robust_list(0x3e60ef4009e0, 24) = -1 ENOSYS (Function not implemented)
A 2020-02-07T12:04:27.989884Z [pid 23] sched_getaffinity(23, 32, [0, 1]) = 8
A 2020-02-07T12:04:27.989964Z [pid 23] futex(0x3b4c0c4, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x3b4c068, 32) = 1
A 2020-02-07T12:04:27.990286Z [pid 23] mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 <unfinished ...>
A 2020-02-07T12:04:27.990303Z [pid 22] <... clone resumed> child_stack=0x3e60ef3fffb0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x3e60ef4009d0, tls=0x3e60ef400700, child_tidptr=0x3e60ef4009d0) = 23
A 2020-02-07T12:04:27.990311Z [pid 23] <... mmap resumed> ) = 0x3e60eea00000
A 2020-02-07T12:04:27.990320Z [pid 3] <... futex resumed> ) = 0
A 2020-02-07T12:04:27.990327Z [pid 3] futex(0x3b4c068, FUTEX_WAKE_PRIVATE, 1) = 0
A 2020-02-07T12:04:27.990335Z [pid 3] futex(0x3b4c0c4, FUTEX_WAIT_PRIVATE, 33, NULL <unfinished ...>
A 2020-02-07T12:04:27.990345Z [pid 23] munmap(0x3e60eeb00000, 1048576) = 0
A 2020-02-07T12:04:27.990423Z [pid 22] socket(AF_INET6, SOCK_STREAM, IPPROTO_IP <unfinished ...>
A 2020-02-07T12:04:27.990435Z [pid 23] prctl(PR_SET_NAME, "ionThreadPool-1"... <unfinished ...>
A 2020-02-07T12:04:27.990446Z [pid 22] <... socket resumed> ) = 80
A 2020-02-07T12:04:27.990668Z [pid 22] setsockopt(80, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0
A 2020-02-07T12:04:27.990684Z [pid 23] <... prctl resumed> ) = 0
I tried using a different library to make the call, Java 11 Http client, and it works. But whatever I do, it doesn't work when I use Micronaut Http client, and there is no helpful message.
I also tried using Java 8, a different linux distribution in the docker image (fedora:latest, ubuntu:latest), but it didn't help.
Do you have any idea what could be causing this?
Thanks for you answer in advance.
ok. Since this is the only question that comes up whenever someone searches for cloud run 503 error, I would like to share my horrible experience and solution.
I deployed my spring boot app on cloud run and configured pub-sub push subscription trigger for it. I tested it on my local system. Then i tested it on my private GCP project. And then when i deployed it on my organization's GCP account, I started to get 503 error.
After this, below is what i tried.
I tried changing the roles/permissions of the default service account (which was used by the run instance) by giving max permissions, but it was of no use.
Tried changing the concurrency to 1 (as suggested in GCP docs) but no help.
I started comparing each and every config of my run instance with my private GCP run instance, And then i found out that I mistakenly had checked below option which was causing this issue.
So i unchecked it, redeployed my instance, and it worked.
In my case I simply made a syntax error in my python code inside my Cloud Run instance and I got the 503 Service Unavailable error.
This showed up in the logs. Go to your Cloud Run Service and click "Logs" for more details.
So it looks like the core of the issue is that Cloud Run currently does not support HTTP streaming:
https://cloud.google.com/run/docs/issues#grpc_websocket
And when I return Flowable with Micronauts, it is opening a streamable HTTP connection. So the solution is not to use Flowable (or any other Publisher that is unbounded e.g. Flow, Flux etc) as a response.
I have a search component which works like this:
An user performs a search by selecting multiples searches (from 1 to around 25).
When the user submit the search form, the front send one HTTP request to the API per selected search. The frontend is an Angular 8 app and the API is a Java API running in Tomcat 9 behind Apache 2 (with HTTP2 support) acting as a reverse proxy.
If the user submit the search form a second time, each unfinished request is cancel and we go back to the second step.
When the second request is send, an error net::ERR_HTTP2_PROTOCOL_ERROR is sometimes throw, it happens only if at least one HTTP request has been canceled.
I tried to isolate the problem as much as I could. The following program (hosted on a Gitlab repository) reproduce the issue with minimal code: dorianm/apache2-http2-chrome-error
It contains a minimal Apache 2 configuration (only 43 rows):
# [...]
DocumentRoot /usr/local/apache2/htdocs/
<Directory "/usr/local/apache2/htdocs/">
Options ExecCGI
AddHandler cgi-script .pl
Require all granted
</Directory>
Protocols h2
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite !EDH:!AECDH:!ADH:!DSS:!RC4:ECDSA:HIGH:+3DES
SSLHonorCipherOrder on
SSLCertificateFile /usr/local/apache2/conf/server.crt
SSLCertificateKeyFile /usr/local/apache2/conf/server.key
# [...]
A simple basic CGI Perl script:
#!/usr/bin/env perl
print "Content-Type: application/json\n\n";
print '[{ … }]'; # ~100kb of random JSON
And a Javascript script which call the CGI script from the frontend/cancel requests/…:
let runningQueries = [];
let intervalId;
const getIntervalTime = () => document.getElementById("intervalTime").value; // 50ms by default
setInterval(() => {
fetch("https://localhost/cgi.pl?constant");
}, 200);
const searches = [];
for (let i = 1; i <= 10; i++) {
searches.push(`https://localhost/cgi.pl?${i}`);
}
function start() {
intervalId = setInterval(() => {
runningQueries.forEach(controller => {
controller.abort();
});
runningQueries = [];
searches.forEach(url => {
const controller = new AbortController();
runningQueries.push(controller);
fetch(url, {signal: controller.signal}).catch(err => {
console.log(err);
});
});
}, getIntervalTime());
}
function stop() {
clearInterval(intervalId);
}
Two buttons are available in front to execute the start and the stop functions. Thanks to that code, I can reproduce my issue:
I export Chrome logs (from chrome://net-export/ tools):
t=5644 [st=194] +HTTP_TRANSACTION_SEND_REQUEST [dt=9]
t=5644 [st=194] HTTP_TRANSACTION_HTTP2_SEND_REQUEST_HEADERS
--> :method: GET
:authority: localhost
:scheme: https
:path: /cgi.pl?constant
authorization: [30 bytes were stripped]
sec-fetch-mode: cors
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36
accept: */*
sec-fetch-site: same-origin
referer: https://localhost/index.html
accept-encoding: gzip, deflate, br
accept-language: fr,en;q=0.9,de;q=0.8,it;q=0.7
cookie: [1585 bytes were stripped]
t=5653 [st=203] -HTTP_TRANSACTION_SEND_REQUEST
t=5653 [st=203] +HTTP_TRANSACTION_READ_HEADERS [dt=180]
t=5833 [st=383] HTTP2_STREAM_ERROR
--> description = "Server reset stream."
--> net_error = "ERR_HTTP2_PROTOCOL_ERROR"
--> stream_id = 2945
t=5833 [st=383] -HTTP_TRANSACTION_READ_HEADERS
--> net_error = -337 (ERR_HTTP2_PROTOCOL_ERROR)
t=5833 [st=383] -URL_REQUEST_START_JOB
--> net_error = -337 (ERR_HTTP2_PROTOCOL_ERROR)
t=5833 [st=383] URL_REQUEST_DELEGATE_RESPONSE_STARTED [dt=0]
t=5833 [st=383] -REQUEST_ALIVE
--> net_error = -337 (ERR_HTTP2_PROTOCOL_ERROR)
And I change Apache logs to the trace level. The only interesting part is the following:
[Fri Oct 18 09:59:34.120151 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1839]], frames=1895/2902 (r/s)
[Fri Oct 18 09:59:34.120168 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1841]], frames=1895/2903 (r/s)
[Fri Oct 18 09:59:34.120186 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1843]], frames=1895/2904 (r/s)
[Fri Oct 18 09:59:34.120194 2019] [authz_core:debug] [pid 10:tid 139650130171648] mod_authz_core.c(820): [client 192.168.192.1:36934] AH01626: authorization result of Require all granted: granted, referer: https://localhost/index.html
[Fri Oct 18 09:59:34.120202 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1845]], frames=1895/2905 (r/s)
[Fri Oct 18 09:59:34.120212 2019] [authz_core:debug] [pid 10:tid 139650130171648] mod_authz_core.c(820): [client 192.168.192.1:36934] AH01626: authorization result of <RequireAny>: granted, referer: https://localhost/index.html
[Fri Oct 18 09:59:34.120220 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1847]], frames=1895/2906 (r/s)
[Fri Oct 18 09:59:34.120235 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1849]], frames=1895/2907 (r/s)
[Fri Oct 18 09:59:34.120248 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1851]], frames=1895/2908 (r/s)
[Fri Oct 18 09:59:34.120286 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1853]], frames=1895/2909 (r/s)
[Fri Oct 18 09:59:34.120303 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1855]], frames=1895/2910 (r/s)
[Fri Oct 18 09:59:34.120311 2019] [ssl:debug] [pid 10:tid 139650146973440] ssl_engine_kernel.c(383): [client 192.168.192.1:36934] AH02034: Subsequent (No.2) HTTPS request received for child 554050783019 (server localhost:443), referer: https://localhost/index.html
[Fri Oct 18 09:59:34.120320 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1857]], frames=1895/2911 (r/s)
[Fri Oct 18 09:59:34.120337 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1859]], frames=1895/2912 (r/s)
[Fri Oct 18 09:59:34.120354 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1861]], frames=1895/2913 (r/s)
[Fri Oct 18 09:59:34.120363 2019] [authz_core:debug] [pid 10:tid 139650146973440] mod_authz_core.c(820): [client 192.168.192.1:36934] AH01626: authorization result of Require all granted: granted, referer: https://localhost/index.html
[Fri Oct 18 09:59:34.120378 2019] [authz_core:debug] [pid 10:tid 139650146973440] mod_authz_core.c(820): [client 192.168.192.1:36934] AH01626: authorization result of <RequireAny>: granted, referer: https://localhost/index.html
[Fri Oct 18 09:59:34.120378 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1863]], frames=1895/2914 (r/s)
[Fri Oct 18 09:59:34.122672 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1865]], frames=1895/2915 (r/s)
[Fri Oct 18 09:59:34.122922 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1867]], frames=1895/2916 (r/s)
[Fri Oct 18 09:59:34.122960 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1869]], frames=1895/2917 (r/s)
[Fri Oct 18 09:59:34.122979 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1871]], frames=1895/2918 (r/s)
[Fri Oct 18 09:59:34.123018 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1873]], frames=1895/2919 (r/s)
[Fri Oct 18 09:59:34.123030 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1875]], frames=1895/2920 (r/s)
[Fri Oct 18 09:59:34.123047 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1877]], frames=1895/2921 (r/s)
[Fri Oct 18 09:59:34.123064 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1879]], frames=1895/2922 (r/s)
[Fri Oct 18 09:59:34.123081 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1881]], frames=1895/2923 (r/s)
[Fri Oct 18 09:59:34.123097 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1883]], frames=1895/2924 (r/s)
[Fri Oct 18 09:59:34.123114 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1885]], frames=1895/2925 (r/s)
[Fri Oct 18 09:59:34.123195 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1887]], frames=1895/2926 (r/s)
[Fri Oct 18 09:59:34.123216 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1889]], frames=1895/2927 (r/s)
[Fri Oct 18 09:59:34.123233 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(593): [client 192.168.192.1:36934] AH03068: h2_session(128,BUSY,11): sent FRAME[RST_STREAM[length=4, flags=0, stream=1809]], frames=1895/2928 (r/s)
[Fri Oct 18 09:59:34.123276 2019] [http2:debug] [pid 10:tid 139649980819200] h2_session.c(267): [client 192.168.192.1:36934] AH03065: h2_stream(128-1809,CLOSED): closing with err=1 protocol error
The last line reports h2_stream(128-1809,CLOSED): closing with err=1 protocol.
I test this with the following environment:
Chrome Version 77.0.3865.120 (Official Build) (64-bit) on macOS Catalina 10.15
Apache 2.4.41 in a Docker container (image httpd:latest)
What I am missing ? Maybe it's an Apache bug ? A Chrome bug ? A bad Apache configuration ?
Thanks you in advance.
We have build an hybrid application and we have noticed an intermittent issue with connectivity to the mobile-first server from Android and iPhone. And it resolves once we kill the app and start again. This happens in following scenarios
1) when the direct update is requested and once the direct update is done immediately after that it stops working.
2) when the app is open and kept ideal in the background for some time like 30 min and then if try to access it does not connect to the server.
iPhone Logs
Jan 17 21:37:42 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Error>: NSURLConnection finished with error - code -1100
Jan 17 21:37:42 Owners-iPhone-3 locationd[71] <Notice>: {"msg":"CLWifiPositioningSystemLogic::apply", "event":"elapsed", "begin_mach":6677143475613, "end_mach":6677143529851, "elapsed_s":"0.002259917", "event":"Motion::CoarseMovement", "now_s":"537935862.468443036"}
Jan 17 21:37:43 Owners-iPhone-3 locationd[71] <Notice>: {"msg":"CLWifiPositioningSystemLogic::apply", "event":"elapsed", "begin_mach":6677159234428, "end_mach":6677159257208, "elapsed_s":"0.000949167", "event":"Motion::CoarseMovement", "now_s":"537935863.124722004"}
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2016/09/19 17:15:50
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [My.SessionTimeoutServiceFactory] SessionTimeoutService elapsedTime : NaN
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [My.services] {"wifiName":"Not Available","networkConnectionType":"WIFI","ipv4Addresses":{"3GAddress":"10.192.82.165","wifiAddress":"10.0.1.5"},"ipv6Addresses":{"3GAddress":"::2600:380:a32b:513d:40ac:e5f3","wifiAddress":"::fe80:8:0:0:1c1a:a8cf"},"isNetworkConnected":"true","carrierName":"Not Available","isRoaming":"Not Available","isAirplaneMode":"Not Available","telephonyNetworkType":"Not Available","ipAddress":"10.0.1.5"}
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] +[WLAFHTTPRequestOperationManagerWrapper requestWithURL:] in WLAFHTTPRequestOperationManagerWrapper.m:51 :: Request url is https://myServerIp:443/MyProject/adapters/AnnouncementsAdapter/announcements/fetchannouncements
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper start] in WLAFHTTPRequestOperationManagerWrapper.m:356 :: Starting the request with URL https://myServerIp:443/MyProject/adapters/AnnouncementsAdapter/announcements/fetchannouncements
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Error>: NSURLConnection finished with error - code -1001
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Error>: NSURLConnection finished with error - code -1001
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:388 :: Request Failed
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:389 :: Response Status Code : 0
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:390 :: Response Error : The request timed out.
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:388 :: Request Failed
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:389 :: Response Status Code : 0
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:390 :: Response Error : The request timed out.
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: TIC TCP Conn Cancel [39:0x1c4362700]
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: TIC TCP Conn Cancel [41:0x1c0365400]
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: TIC Enabling TLS [45:0x1c0368f40]
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: TIC TCP Conn Start [45:0x1c0368f40]
Jan 17 21:37:43 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: Task <8A3D00F0-37B8-4A43-BA2E-2C96EAE6AA9F>.<0> setting up Connection 45
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: TIC TLS Event [45:0x1c0368f40]: 1, Pending(0)
Jan 17 21:37:44 Owners-iPhone-3 locationd[71] <Notice>: {"msg":"CLWifiPositioningSystemLogic::apply", "event":"elapsed", "begin_mach":6677182200912, "end_mach":6677182224304, "elapsed_s":"0.000974667", "event":"Motion::CoarseMovement", "now_s":"537935864.081508040"}
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: TIC TLS Event [45:0x1c0368f40]: 2, Pending(0)
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: TIC TLS Event [45:0x1c0368f40]: 20, Pending(0)
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: TIC TCP Conn Connected [45:0x1c0368f40]: Err(16)
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: TIC TCP Conn Event [45:0x1c0368f40]: 1
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: TIC TCP Conn Event [45:0x1c0368f40]: 8
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: TIC TLS Handshake Complete [45:0x1c0368f40]
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: Task <8A3D00F0-37B8-4A43-BA2E-2C96EAE6AA9F>.<0> now using Connection 45
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: Task <8A3D00F0-37B8-4A43-BA2E-2C96EAE6AA9F>.<0> sent request, body N
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: Task <8A3D00F0-37B8-4A43-BA2E-2C96EAE6AA9F>.<0> received response, status 401 content K
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: Task <8A3D00F0-37B8-4A43-BA2E-2C96EAE6AA9F>.<0> response ended
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:388 :: Request Failed
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:389 :: Response Status Code : 401
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:390 :: Response Error : Request failed: unauthorized (401)
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2016/09/19 17:15:50
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [NONE] Request [https://myServerIp:443/MyProject/authorization/v1/authorization]
Jan 17 21:37:44 Owners-iPhone-3 trustd[5056] <Notice>: could not disable pinning: not an internal release
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp[5966] <Notice>: THREAD WARNING: ['WLAuthorizationManagerPlugin'] took '22.705078' ms. Plugin should use a background thread.
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] +[WLAFHTTPRequestOperationManagerWrapper requestWithURL:] in WLAFHTTPRequestOperationManagerWrapper.m:51 :: Request url is https://myServerIp:443/MyProject/authorization/v1/authorization?response_type=code&client_id=4bd3c60d412b36d16f4da069658c0c7fa226cad1&redirect_uri=http%3A%2F%2Fmfpredirecturi&isAjaxRequest=true&x=0.15013111462581286
Jan 17 21:37:44 Owners-iPhone-3 assertiond[74] <Notice>: Client relinquished <BKProcessAssertion: 0x100f8a9f0; "Called by UIKit, from <redacted>" (finishTask:180s); id:\M-b\M^#\M-&0B8CA7216A0C>
Jan 17 21:37:44 Owners-iPhone-3 assertiond[74] <Notice>: [MyMobileApp:5966] Deactivate assertion: <BKProcessAssertion: 0x100f8a9f0; "Called by UIKit, from <redacted>" (finishTask:180s); id:\M-b\M^#\M-&0B8CA7216A0C>
Jan 17 21:37:44 Owners-iPhone-3 assertiond[74] <Notice>: [MyMobileApp:5966] dump all assertions HWM:4 (deactivateAssertion): {
<BKProcessAssertion: 0x101884d90; "Resume" (activation:inf); id:\M-b\M^#\M-&9D6AF759764B> [active]
}
Jan 17 21:37:44 Owners-iPhone-3 assertiond[74] <Notice>: [MyMobileApp:5966] New process assertion state; preventSuspend, preventThrottleDownUI, preventThrottleDownCPU, preventSuspendOnSleep (assertion 0x100f8a9f0 added: (none); removed: preventIdleSleep)
Jan 17 21:37:44 Owners-iPhone-3 assertiond[74] <Notice>: [MyMobileApp:5966] Setting jetsam priority to 10 [0x10100]
Jan 17 21:37:44 Owners-iPhone-3 assertiond[74] <Notice>: [MyMobileApp:5966] dump all assertions HWM:4 (CPUMON check): {
<BKProcessAssertion: 0x101884d90; "Resume" (activation:inf); id:\M-b\M^#\M-&9D6AF759764B> [active]
}
Jan 17 21:37:44 Owners-iPhone-3 assertiond[74] <Notice>: Releasing PowerAssertion on MyMobileApp:5966 from update
Jan 17 21:37:44 Owners-iPhone-3 assertiond[74] <Notice>: [MyMobileApp:5966] Remove assertion: <BKProcessAssertion: 0x100f8a9f0; "Called by UIKit, from <redacted>" (finishTask:180s); id:\M-b\M^#\M-&0B8CA7216A0C>
Jan 17 21:37:44 Owners-iPhone-3 assertiond[74] <Notice>: [MyMobileApp:5966] dump all assertions HWM:4 (CPUMON check): {
<BKProcessAssertion: 0x101884d90; "Resume" (activation:inf); id:\M-b\M^#\M-&9D6AF759764B> [active]
}
Jan 17 21:37:44 Owners-iPhone-3 assertiond[74] <Notice>: -[BKAssertion dealloc] - <0x100f8a9f0>
Jan 17 21:37:44 Owners-iPhone-3 powerd[40] <Notice>: Process assertiond.74 Released SystemIsActive "MyMobileApp:5966:5966-C6CEB4F5-9DCC-4E15-8BB6-0B8CA7216A0C [Called by UIKit, from <redacted>] [0x100f8a9f0]" age:00:00:02 id:51539648155 [System: PrevIdle SysAct]
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp[5966] <Notice>: [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper start] in WLAFHTTPRequestOperationManagerWrapper.m:356 :: Starting the request with URL https://myServerIp:443/MyProject/authorization/v1/authorization?response_type=code&client_id=4bd3c60d412b36d16f4da069658c0c7fa226cad1&redirect_uri=http%3A%2F%2Fmfpredirecturi&isAjaxRequest=true&x=0.15013111462581286
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: Task <D0C8DF5A-65FD-4BE0-82C9-21579B9947D1>.<0> now using Connection 45
Jan 17 21:37:44 Owners-iPhone-3 MyMobileApp(CFNetwork)[5966] <Notice>: Task <D0C8DF5A-65FD-4BE0-82C9-21579B9947D1>.<0> sent request, body N
Jan 17 21:37:44 Owners-iPhone-3 CommCenter(libATCommandStudioDynamic.dylib)[88] <Notice>: QMI: Svc=0x03(NAS) Ind MsgId=0x0051 Bin=['01 1F 00 80 03 02 04 EB 71 51 00 13 00 14 06 00 C1 F3 A2 FF D4 00 A2 01 00 64 A4 03 00 01 64 00']
Jan 17 21:37:44 Owners-iPhone-3 locationd[71] <Notice>: {"msg":"CLWifiPositioningSystemLogic::apply", "event":"elapsed", "begin_mach":6677197559866, "end_mach":6677197584343, "elapsed_s":"0.001019875", "event":"Motion::CoarseMovement", "now_s":"537935864.721438050"}
Jan 17 21:37:45 Owners-iPhone-3 locationd[71] <Notice>: {"msg":"CLWifiPositioningSystemLogic::apply", "event":"elapsed", "begin_mach":6677205218631, "end_mach":6677205243804, "elapsed_s":"0.001048875", "event":"Motion::CoarseMovement", "now_s":"537935865.040650964"}
Jan 17 21:37:45 Owners-iPhone-3 locationd[71] <Notice>: {"msg":"CLWifiPositioningSystemLogic::apply", "event":"elapsed", "begin_mach":6677220543131, "end_mach":6677220575096, "elapsed_s":"0.001331875", "event":"Motion::CoarseMovement", "now_s":"537935865.679077029"}
Jan 17 21:37:47 Owners-iPhone-3 destinationd(DuetExpertCenter)[5082] <Notice>: predictionForCategories returned error: <private>
Jan 17 21:37:47 Owners-iPhone-3 destinationd(DuetExpertCenter)[5082] <Error>: Error: <private>
Jan 17 21:37:47 Owners-iPhone-3 destinationd[5082] <Error>: <private> received error: <private>
Jan 17 21:37:48 Owners-iPhone-3 symptomsd(SymptomEvaluator)[5571] <Error>: AWD direct: received libnetcore symptom w/ non conforming layout, dropping
Jan 17 21:37:49 Owners-iPhone-3 CommCenter(libATCommandStudioDynamic.dylib)[88] <Notice>: QMI: Svc=0x03(NAS) Ind MsgId=0x0051 Bin=['01 1F 00 80 03 02 04 EC 71 51 00 13 00 14 06 00 C1 F2 A2 FF 8A 00 A2 01 00 64 A4 03 00 01 64 00']
Jan 17 21:37:49 Owners-iPhone-3 locationd[71] <Notice>: {"msg":"CLWifiPositioningSystemLogic::apply", "event":"elapsed", "begin_mach":6677320175459, "end_mach":6677320223146, "elapsed_s":"0.001986958", "event":"Motion::CoarseMovement", "now_s":"537935869.830474019"}
Jan 17 21:37:50 Owners-iPhone-3 locationd[71] <Notice>: {"msg":"CLWifiPositioningSystemLogic::apply", "event":"elapsed", "begin_mach":6677343176271, "end_mach":6677343215897, "elapsed_s":"0.001651083", "event":"Motion::CoarseMovement", "now_s":"537935870.788828015"}
Jan 17 21:37:50 Owners-iPhone-3 backboardd(IOKit)[66] <Error>: iohideventsystem_client_dispatch_properties_changed:0x10004003
Jan 17 21:37:51 Owners-iPhone-3 locationd[71] <Notice>: {"msg":"CLWifiPositioningSystemLogic::apply", "event":"elapsed", "begin_mach":6677350805334, "end_mach":6677350831802, "elapsed_s":"0.001102833", "event":"Motion::CoarseMovement", "now_s":"537935871.106637001"}
Jan 17 21:37:51 Owners-iPhone-3 dataaccessd(PersistentConnection)[574] <Notice>: SimpleTimer <PCSimpleTimer: 0x105abd500> has fired
Jan 17 21:37:51 Owners-iPhone-3 dataaccessd(PersistentConnection)[574] <Notice>: Invalidating simple timer <PCSimpleTimer: 0x105abd500>
Jan 17 21:37:51 Owners-iPhone-3 dataaccessd(PersistentConnection)[574] <Notice>: Disabling power monitoring for <PCSimpleTimer: 0x105abd500> - 2 timers
Jan 17 21:37:51 Owners-iPhone-3 dataaccessd(PersistentConnection)[574] <Notice>: SimpleTimer <PCSimpleTimer: 0x106356790> has fired
Jan 17 21:37:51 Owners-iPhone-3 dataaccessd(PersistentConnection)[574] <Notice>: Invalidating simple timer <PCSimpleTimer: 0x106356790>
Jan 17 21:37:51 Owners-iPhone-3 dataaccessd(PersistentConnection)[574] <Notice>: Disabling power monitoring for <PCSimpleTimer: 0x106356790> - 1 timers
Jan 17 21:37:51 Owners-iPhone-3 MyMobileApp(WebCore)[5966] <Notice>: 0x103313d00 - PerformanceMonitor::measurePostLoadMemoryUsage: Process was using 158139272 bytes of memory after the page load.
Jan 17 21:37:53 Owners-iPhone-3 locationd[71] <Notice>: {"msg":"CLWifiPositioningSystemLogic::apply", "event":"elapsed", "begin_mach":6677396859076, "end_mach":6677396897944, "elapsed_s":"0.001619500", "event":"Motion::CoarseMovement", "now_s":"537935873.025398970"}
Jan 17 21:37:53 Owners-iPhone-3 locationd[71] <Notice>: {"msg":"CLWifiPositioningSystemLogic::apply", "event":"elapsed", "begin_mach":6677404480228, "end_mach":6677404523844, "elapsed_s":"0.001817333", "event":"Motion::CoarseMovement", "now_s":"537935873.342646003"}
Jan 17 21:37:54 Owners-iPhone-3 CommCenter(libATCommandStudioDynamic.dylib)[88] <Notice>: QMI: Svc=0x03(NAS) Ind MsgId=0x0051 Bin=['01 1F 00 80 03 02 04 ED 71 51 00 13 00 14 06 00 BF F5 A3 FF 8C 00 A2 01 00 64 A4 03 00 01 64 00']
The request just reaches the web server but it returned with 401 error. Once app is killed and restarted it starts working again.
IBM Http Server logs
- - [17/Jan/2018:21:01:12 -0500] "GET /worklightconsole/201704051514/css/images/IBM_logo.png HTTP/1.1" 200 720
- - [17/Jan/2018:21:01:12 -0500] "GET /worklightconsole/201704051514/css/fonts/bold/helvetica-neue-bold.woff2 HTTP/1.1" 200 30804
- - [17/Jan/2018:21:11:48 -0500] "GET / HTTP/1.1" 302 283
- - [17/Jan/2018:21:34:20 -0500] "GET /MYProject/authorization/v1/authorization?client_id=4bd3c60d412b36d16f4da069658c0c7fa226cad1&scope=-MYRealm&isAjaxRequest=true&x=0.275786186755855 HTTP/1.1" 200 -
- - [17/Jan/2018:21:34:20 -0500] "GET /MyProject/adapters/SecurityAdapter/security/login HTTP/1.1" 401 41
- - [17/Jan/2018:21:34:21 -0500] "GET /MyProject/authorization/v1/authorization?response_type=code&client_id=4bd3c60d412b36d16f4da069658c0c7fa226cad1&redirect_uri=http%3A%2F%2Fmfpredirecturi&scope=MYRealm&isAjaxRequest=true&x=0.6627940373520301 HTTP/1.1" 200 25
- - [17/Jan/2018:21:34:22 -0500] "POST /analytics-service/data HTTP/1.1" 201 -
- - [17/Jan/2018:21:34:22 -0500] "GET /analytics-service/data/administration/apps/worklight/getSettings HTTP/1.1" 200 1407
- - [17/Jan/2018:21:34:25 -0500] "POST /MyProject/apps/services/api/MYMobileApp/iphone/login HTTP/1.1" 401 166
- - [17/Jan/2018:21:34:26 -0500] "POST /analytics-service/data HTTP/1.1" 201 -
- - [17/Jan/2018:21:36:38 -0500] "GET /MyProject/adapters/AnnouncementsAdapter/announcements/fetchannouncements HTTP/1.1" 401 41
- - [17/Jan/2018:21:36:40 -0500] "POST /analytics-service/data HTTP/1.1" 201 -
- - [17/Jan/2018:21:36:40 -0500] "GET /analytics-service/data/administration/apps/worklight/getSettings HTTP/1.1" 200 1407
- - [17/Jan/2018:21:37:06 -0500] "GET /MyProject/authorization/v1/authorization?client_id=4bd3c60d412b36d16f4da069658c0c7fa226cad1&scope=-MYRealm&isAjaxRequest=true&x=0.410883442826542 HTTP/1.1" 403 19
- - [17/Jan/2018:21:37:07 -0500] "GET /MyProject/adapters/SecurityAdapter/security/login HTTP/1.1" 401 41
- - [17/Jan/2018:21:37:08 -0500] "POST /analytics-service/data HTTP/1.1" 201 -
- - [17/Jan/2018:21:37:44 -0500] "GET /MyProject/adapters/AnnouncementsAdapter/announcements/fetchannouncements HTTP/1.1" 401 41
- - [17/Jan/2018:21:37:44 -0500] "POST /analytics-service/data HTTP/1.1" 201 -
- - [17/Jan/2018:21:37:44 -0500] "GET /analytics-service/data/administration/apps/worklight/getSettings HTTP/1.1" 200 1407
- - [17/Jan/2018:21:34:25 -0500] "POST /MyProject/apps/services/api/MYMobileApp/iphone/login HTTP/1.1" 504 315
- - [17/Jan/2018:21:34:25 -0500] "POST /MyProject/apps/services/my_custom_auth_request_url HTTP/1.1" 504 315
- - [17/Jan/2018:21:34:38 -0500] "POST /MyProject/apps/services/api/MYMobileApp/iphone/login HTTP/1.1" 504 315
- - [17/Jan/2018:21:34:38 -0500] "POST /MyProject/apps/services/my_custom_auth_request_url HTTP/1.1" 504 315
- - [17/Jan/2018:21:34:53 -0500] "POST /MyProject/apps/services/my_custom_auth_request_url HTTP/1.1" 504 315
- - [17/Jan/2018:21:34:53 -0500] "POST /MyProject/apps/services/api/MYMobileApp/iphone/login HTTP/1.1" 504 315
- - [17/Jan/2018:21:34:56 -0500] "GET /MyProject/authorization/v1/authorization?response_type=code&client_id=4bd3c60d412b36d16f4da069658c0c7fa226cad1&redirect_uri=http%3A%2F%2Fmfpredirecturi&scope=MYRealm&isAjaxRequest=true&x=0.1482186844277551 HTTP/1.1" 504 315
- - [17/Jan/2018:21:40:04 -0500] "GET /MyProject/authorization/v1/authorization?client_id=4bd3c60d412b36d16f4da069658c0c7fa226cad1&scope=-MYRealm&isAjaxRequest=true&x=0.5411687142084214 HTTP/1.1" 200 -
- - [17/Jan/2018:21:40:04 -0500] "GET /MyProject/adapters/SecurityAdapter/security/login HTTP/1.1" 401 41
- - [17/Jan/2018:21:40:06 -0500] "POST /analytics-service/data HTTP/1.1" 201 -
- - [17/Jan/2018:21:40:06 -0500] "GET /analytics-service/data/administration/apps/worklight/getSettings HTTP/1.1" 200 1407
- - [17/Jan/2018:21:35:12 -0500] "POST /MyProject/apps/services/api/MYMobileApp/iphone/login HTTP/1.1" 504 315
- - [17/Jan/2018:21:35:24 -0500] "POST /MyProject/apps/services/my_custom_auth_request_url HTTP/1.1" 504 315
- - [17/Jan/2018:21:40:33 -0500] "GET /MyProject/adapters/AnnouncementsAdapter/announcements/fetchannouncements HTTP/1.1" 401 41
- - [17/Jan/2018:21:40:34 -0500] "POST /analytics-service/data HTTP/1.1" 201 -
- - [17/Jan/2018:21:40:40 -0500] "GET /MyProject/adapters/AnnouncementsAdapter/announcements/fetchannouncements HTTP/1.1" 401 41
- - [17/Jan/2018:21:40:40 -0500] "POST /analytics-service/data HTTP/1.1" 201 -
- - [17/Jan/2018:21:40:44 -0500] "GET /MyProject/authorization/v1/authorization?client_id=4bd3c60d412b36d16f4da069658c0c7fa226cad1&scope=-MYRealm&isAjaxRequest=true&x=0.9602466115384183 HTTP/1.1" 200 -
- - [17/Jan/2018:21:40:45 -0500] "GET /MyProject/adapters/SecurityAdapter/security/login HTTP/1.1" 401 41
- - [17/Jan/2018:21:40:46 -0500] "POST /analytics-service/data HTTP/1.1" 201 -
I have a problem drawing objects passing this graphic context
CGContextRef context = UIGraphicsGetCurrentContext();
Here is the code I use to draw
- (void) draw: (CGContextRef) gc
{
CGFloat black[4] = {0.0f, 0.0f, 0.0f, 1.0f}; // R G B + Alpha
CGPoint p [2];
p[0].x = xStart ;
p[0].y = yStart ;
p[1].x = xEnd ;
p[1].y = yEnd ;
CGContextSetStrokeColor(gc, black); //Definie la couleur
CGContextStrokeLineSegments(gc, p, 2 ) ;
}
Some object draw, other don't (very strange) and in the console I read:
Thu Mar 24 21:53:59 MacBook-Air-di-Michele-Giarratana.local IVBricker[381] <Error>: CGContextDrawImage: invalid context 0x0
Thu Mar 24 21:53:59 MacBook-Air-di-Michele-Giarratana.local IVBricker[381] <Error>: CGContextSetStrokeColor: invalid context 0x0
Thu Mar 24 21:53:59 MacBook-Air-di-Michele-Giarratana.local IVBricker[381] <Error>: CGContextStrokeLineSegments: invalid context 0x0
Thu Mar 24 21:53:59 MacBook-Air-di-Michele-Giarratana.local IVBricker[381] <Error>: CGContextSetStrokeColor: invalid context 0x0
Thu Mar 24 21:53:59 MacBook-Air-di-Michele-Giarratana.local IVBricker[381] <Error>: CGContextStrokeLineSegments: invalid context 0x0
Thu Mar 24 21:53:59 MacBook-Air-di-Michele-Giarratana.local IVBricker[381] <Error>: CGContextSetStrokeColor: invalid context 0x0
Thu Mar 24 21:53:59 MacBook-Air-di-Michele-Giarratana.local IVBricker[381] <Error>: CGContextStrokeLineSegments: invalid context 0x0
Thu Mar 24 21:53:59 MacBook-Air-di-Michele-Giarratana.local IVBricker[381] <Error>: CGContextSetStrokeColor: invalid context 0x0
Thu Mar 24 21:53:59 MacBook-Air-di-Michele-Giarratana.local IVBricker[381] <Error>: CGContextStrokeLineSegments: invalid context 0x0
Thu Mar 24 21:53:59 MacBook-Air-di-Michele-Giarratana.local IVBricker[381] <Error>: CGContextSetStrokeColor: invalid context 0x0
Thu Mar 24 21:53:59 MacBook-Air-di-Michele-Giarratana.local IVBricker[381] <Error>: CGContextStrokeLineSegments: invalid context 0x0
So I can't speak to the invalid content errors because we'd need to see the rest of the code but it looks like the colour space could be incorrect (it's not RGB by default). Add this before you call stroke:
CGContextSetStrokeColorSpace(gc, CGColorSpaceCreateDeviceRGB());