Skip to content

Build failing randomly - usually related to in app permissions #212

@rellisdev

Description

@rellisdev

My build is randomly failing a lot more often than it used to. I think I've narrowed it down to when there is a mismatch in permissions in my app (i.e a user doesn't have entity access but does have page access to something - something along those lines) the thing is, these aren't app errors, my app builds and runs fine but a button might not appear for the user, which is fine in app but it seems in the buildpack it doesn't like if that happens.

I can't ever really narrow down this issue, I just have to do some trial and error until I get a working folder that builds successfully. I've placed the docker logs below but it doesn't appear to be useful at all

Mendix version: 10.18.5
Java version: 21
buildpack version: 6.0.0

[+] Building 21.6s (10/13) docker:default
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 2.87kB 0.0s
=> [internal] load metadata for docker.io/library/mendix-rootfs:app 0.0s
=> [internal] load metadata for docker.io/library/mendix-rootfs:builder 0.0s
=> CACHED [builder 1/4] FROM docker.io/library/mendix-rootfs:builder 0.0s
=> [stage-1 1/4] FROM docker.io/library/mendix-rootfs:app 0.0s
=> [internal] load build context 1.7s
=> => transferring context: 115.58MB 1.7s
=> [builder 2/4] COPY project /opt/mendix/build 1.8s
=> [builder 3/4] COPY scripts/startup.py scripts/vcap_application.json /opt/mendix/build/ 0.0s
=> ERROR [builder 4/4] RUN mkdir -p /tmp/buildcache/bust /tmp/cf-deps /var/mendix/build /var/mendix/build/.local && chmod +rx /opt/mendix/buildpack/compila 18.0s

[builder 4/4] RUN mkdir -p /tmp/buildcache/bust /tmp/cf-deps /var/mendix/build /var/mendix/build/.local && chmod +rx /opt/mendix/buildpack/compilation.py /opt/mendix/buildpack/buildpack/stage.py /opt/mendix/build/startup.py && cd /opt/mendix/buildpack && ./compilation.py /opt/mendix/build /tmp/buildcache /tmp/cf-deps 0 && rm -fr /tmp/buildcache /tmp/javasdk /tmp/opt /tmp/downloads /opt/mendix/buildpack/compilation.py /var/mendix && ln -s /opt/mendix/.java /opt/mendix/build && chown -R 1001:0 /opt/mendix && chmod -R g=u /opt/mendix:
0.896 INFO: Mendix project compilation phase...
1.322 INFO: get_java_major_version : major_version - 21
1.323 INFO: Preflight check on Mendix version [10.18.5.65446] and stack [cflinuxfs4]...
1.323 INFO: Preflight check completed
7.753 INFO: checking is micrometer metrics enabled
7.753 INFO: checking is micrometer metrics enabled
7.753 INFO: Usage metering is NOT enabled
17.84 Traceback (most recent call last):
17.84 File "/opt/mendix/buildpack/lib/python3.11/site-packages/urllib3/connection.py", line 199, in _new_conn
17.85 sock = connection.create_connection(
17.85 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17.85 File "/opt/mendix/buildpack/lib/python3.11/site-packages/urllib3/util/connection.py", line 60, in create_connection
17.85 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
17.85 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17.85 File "/usr/lib64/python3.11/socket.py", line 962, in getaddrinfo
17.85 for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
17.85 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17.85 socket.gaierror: [Errno -2] Name or service not known
17.85
17.85 The above exception was the direct cause of the following exception:
17.85
17.85 Traceback (most recent call last):
17.85 File "/opt/mendix/buildpack/lib/python3.11/site-packages/urllib3/connectionpool.py", line 789, in urlopen
17.85 response = self._make_request(
17.85 ^^^^^^^^^^^^^^^^^^^
17.85 File "/opt/mendix/buildpack/lib/python3.11/site-packages/urllib3/connectionpool.py", line 490, in _make_request
17.85 raise new_e
17.85 File "/opt/mendix/buildpack/lib/python3.11/site-packages/urllib3/connectionpool.py", line 466, in _make_request
17.85 self._validate_conn(conn)
17.85 File "/opt/mendix/buildpack/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1095, in _validate_conn
17.85 conn.connect()
17.85 File "/opt/mendix/buildpack/lib/python3.11/site-packages/urllib3/connection.py", line 693, in connect
17.85 self.sock = sock = self._new_conn()
17.85 ^^^^^^^^^^^^^^^^
17.85 File "/opt/mendix/buildpack/lib/python3.11/site-packages/urllib3/connection.py", line 206, in _new_conn
17.85 raise NameResolutionError(self.host, self, e) from e
17.85 urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPSConnection object at 0x7ff5cb9dd590>: Failed to resolve 'cdn.mendix.com' ([Errno -2] Name or service not known)
17.85
17.85 The above exception was the direct cause of the following exception:
17.85
17.85 Traceback (most recent call last):
17.85 File "/opt/mendix/buildpack/lib/python3.11/site-packages/requests/adapters.py", line 667, in send
17.85 resp = conn.urlopen(
17.85 ^^^^^^^^^^^^^
17.85 File "/opt/mendix/buildpack/lib/python3.11/site-packages/urllib3/connectionpool.py", line 843, in urlopen
17.85 retries = retries.increment(
17.85 ^^^^^^^^^^^^^^^^^^
17.85 File "/opt/mendix/buildpack/lib/python3.11/site-packages/urllib3/util/retry.py", line 519, in increment
17.86 raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
17.86 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17.86 urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='cdn.mendix.com', port=443): Max retries exceeded with url: /runtime/mendix-10.18.5.65446.tar.gz (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7ff5cb9dd590>: Failed to resolve 'cdn.mendix.com' ([Errno -2] Name or service not known)"))
17.86
17.86 During handling of the above exception, another exception occurred:
17.86
17.86 Traceback (most recent call last):
17.86 File "/opt/mendix/buildpack/./compilation.py", line 76, in
17.86 compilation_globals = call_buildpack_compilation()
17.86 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17.86 File "/opt/mendix/buildpack/./compilation.py", line 61, in call_buildpack_compilation
17.86 return runpy.run_module("buildpack.stage", run_name="main")
17.86 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17.86 File "", line 229, in run_module
17.86 File "", line 88, in _run_code
17.86 File "/opt/mendix/buildpack/buildpack/stage.py", line 211, in
17.86 runtime.stage(BUILDPACK_DIR, BUILD_DIR, CACHE_DIR)
17.86 File "/opt/mendix/buildpack/buildpack/core/runtime.py", line 71, in stage
17.86 resolve_runtime_dependency(buildpack_dir, build_path, cache_path)
17.86 File "/opt/mendix/buildpack/buildpack/core/runtime.py", line 89, in resolve_runtime_dependency
17.86 util.resolve_dependency(
17.86 File "/opt/mendix/buildpack/buildpack/util.py", line 332, in resolve_dependency
17.86 download(url, cached_location)
17.86 File "/opt/mendix/buildpack/buildpack/util.py", line 389, in download
17.86 response = requests.get(url, stream=True)
17.86 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17.86 File "/opt/mendix/buildpack/lib/python3.11/site-packages/requests/api.py", line 73, in get
17.86 return request("get", url, params=params, **kwargs)
17.86 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17.86 File "/opt/mendix/buildpack/lib/python3.11/site-packages/requests/api.py", line 59, in request
17.86 return session.request(method=method, url=url, **kwargs)
17.86 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17.86 File "/opt/mendix/buildpack/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
17.86 resp = self.send(prep, **send_kwargs)
17.86 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17.86 File "/opt/mendix/buildpack/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
17.86 r = adapter.send(request, **kwargs)
17.86 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17.86 File "/opt/mendix/buildpack/lib/python3.11/site-packages/requests/adapters.py", line 700, in send
17.87 raise ConnectionError(e, request=request)
17.87 requests.exceptions.ConnectionError: HTTPSConnectionPool(host='cdn.mendix.com', port=443): Max retries exceeded with url: /runtime/mendix-10.18.5.65446.tar.gz (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7ff5cb9dd590>: Failed to resolve 'cdn.mendix.com' ([Errno -2] Name or service not known)"))


Dockerfile:44

43 | # 8. Update permissions of /opt/mendix so that the app can run as a non-root user
44 | >>> RUN mkdir -p /tmp/buildcache/bust /tmp/cf-deps /var/mendix/build /var/mendix/build/.local &&
45 | >>> chmod +rx /opt/mendix/buildpack/compilation.py /opt/mendix/buildpack/buildpack/stage.py /opt/mendix/build/startup.py &&
46 | >>> cd /opt/mendix/buildpack &&
47 | >>> ./compilation.py /opt/mendix/build /tmp/buildcache /tmp/cf-deps 0 &&
48 | >>> rm -fr /tmp/buildcache /tmp/javasdk /tmp/opt /tmp/downloads /opt/mendix/buildpack/compilation.py /var/mendix &&
49 | >>> ln -s /opt/mendix/.java /opt/mendix/build &&
50 | >>> chown -R ${USER_UID}:0 /opt/mendix &&
51 | >>> chmod -R g=u /opt/mendix
52 |

ERROR: failed to solve: process "/bin/sh -c mkdir -p /tmp/buildcache/bust /tmp/cf-deps /var/mendix/build /var/mendix/build/.local && chmod +rx /opt/mendix/buildpack/compilation.py /opt/mendix/buildpack/buildpack/stage.py /opt/mendix/build/startup.py && cd /opt/mendix/buildpack && ./compilation.py /opt/mendix/build /tmp/buildcache /tmp/cf-deps 0 && rm -fr /tmp/buildcache /tmp/javasdk /tmp/opt /tmp/downloads /opt/mendix/buildpack/compilation.py /var/mendix && ln -s /opt/mendix/.java /opt/mendix/build && chown -R ${USER_UID}:0 /opt/mendix && chmod -R g=u /opt/mendix" did not complete successfully: exit code: 1
Error response from daemon: reference does not exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions