# Luftdatenpumpe: "UnicodeEncodeError" when emitting data to PostGIS

**URL:** <https://community.panodata.org/t/luftdatenpumpe-unicodeencodeerror-when-emitting-data-to-postgis/255>\
**Category:** Air quality data\
**Tags:** luftdatenpumpe\
**Created:** [December 10, 2022, 9:02pm UTC](https://community.panodata.org/t/luftdatenpumpe-unicodeencodeerror-when-emitting-data-to-postgis/255 "2022-12-10T21:02:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oliverr](https://community.panodata.org/letter_avatar_proxy/v4/letter/o/ce73a5/32.png) [@oliverr](https://community.panodata.org/u/oliverr)\
**Post date:** [December 10, 2022, 9:02pm UTC](https://community.panodata.org/t/luftdatenpumpe-unicodeencodeerror-when-emitting-data-to-postgis/255/1 "2022-12-10T21:02:02Z")

</div>

Hi,

i try to install the Luftdatenpumpe at a Debian 11.  
I get a failure if i try to do this step " Run `luftdatenpumpe` for the first time to manifest database schema:"

```auto
2022-12-10 20:57:54,783 [luftdatenpumpe.engine] INFO : Emitting to target data sinks, this might take some time
  0%| | 0/2 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/usr/local/bin/luftdatenpumpe", line 8, in <module>
    sys.exit(run())
  File "/usr/local/lib/python3.9/dist-packages/luftdatenpumpe/commands.py", line 186, in run
    run_engine(options)
  File "/usr/local/lib/python3.9/dist-packages/luftdatenpumpe/commands.py", line 327, in run_engine
    engine.process(data)
  File "/usr/local/lib/python3.9/dist-packages/luftdatenpumpe/engine.py", line 73, in process
    target.emit(item)
  File "/usr/local/lib/python3.9/dist-packages/luftdatenpumpe/target/rdbms.py", line 78, in emit
    return self.store_station(station)
  File "/usr/local/lib/python3.9/dist-packages/luftdatenpumpe/target/rdbms.py", line 199, in store_station
    self.stationtable.upsert(stationdata, ["station_id"])
  File "/usr/local/lib/python3.9/dist-packages/dataset/table.py", line 264, in upsert
    row_count = self.update(row, keys, ensure=False, return_count=True)
  File "/usr/local/lib/python3.9/dist-packages/dataset/table.py", line 210, in update
    rp = self.db.executable.execute(stmt)
  File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 1011, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
    ret = self._execute_context(
  File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 1514, in _handle_dbapi_exception
    util.raise_(exc_info[1], with_traceback=exc_info[2])
  File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.9/dist-packages/sqlalchemy/engine/default.py", line 608, in do_execute
    cursor.execute(statement, parameters)
UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 41: ordinal not in range(128)

```

How can i fix this issue?

Thanks,  
Oliver

---

<div class="post-metadata">

**Author:** ![Andreas.Motl](https://community.panodata.org/user_avatar/community.panodata.org/andreas.motl/32/9_2.png) [@Andreas.Motl](https://community.panodata.org/u/Andreas.Motl)\
**Post date:** [December 10, 2022, 11:11pm UTC](https://community.panodata.org/t/luftdatenpumpe-unicodeencodeerror-when-emitting-data-to-postgis/255/2 "2022-12-10T23:11:03Z")

</div>

Hi Oliver,

thank you for writing in, and for creating an issue over at [`UnicodeEncodeError` when emitting data to PostGIS · Issue #42 · earthobservations/luftdatenpumpe · GitHub](https://github.com/earthobservations/luftdatenpumpe/issues/42). It was the right choice to report such a problem. I hope we can resolve the problem you are observing.

With kind regards,  
Andreas.

---

<div class="post-metadata">

**Author:** ![Andreas.Motl](https://community.panodata.org/user_avatar/community.panodata.org/andreas.motl/32/9_2.png) [@Andreas.Motl](https://community.panodata.org/u/Andreas.Motl)\
**Post date:** [December 11, 2022, 6:34pm UTC](https://community.panodata.org/t/luftdatenpumpe-unicodeencodeerror-when-emitting-data-to-postgis/255/3 "2022-12-11T18:34:26Z")

</div>

> [@Andreas.Motl](#):
>
> I hope we can resolve the problem you are observing.

The problem has been resolved be reinstalling the software, including Luftdatenpumpe. Thanks, @oliverr.

– [`UnicodeEncodeError` when emitting station data to PostGIS · Issue #42 · earthobservations/luftdatenpumpe · GitHub](https://github.com/earthobservations/luftdatenpumpe/issues/42#issuecomment-1345604095)
