Hi, I am getting this error while trying to docker...
# troubleshooting
l
Hi, I am getting this error while trying to docker-compose up. I added flink-fs-azure-hadoop liberty to project dependencies but it still doesnt work. I also download flink locally and add the project far jar and it still doesnt work. Last but not least I add the jar to plugins but for some reason it doesnt been loaded to lib directory. What do you recommend me to do ?
Copy code
Caused by: org.apache.flink.core.fs.UnsupportedFileSystemSchemeException: Could not find a file system implementation for scheme 'abfs'. The scheme is directly supported by Flink through the following plugin(s): flink-fs-azure-hadoop. Please ensure that each plugin resides within its own subfolder within the plugins directory. See https://nightlies.apache.org/flink/flink-docs-stable/docs/deployment/filesystems/plugins/ for more information. If you want to use a Hadoop file system for that scheme, please add the scheme to the configuration fs.allowed-fallback-filesystems. For a full list of supported file systems, please see https://nightlies.apache.org/flink/flink-docs-stable/ops/filesystems/.
m
Have you added the file to a directory inside the plugins folder?
That’s the only way it works
l
Yes I did and it still doesnt work
m
I would recommend to check if you’ve copied it properly
It works like this, I’ve checked this last week when verifying Flink releases
l
I checked it and it looks good...
m
Have you restarted the cluster after adding it?
Check the logs as well
l
yes I did. In the logs it doesnt find it
m
And don’t forget that Docker setups might have a different locations for folders
So you’ve copied to opt/flink/plugins/yourfiledir/. ?
l
yes
@Martijn Visser It still doesnt work... In other components the snapshots are working when the jar is in plugins. However in my app I need this jar for FileSink class but the app is failling when the jar is in plugins directory
m
If you post your config, we can all see, learn and potentially try to solve it
l
Copy code
This is the only thing I put in the config 
    val accountName = account_name
    val accountKey = account_key
    val props = new Properties
    props.put(s"fs.azure.account.key.$accountName.dfs.core.windows.net", accountKey)
    val conf = ConfigurationUtils.createConfiguration(props)
    FileSystem.initialize(conf, null)
    val env = StreamExecutionEnvironment.getExecutionEnvironment
This how I use fileSink
Copy code
FileSink
  .forBulkFormat(
    new Path(s"abfs://$containerName@$accountName.dfs.core.windows.net/"),
    ParquetProtoWriters.forType(classTag[A].runtimeClass.asInstanceOf[Class[A]])
  )
  .withBucketAssigner(EntityBucketAssigner.apply)
  .withOutputFileConfig(
    OutputFileConfig
      .builder()
      .withPartSuffix(".parquet")
      .build()
  )
  .build()
m
That's not your Docker setup, right?
Or your cluster setup
val accountName = <account_name>
val accountKey = <account_key>
val props = new Properties
props.put(s"fs.azure.account.key.$accountName.dfs.core.windows.net", accountKey)
This won't work either way, because it's a plugin, so it has a separate class loader. That's also what the documentation explains on plugins
l
How do you recommend to pass these configs ?
This is my docker-compose
Copy code
service:
    image: my_image
    ports:
      - '8081:8081'
      - '9999:9999'
    command: 'standalone-job --job-classname com.controlup.service.Stream'
    hostname: service
    environment:
      - |
        FLINK_PROPERTIES=
        jobmanager.rpc.address: service
        parallelism.default: 1
        metrics.reporters: prom
        metrics.reporter.prom.factory.class: org.apache.flink.metrics.prometheus.PrometheusReporterFactory
        metrics.reporter.prom.port: 9999
        jobmanager.bind-host: 0.0.0.0
    networks:
      test_network:
        aliases:
          - service
        ipv4_address: 192.124.0.5
    depends_on:
      - "kafka"
    healthcheck:
      test: [ "CMD", "./bin/flink", "list" ]
      interval: 30s
      timeout: 10s
      retries: 4

  taskmanager:
    image: my_image
    ports:
      - '9998:9998'
    depends_on:
      - service
    command: taskmanager
    hostname: taskmanager
    environment:
      - |
        FLINK_PROPERTIES=
        jobmanager.rpc.address: service
        taskmanager.memory.process.size: 2g
        taskmanager.memory.managed.size: 0m
        taskmanager.memory.network.max: 64m
        parallelism.default: 1
        metrics.reporters: prom
        metrics.reporter.prom.factory.class: org.apache.flink.metrics.prometheus.PrometheusReporterFactory
        metrics.reporter.prom.port: 9998
    networks:
      test_network:
        aliases:
          - taskmanager
        ipv4_address: 192.124.0.6

networks:
  test_network:
    driver: bridge
    ipam:
      config:
        - subnet: 192.124.0.0/16
m
So where are you copying the JAR to the right place?
l
In dockerFile
m
That's the most interesting config part 🙂
l
Copy code
FROM flink:1.17-scala_2.12-java11
RUN mkdir /opt/flink/plugins/azure-fs-hadoop/
RUN cp /opt/flink/opt/flink-azure-fs-hadoop-*.jar /opt/flink/plugins/azure-fs-hadoop/ && chown -R flink: /opt/flink/plugins/azure-fs-hadoop/
RUN ln -fs /opt/flink/opt/flink-azure-fs-hadoop-*.jar /opt/flink/lib/.
RUN apt remove -y curl libcurl4
RUN apt update && apt -y install telnet libc-bin libc6 libexpat1 zlib1g unzip openssl
m
2024-01-02 103254,175 INFO org.apache.flink.core.plugin.DefaultPluginManager [] - Plugin loader with ID not found, creating it: azure-fs-hadoop
Works like a charm here
I used
Copy code
version: '3.8'
services:
  jobmanager:
    build: flink-init/.
    ports:
      - "8081:8081"
    command: jobmanager
    environment:
      - |
        FLINK_PROPERTIES=
        jobmanager.rpc.address: jobmanager

  taskmanager:
    build: flink-init/.
    depends_on:
      - jobmanager
    command: taskmanager
    environment:
      - |
        FLINK_PROPERTIES=
        jobmanager.rpc.address: jobmanager
        taskmanager.numberOfTaskSlots: 2

  sql-client:
    build: flink-init/.
    command: bin/sql-client.sh
    depends_on:
      - jobmanager
    environment:
      - |
        FLINK_PROPERTIES=
        jobmanager.rpc.address: jobmanager
        rest.address: jobmanager
As my Docker Compose file
l
What do you think is the issue with my docker-compose ?
m
I think you're referring to a wrong image (since your pointing to
my-image
), I'm referring to my Dockerfile and running
docker-compose up --build
to build the image if I make a change to the Dockerfile
l
Thank you. I will check that and update. Regarding the comment you mentioned about my use in props, Do you have a suggestion how to pass > t(s"fs.azure.account.key.$accountName.dfs.core.windows.net", accountKey) In the right way instead of using props
l
Thank you !
@Martijn Visser Apparently the Dockerfile version I sent you, is including coping the jar to lib directory. I will send you the right Dockerfile. Hope you can look again
Copy code
FROM flink:1.17-scala_2.12-java11
RUN mkdir /opt/flink/plugins/azure-fs-hadoop/
RUN cp /opt/flink/opt/flink-azure-fs-hadoop-*.jar /opt/flink/plugins/azure-fs-hadoop/ && chown -R flink: /opt/flink/plugins/azure-fs-hadoop/
RUN apt remove -y curl libcurl4
RUN apt update && apt -y install telnet libc-bin libc6 libexpat1 zlib1g unzip openssl
m
That's the same Dockerfile?
l
No. In the previous one I moved the jar to the lib directory
m
In the previous one you also copied it to the plugins folder, line 3.
l
Right. I am doing it also here
m
Copy code
2024-01-03 09:04:24,728 INFO  org.apache.flink.core.plugin.DefaultPluginManager            [] - Plugin loader with ID not found, creating it: azure-fs-hadoop
Still works
l
Do you also use FileSink in your image ?
m
FileSink is an application implementation, not a cluster
l
I am using it in my code and I get This error -
Caused by: org.apache.hadoop.fs.UnsupportedFileSystemException: No FileSystem for scheme "file"
The only schema I am using is abfs
m
So a different error
Which is a known issue, https://issues.apache.org/jira/browse/FLINK-32241
setting fs.azure.data.blocks.buffer to array makes abfs use memory to cache instead of local disk so that it doesn't need localfilesystem.
The mitigation is literally already provided above your question
I am going to stop helping on this topic though: I've replied multiple times, tested it locally, but I don't think you've done a lot of effort to actually fix these issues yourself. Please put a bit more effort in this yourself
l
I appreciate your help. I can tell you that I am investing a lot of efforts on this issue