Skip to content

No server-id.json file created in the config directory #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
samcat116 opened this issue Jan 15, 2021 · 14 comments
Closed

No server-id.json file created in the config directory #3

samcat116 opened this issue Jan 15, 2021 · 14 comments

Comments

@samcat116
Copy link

I am trying to deploy this chart but am getting the following error
Unhandled exception: Error when opening /factorio/config/server-id.json for writing: No such file or directory

This seems to be an autogenerated file, but since all the config files are mounted in read only as a ConfigMap, it cannot create it.

@coreysabia
Copy link

I just had this same issue when trying to deploy. Maybe its due to changes in the most recent update? Is this a newly generated file?

@SQLJames
Copy link
Owner

Would you mind placing in your values file? I am wondering if it's related to 1.1 that was released, I haven't created a new server on that version yet.

@samcat116
Copy link
Author

# Number of replicas to create (only 1 is supported)
replicaCount: 1

image:
  repository: "factoriotools/factorio"
  # Container image pull policy
  pullPolicy: IfNotPresent
  # Overrides the image tag whose default is the chart appVersion.
  tag: "latest"

# Security options the operator container should run with
securityContext:
  runAsUser: 1000
  fsGroup: 2000

service:
  type: LoadBalancer
  port: 30000
# Compute Resources required by the operator container
resources: # +doc-gen:break
  requests:
    memory: 512Mi
    cpu: 500m
# Node labels for pod assignment
# Example:
# nodeSelector:  
#  beta.kubernetes.io/os: linux
#  beta.kubernetes.io/arch: amd64
nodeSelector: {} # +doc-gen:break

# Tolerations for pod assignment
tolerations: []

# Affinity rules for pod assignment
affinity: {}

# Sets the data persistence volume configuration
persistence:
  dataDir: 
    Size: 
    existingClaim: synology-nfs-pvc
  storageClass:
factorioServer:
  # specify a save name
  save_name: "game-save"
  # Generate a New Save
  generate_new_save: true
  # Update mods on start
  update_mods_on_start: false
  # lets the game know if you want to load the latest save
  load_latest_save: false
  # Location of the configuration files that are generated
  config_path: /srv 

serverSettings:
  # Your Instance Name
  name: name
  # Your Instance Description
  description: "Factorio running on Kubernetes"
  tags:
  - game
  - tags
  # Maximum number of players allowed, admins can join even a full server. 0 means unlimited.
  max_players: 0
  # Game visibility
  visibility:
    # Game will be published on the official Factorio matching server
    public: true
    # Game will be broadcast on LAN
    lan: true
  # Your factorio.com login credentials. Required for games with visibility public
  username: '[email protected]'
  password: 'pw'
  # Authentication token. May be used instead of password above.
  token: ''
  # password required to log into the factorio server
  game_password: 'pw'
  # When set to true, the server will only allow clients that have a valid Factorio.com account
  require_user_verification: true
  # optional, default value is 0. 0 means unlimited.
  max_upload_in_kilobytes_per_second: 0
  # optional, default value is 5. 0 means unlimited.
  max_upload_slots: 5
  # optional one tick is 16ms in default speed, default value is 0. 0 means no minimum.
  minimum_latency_in_ticks: 0
  # Players that played on this map already can join even when the max player limit was reached.
  ignore_player_limit_for_returning_players: false
  # possible values are, true, false and admins-only
  allow_commands: admins-only
  # Autosave interval in minutes
  autosave_interval: 10
  # server autosave slots, it is cycled through when the server autosaves.
  autosave_slots: 5
  # How many minutes until someone is kicked when doing nothing, 0 for never.
  afk_autokick_interval: 0
  # Whether should the server be paused when no players are present.
  auto_pause: true
  # specifies if anyone can pause or only admins
  only_admins_can_pause_the_game: true
  # Whether autosaves should be saved only on server or also on all connected clients. Default is true.
  autosave_only_on_server: true
  #  Highly experimental feature, enable only at your own
  #  risk of losing your saves. On UNIX systems, server will fork itself to create an
  #  autosave. Autosaving on connected Windows clients will be disabled regardless of
  #  autosave_only_on_server option.
  non_blocking_saving: false
  #  Long network messages are split into segments that are sent
  #  over multiple ticks. Their size depends on the number of peers currently connected.
  #  Increasing the segment size will increase upload bandwidth requirement for the server
  #  and download bandwidth requirement for clients. This setting only affects server
  #  outbound messages. Changing these settings can have a negative impact on connection
  #  stability for some clients.
  minimum_segment_size: 25
  minimum_segment_size_peer_count: 20
  maximum_segment_size: 100
  maximum_segment_size_peer_count: 10

# Password and port for the rcon service
rcon:
  password: "01234567890123456"
  port: 27015

map_gen_settings:
  #The inverse of water scale in the map generator GUI.
  terrain_segmentation: 1
  #  The equivalent to water coverage in the map generator GUI. Higher coverage means
  #  more water in larger oceans.
  #  Water level = 10 * log2(this value)
  water: 1
  # Width and height of map, in tiles; 0 means infinite
  width: 0
  # Width and height of map, in tiles; 0 means infinite
  height: 0
  # Multiplier for biter free zone radius
  starting_area: 1
  peaceful_mode: false
  autoplace_controls:
    coal:
      frequency: 1
      size: 1
      richness: 1
    stone:
      frequency: 1
      size: 1
      richness: 1
    copper-ore:
      frequency: 1
      size: 1
      richness: 1
    iron-ore:
      frequency: 1
      size: 1
      richness: 1
    uranium-ore:
      frequency: 1
      size: 1
      richness: 1
    crude-oil:
      frequency: 1
      size: 1
      richness: 1
    trees:
      frequency: 1
      size: 1
      richness: 1
    enemy-base:
      frequency: 1
      size: 1
      richness: 1
  cliff_settings:
    # Name of the cliff prototype
    name: cliff
    # Elevation of first row of cliffs
    cliff_elevation_0: 10
    # Elevation difference between successive rows of cliffs.
    # This is inversely proportional to frequency in the map generation GUI. Specifically, when set from the GUI the value is 40 / frequency.
    cliff_elevation_interval: 40
    # Called cliff continuity in the map generator GUI. 0 will result in no cliffs, 10 will make all cliff rows completely solid
    richness: 1
  # Overrides for property value generators (map type)
  # Leave elevation blank to get normal terrain.
  # Use ''elevation'': ''0_16-elevation'' to reproduce terrain from 0.16.
  # Use ''elevation'': ''0_17-island'' to get an island.
  # Moisture and terrain type are also controlled via this.
  # "control-setting:moisture:frequency:multiplier is the inverse of the moisture scale in the map generator GUI."
  # "control-setting:moisture:bias is the moisture bias in the map generator GUI."
  # "control-setting:aux:frequency:multiplier is the inverse of the terrain type scale in the map generator GUI."
  # "control-setting:aux:bias is the teraain type bias in the map generator GUI."
  property_expression_names:
    control-setting:moisture:frequency:multiplier: '1'
    control-setting:moisture:bias: '0'
    control-setting:aux:frequency:multiplier: '1'
    control-setting:aux:bias: '0'
  starting_points:
  - "x": 0
    "y": 0
  # Use null for a random seed, number for a specific seed.
  seed: null 

map_settings:
  difficulty_settings:
    recipe_difficulty: 0
    technology_difficulty: 0
    technology_price_multiplier: 1
    research_queue_setting: after-victory
  pollution:
    enabled: true
    # these are values for 60 ticks (1 simulated second)
    # amount that is diffused to neighboring chunk
    diffusion_ratio: 0.02
    min_to_diffuse: 15
    ageing: 1
    expected_max_per_chunk: 150
    min_to_show_per_chunk: 50
    min_pollution_to_damage_trees: 60
    pollution_with_max_forest_damage: 150
    pollution_per_tree_damage: 50
    pollution_restored_per_tree_damage: 10
    max_pollution_to_restore_trees: 20
    enemy_attack_pollution_consumption_modifier: 1
  enemy_evolution:
    enabled: true
    time_factor: 4.0e-06
    destroy_factor: 0.002
    pollution_factor: 9.0e-07
  enemy_expansion:
    enabled: true
    min_base_spacing: 3
    max_expansion_distance: 7
    friendly_base_influence_radius: 2
    enemy_building_influence_radius: 2
    building_coefficient: 0.1
    other_base_coefficient: 2
    neighbouring_chunk_coefficient: 0.5
    neighbouring_base_chunk_coefficient: 0.4
    max_colliding_tiles_coefficient: 0.9
    settler_group_min_size: 5
    settler_group_max_size: 20
    min_expansion_cooldown: 14400
    max_expansion_cooldown: 216000
  unit_group:
    min_group_gathering_time: 3600
    max_group_gathering_time: 36000
    max_wait_time_for_late_members: 7200
    max_group_radius: 30
    min_group_radius: 5
    max_member_speedup_when_behind: 1.4
    max_member_slowdown_when_ahead: 0.6
    max_group_slowdown_factor: 0.3
    max_group_member_fallback_factor: 3
    member_disown_distance: 10
    tick_tolerance_when_member_arrives: 60
    max_gathering_unit_groups: 30
    max_unit_group_size: 200
  steering:
    default:
      radius: 1.2
      separation_force: 0.005
      separation_factor: 1.2
      force_unit_fuzzy_goto_behavior: false
    moving:
      radius: 3
      separation_force: 0.01
      separation_factor: 3
      force_unit_fuzzy_goto_behavior: false
  path_finder:
    negative_path_cache_delay_interval: 2
    fwd2bwd_ratio: 5
    goal_pressure_ratio: 2
    max_steps_worked_per_tick: 100
    max_work_done_per_tick: 8000
    use_path_cache: true
    short_cache_size: 5
    long_cache_size: 25
    short_cache_min_cacheable_distance: 10
    short_cache_min_algo_steps_to_cache: 50
    long_cache_min_cacheable_distance: 30
    cache_max_connect_to_cache_steps_multiplier: 100
    cache_accept_path_start_distance_ratio: 0.2
    cache_accept_path_end_distance_ratio: 0.15
    negative_cache_accept_path_start_distance_ratio: 0.3
    negative_cache_accept_path_end_distance_ratio: 0.3
    cache_path_start_distance_rating_multiplier: 10
    cache_path_end_distance_rating_multiplier: 20
    stale_enemy_with_same_destination_collision_penalty: 30
    ignore_moving_enemy_collision_distance: 5
    enemy_with_different_destination_collision_penalty: 30
    general_entity_collision_penalty: 10
    general_entity_subsequent_collision_penalty: 3
    extended_collision_penalty: 3
    max_clients_to_accept_any_new_request: 10
    max_clients_to_accept_short_new_request: 100
    direct_distance_to_consider_short_request: 100
    short_request_max_steps: 1000
    short_request_ratio: 0.5
    min_steps_to_check_path_find_termination: 2000
    start_to_goal_cost_multiplier_to_terminate_path_find: 500
    overload_levels:
    - 0
    - 100
    - 500
    overload_multipliers:
    - 2
    - 3
    - 4
  max_failed_behavior_count: 3
    ```

@samcat116
Copy link
Author

Only new thing I added was negative_path_cache_delay_interval: 2 under path_finder due to a previous error message. I am also building the container locally as the image hasn't been pushed yet for the latest

@SQLJames
Copy link
Owner

Just for clarification, are you saying you are building the 1.1 docker container locally?

If so, can you place your docker file also?

I apologize for the questions, I'm just trying to gather the information to debug it :)

@samcat116
Copy link
Author

I am just running git clone https://github.com:factoriotools/factorio-docker.git && cd factorio-docker/1.1/ && docker build -t factoriotools/factorio .

@jswny
Copy link

jswny commented Jan 15, 2021

The 1.1.11 Docker image isn't building on their CI setup and hasn't been pushed, so you just have to go into the 1.1/ directory inside the repo and build it manually.

It seems like this server-id.json is a new file generated by newer versions of the server. It contains an autogenerated secret and an ID from the server. According to this Reddit comment, it's only for public games, and it relates to the matchmaking API. So, I don't think you can fill this in the values file like the other files. I guess maybe you could run the raw container manually and generate a file with the settings. Then you could copy over the ID and the secret in that to your values file, but I'm not sure if that would be very sound or even work at all.

@SQLJames
Copy link
Owner

Neat, this didn't come up in my testing. I'll work on this over the weekend. Since it is the first time slot I will have available.

I believe you are correct it's how I'm mounting my configs into that directory. I believe I can specify the subpath in the mountvolume section, this should allow the main folder to have the proper permissions to write the file it needs to.

@jswny
Copy link

jswny commented Jan 15, 2021

Yeah I think it would only have come up if you had set the game to public.

@SQLJames
Copy link
Owner

Hey guys, just wanted to post a follow up here, I have been looking into this issue:

  • I confirmed that it is related to publicly posting the game.
  • The subpath did not seem to work as it didn't allow me to write the files to the directory anymore

I am looking at trying to sidecar a container to properly move the files into the correct location so we can have a directory that allows us to write to the proper location.

However, I can also see there is a pull request we can put into the factoriotools repository. If we can get them to expose the locations of the configs as ENVs instead of just copying them to a location it would also solve this problem. Specifically, if we can just get the --server-id location as an ENV we would be fixed here.

This did also remind me that we are not listing the adminlist.json, whitelist.json, or the banlist.json in the configmap. So I imagine this would also cause some issues when we go to create these files IE ban someone from the server. So we would also run into this issue from this perspective.

The below code snippit is from the docker-entrypoint.sh that is run on startup so you can easily see what I am referencing

FLAGS=(\
  --port "$PORT" \
  --server-settings "$CONFIG/server-settings.json" \
  --server-banlist "$CONFIG/server-banlist.json" \
  --rcon-port "$RCON_PORT" \
  --server-whitelist "$CONFIG/server-whitelist.json" \
  --use-server-whitelist \
  --server-adminlist "$CONFIG/server-adminlist.json" \
  --rcon-password "$(cat "$CONFIG/rconpw")" \
  --server-id /factorio/config/server-id.json \
)

I might see if I can get ahold of the maintainers of the docker project to see if they would be open to changing that script specifically as I continue to work on the sidecar solution. In the meantime @samcat116 , do you want to see if you can modify the docker-entrypoint.sh to point to a different location?

@SQLJames
Copy link
Owner

SQLJames commented Feb 1, 2021

Hey guys sorry for the delay, had some real life distractions come up, I am in the middle of switching jobs.

I put in a pull request for new ENV vars that would address this issue.
I am not sure why their automated tests are failing since I could build it locally, but with that script modification and a few tweaks to the variables file you should be able to get this up and running.

@proegssilb
Copy link

Is there anything I can do to help with this? Public server listing without having to modify the upstream container would be kinda handy for a thing I'm working on.

@SQLJames
Copy link
Owner

It looks like I'm still waiting for the other project to approve my pull request. In the meantime you can build the container with the changes I made. That worked for me when I was testing.

@SQLJames
Copy link
Owner

Solved with #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants